Hi Wandré, The easiest way to avoid recalculating the fingerprints is to keep the FPS file around. The rdkit2fps program calculates the AtomPair fingerprint and converts the resulting DataStructs fingerprint object into a hex-encoded fingerprint, which is stored as text in the FPS file.
One difference that I just realized, however, is that it uses "GetHashedAtomPairFingerprintAsBitVect" while you use "GetAtomPairFingerprint". The example I gave generates a dense fingerprint rather than a sparse one. This difference probably isn't a lot, but it may make my proposed solution unusable for your needs. Regarding a database, I didn't realize you were using a database. Your original email showed a script that didn't make use of a database. The details of how to import/export data from a database are database- and schema-specific. I don't have any experience with the RDKit Postgres cartridge to be able to offer any advice, if that's what you are using. Chemfp includes a programming API, with documentation at http://chemfp.readthedocs.io/en/chemfp-1.3/ , which may help with any data import/export . Depending on your needs, you may find that the FPS file by itself is enough. RDKit also supports adapters from the hex-encoded fingerprint used in the FPS format a dense bit vector using: http://www.rdkit.org/docs-beta/api/rdkit.DataStructs.cDataStructs-module.html#BitVectToFPSText http://www.rdkit.org/docs-beta/api/rdkit.DataStructs.cDataStructs-module.html#CreateFromFPSText Again, note that this is for an ExplicitBitVect and not an IntSparseIntVect. Best regards, Andrew da...@dalkescientific.com > On Jan 11, 2018, at 18:49, Wandré <wandrevel...@gmail.com> wrote: > > Thanks Andrew, I will try this steps. > So, to avoid recalculate fingerprints, how can I calculate them and store in > database? > When I calculate AtomPair fingerprint, returns a > rdkit.DataStructs.cDataStructs.IntSparseIntVect object > How to store this rdkit Python object in a database and how to read them > again? > > -- > Wandré Nunes de Pinho Veloso > Professor Assistente - Unifei - Campus Avançado de Itabira-MG > Doutorando em Bioinformática - Universidade Federal de Minas Gerais - UFMG > Pesquisador do INSILICO - Grupo Interdisciplinar em Simulação e Inteligência > Computacional - UNIFEI > Membro do Grupo de Pesquisa Assinaturas Biológicas da FIOCRUZ > Membro do Grupo de Pesquisa Bioinformática Estrutural da UFMG > Laboratório de Bioinformática e Sistemas - LBS, DCC, UFMG ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Rdkit-discuss mailing list Rdkitfirstname.lastname@example.org https://lists.sourceforge.net/lists/listinfo/rdkit-discuss