Hi Phuong,
MolToMolBlock() needs to generate 2D coordinates when you request
stereochemical information in the output (the default).
In fact, if you do not request stereochemical information, also
MolToMolBlock() returns zero coordinates:
print(Chem.MolToMolBlock(m2, includeStereo=False))
RDKit
4 4 0 0 0 0 0 0 0 0999 V2000
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
4 1 1 0
M END
As the PDB format includes no stereochemistry, no coordinates are
needed, and by default they are zero, as the molecule does not have a
conformation yet.
You may generate 3D coordinates using Chem.rdDistGeom.EmbedMolecule(),
and you most likely also want to add hydrogens to your cyclobutane:
m2 = Chem.AddHs(m2)
rdDistGeom.EmbedMolecule(m2)
print(Chem.MolToPDBBlock(m2))
HETATM 1 C1 UNL 1 0.348 0.970 -0.222 1.00 0.00 C
HETATM 2 C2 UNL 1 0.977 -0.337 0.251 1.00 0.00 C
HETATM 3 C3 UNL 1 -0.338 -0.996 -0.148 1.00 0.00 C
HETATM 4 C4 UNL 1 -0.995 0.349 0.146 1.00 0.00 C
HETATM 5 H1 UNL 1 0.369 1.111 -1.328 1.00 0.00 H
HETATM 6 H2 UNL 1 0.631 1.860 0.355 1.00 0.00 H
HETATM 7 H3 UNL 1 1.858 -0.665 -0.319 1.00 0.00 H
HETATM 8 H4 UNL 1 1.164 -0.271 1.329 1.00 0.00 H
HETATM 9 H5 UNL 1 -0.275 -1.203 -1.246 1.00 0.00 H
HETATM 10 H6 UNL 1 -0.668 -1.825 0.487 1.00 0.00 H
HETATM 11 H7 UNL 1 -1.826 0.608 -0.532 1.00 0.00 H
HETATM 12 H8 UNL 1 -1.245 0.397 1.228 1.00 0.00 H
CONECT 1 2 4 5 6
CONECT 2 3 7 8
CONECT 3 4 9 10
CONECT 4 11 12
END
Have a look here to get yourself started:
http://www.rdkit.org/docs/GettingStartedInPython.html#working-with-3d-molecules
Cheers,
p.
On 07/05/18 18:18, Phuong Chau wrote:
To whom it may concern,
I was trying to save the 3D structure of a chemical which is C1CCC1 in
PDB file. However, I am not sure all of my coordinates are zero as shown:
HETATM 1 C1 UNL 1 0.000 0.000 0.000 1.00
0.00 C
HETATM 2 C2 UNL 1 0.000 0.000 0.000 1.00
0.00 C
HETATM 3 C3 UNL 1 0.000 0.000 0.000 1.00
0.00 C
HETATM 4 C4 UNL 1 0.000 0.000 0.000 1.00
0.00 C
I tried the same chemical with MolToMolBlock and it also gave me zero
coordinates. However, in te example in RDKit website, it showed
non-zero coordinates:
>>> m2 = Chem.MolFromSmiles('C1CCC1')
>>> print(Chem.MolToMolBlock(m2))
RDKit 2D
4 4 0 0 0 0 0 0 0 0999 V2000
1.0607 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.0000 -1.0607 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.0607 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 1.0607 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
4 1 1 0
M END
Would you please explain me why and how can I have the PDB file with
non-zero coordinates?
Thank you so much for your help
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss