Skip to content

How does MolToPDBFile() determine the order of atoms? #7114

Answered by greglandrum
fyy623 asked this question in FAQ
Discussion options

You must be logged in to vote

@fyy623 the atoms are written to the PDB output in the same order they are in the molecule.
Here's an example, three different atom orderings for ethanol:

In [2]: print(Chem.MolToPDBBlock(Chem.MolFromSmiles('CCO')))
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  O1  UNL     1       0.000   0.000   0.000  1.00  0.00           O  
CONECT    1    2
CONECT    2    3
END


In [3]: print(Chem.MolToPDBBlock(Chem.MolFromSmiles('OCC')))
HETATM    1  O1  UNL     1       0.000   0.000   0.000  1.00  0.00           O  
HETATM    2  C1  UNL     1       0.000   0.000   0.000  …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fyy623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
FAQ
Labels
None yet
2 participants