hmm, I can't reproduce that:
In [16]: inls = [x.strip().split() for x in
file('/Users/landrgr1/Downloads/t.tab').readlines()]
In [17]: inls.pop(0)
Out[17]: ['InChI', 'Original_InChI']
In [18]: for inch,o_inch in inls:
....: m = Chem.MolFromInchi(o_inch)
....: n_inch = Chem.MolToInchi(m)
....: if n_inch!=o_inch:
....: print o_inch
....: print n_inch
....: print Chem.MolToSmiles(m,True)
....:
[05:37:40] WARNING: Proton(s) added/removed
[05:37:41] WARNING: Proton(s) added/removed
[05:37:41] WARNING: Proton(s) added/removed
[05:37:41] WARNING: Charges were rearranged
In [19]: from rdkit.Chem import AllChem
In [20]: for inch,o_inch in inls:
....: m = Chem.MolFromInchi(o_inch)
....: AllChem.Compute2DCoords(m)
....: mb = Chem.MolToMolBlock(m)
....: nm = Chem.MolFromMolBlock(mb)
....: n_inch = Chem.MolToInchi(nm)
....: if n_inch!=o_inch:
....: print o_inch
....: print n_inch
....: print Chem.MolToSmiles(m,True)
....: print Chem.MolToSmiles(nm,True)
....:
[05:39:44] WARNING: Proton(s) added/removed
[05:39:44] WARNING: Proton(s) added/removed
[05:39:44] WARNING: Proton(s) added/removed
[05:39:44] WARNING: Charges were rearranged
In [21]:
Could it be that you forgot to add coordinates before you generated the SD
file?
-greg
On Tue, Jan 28, 2014 at 5:22 AM, Igor Filippov <[email protected]>wrote:
> Here are some examples - "original InChI" were created from the original
> SD file, then a new SD file was created from those and new InChI
> calculated, called here "InChI".
> It's a tab-separated table.
> Thanks for taking time to look at this!
>
> Igor
>
>
> On Mon, Jan 27, 2014 at 10:55 PM, Greg Landrum <[email protected]>wrote:
>
>> On Tue, Jan 28, 2014 at 2:49 AM, Igor Filippov <[email protected]
>> > wrote:
>>
>>> I noticed that if I convert mol to inchi and then back to mol in quite a
>>> few cases
>>> the stereochemistry information gets lost. Is it something that is
>>> handled completely by InChI library
>>> or is RDKit not reading the mols produced from InChI correctly?
>>>
>>
>> It could be problems in the RDKit conversion to or from InChI. The
>> easiest way to check where the problem is coming from is to see if the
>> InChI itself has the correct stereochemistry flags. If not, it's the
>> RDKit->InChI process, otherwise it's InChI->RDKit.
>>
>> Feel free to send along some example molecules if you want me to take a
>> look at them.
>>
>> Best,
>> -greg
>>
>
>
------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends. Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss