Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDBs written without coordinates with OpenEye, sometimes #1967

Open
lilyminium opened this issue Nov 15, 2024 · 0 comments
Open

PDBs written without coordinates with OpenEye, sometimes #1967

lilyminium opened this issue Nov 15, 2024 · 0 comments
Labels

Comments

@lilyminium
Copy link
Collaborator

lilyminium commented Nov 15, 2024

Describe the bug

Sometimes PDB files are written without coordinates with OpenEye. Both times I observed this was from creating a molecule from RDKit.

To Reproduce

(uses MDAnalysis to read and parse the PDB)

from openff.toolkit import Molecule
import MDAnalysis as mda

mol = Molecule.from_smiles("CC")
mol.generate_conformers()
mol.to_file("test.pdb", "PDB")

u = mda.Universe("test.pdb")
u.add_TopologyAttr("elements", u.atoms.types)
rdmol = u.atoms.convert_to("RDKIT")
mol2 = Molecule.from_rdkit(rdmol)
assert len(mol2.conformers)
mol2.to_file("test2.pdb", "PDB")

Output

test.pdb contains coordinates:

> cat test.pdb
ATOM      1  C   UNL     1       0.815  -0.538   0.493  1.00 20.00 
ATOM      2  C   UNL     1       2.155  -0.052  -0.012  1.00 20.00 
ATOM      3  H   UNL     1       0.000   0.001   0.001  1.00 20.00 
ATOM      4  H   UNL     1       0.693  -1.607   0.291  1.00 20.00 
ATOM      5  H   UNL     1       0.730  -0.380   1.572  1.00 20.00 
ATOM      6  H   UNL     1       2.970  -0.591   0.480  1.00 20.00 
ATOM      7  H   UNL     1       2.277   1.017   0.191  1.00 20.00 
ATOM      8  H   UNL     1       2.240  -0.210  -1.091  1.00 20.00 
TER       9      UNL     1 
CONECT    1    2    3    4    5
CONECT    2    6    7    8
MASTER        0    0    0    0    0    0    0    0    8    1    2    0
END

test2.pdb does not:

ATOM      1 C    UNL 
ATOM      2 C    UNL 
ATOM      3 H    UNL 
ATOM      4 H    UNL 
ATOM      5 H    UNL 
ATOM      6 H    UNL 
ATOM      7 H    UNL 
ATOM      8 H    UNL 
TER       9      UNL 
CONECT    1    2    3    4    5
CONECT    2    6    7    8
MASTER        0    0    0    0    0    0    0    0    8    1    2    0
END

If I write it using the RDKitToolkitWrapper though:

ATOM      1  C   UNL     1       0.815  -0.538   0.493  1.00  0.00           C  
ATOM      2  C   UNL     1       2.155  -0.052  -0.012  1.00  0.00           C  
ATOM      3  H   UNL     1       0.000   0.001   0.001  1.00  0.00           H  
ATOM      4  H   UNL     1       0.693  -1.607   0.291  1.00  0.00           H  
ATOM      5  H   UNL     1       0.730  -0.380   1.572  1.00  0.00           H  
ATOM      6  H   UNL     1       2.970  -0.591   0.480  1.00  0.00           H  
ATOM      7  H   UNL     1       2.277   1.017   0.191  1.00  0.00           H  
ATOM      8  H   UNL     1       2.240  -0.210  -1.091  1.00  0.00           H  
CONECT    1    2    3    4    5
CONECT    2    6    7    8
END

Computing environment (please complete the following information):

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants