On Wed, Mar 21, 2012 at 5:58 PM, Nicholas Firth <nicholas.fi...@icr.ac.uk> wrote: > Hi All, > I am hoping for a piece of advice, I have a graph (connectivity matrix with > atom indexes) and I want to make a molecule from that graph. I was planning > on creating an sdf and then reading in this way, however I've seen that > rdkit reading in sdf's is quite slow. So the question is, which way to > people think is the quickest to generate an rdkit mol from a graph?
I don't think it's actually reading the molecule from SDF that's slow. The slow part is sanitizing it. More carefully: the slowest part is cleaning up the stereochemistry. Still, if you have a graph already, you should work from there instead of going through an sdf layer. the RWMol class has addAtom() and addBond() methods that you can use to build the molecules. Depending on how much you trust the input you're getting, you can then call either MolOps::sanitizeMol() or use some of the individual functions called from within that to get enough information attached to the molecule for it to be useful. This bit has gotten a lot easier in the svn version of the RDKit since you can now specify which sanitization steps should be carried out. -greg ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel