Hi Greg,
Thanks for the answer. The graphs going in are very simple, so they will just 
be a collection of C,O,S,N atoms obeying valency laws, I will have a look and 
see how the sanitise function deals with my inputs when I have some of the 
other functionality issues iron out.
Best,
Nick
On 21 Mar 2012, at 17:48, Greg Landrum wrote:

On Wed, Mar 21, 2012 at 5:58 PM, Nicholas Firth
<nicholas.fi...@icr.ac.uk<mailto: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

Best,
Nick





The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company 
Limited by Guarantee, Registered in England under Company No. 534147 with its 
Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the 
message is received by anyone other than the addressee, please return the 
message to the sender by replying to it and then delete the message from your 
computer and network.
------------------------------------------------------------------------------
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

Reply via email to