Hi,
please see the example below.
Best, Michael
>>> from rdkit import Chem
>>> block = open('truncated.mol').read()
>>> print block
16134395
Marvin 08171214412D
9 8 0 0 0 0 999 V2000
6.4522 4.5670 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
7.1667 4.9795 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
7.8812 4.5670 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.1667 5.8045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.8812 6.2170 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.8812 7.0420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
8.5956 5.8045 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
8.5956 4.9795 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
7.8812 3.7420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
2 3 1 0 0 0 0
2 4 1 6 0 0 0
4 5 1 0 0 0 0
5 6 2 0 0 0 0
5 7 1 0 0 0 0
3 8 1 0 0 0 0
3 9 2 0 0 0 0
M END
# input contains stereo bond between atoms 2 and 4
>>> m=Chem.MolFromMolBlock(block)
>>> from rdkit.Chem import AllChem
>>> block2 = AllChem.MolToMolBlock(m)
>>> print block2
16134395
RDKit 2D
9 8 0 0 0 0 0 0 0 0999 V2000
6.4522 4.5670 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
7.1667 4.9795 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.8812 4.5670 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.1667 5.8045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.8812 6.2170 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.8812 7.0420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
8.5956 5.8045 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
8.5956 4.9795 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
7.8812 3.7420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 6
2 4 1 0
4 5 1 0
5 6 2 0
5 7 1 0
3 8 1 0
3 9 2 0
M END
# stereo bond has migrated to atoms 2 and 3 in the output
--
Michael Palmer
University of Waterloo
Waterloo, Canada
science.uwaterloo.ca/~mpalmer
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss