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

MDAnalysis 2.0.0: Structures fetched by PDB code do not contain elements #93

Open
dominiquesydow opened this issue Aug 27, 2021 · 1 comment
Labels
module-structure Concers opencadd.structure module

Comments

@dominiquesydow
Copy link
Contributor

https://github.com/MDAnalysis/mdanalysis/releases/tag/release-2.0.0

From @schallerdavid volkamerlab/teachopencadd#106 (comment)

With the new release of MDAnalysis 2.0.0 the OpenCADD fetch of PDB structures by PDB codes will not have elements assigned in the mda.Universe. So by default this will not be written to a PDB file. However openbabel requires this information. I found a workaround to add the element information to the mda.Universe in case it is not present:

# retrieve structure from the Protein Data Bank
pdb_id = "2ito"
structure = Structure.from_pdbid(pdb_id)
# element information maybe missing, but important for subsequent PDBQT conversion
if not hasattr(structure.atoms, "elements"):
    structure.add_TopologyAttr('elements', structure.atoms.types)
structure
@dominiquesydow dominiquesydow added the module-structure Concers opencadd.structure module label Aug 27, 2021
@dominiquesydow
Copy link
Contributor Author

Before 2.0.0

ATOM      1  N   ALA A 702       5.243  11.333 -39.231  1.00  0.00      A    N
ATOM      2  CA  ALA A 702       3.878  11.924 -39.337  1.00  0.00      A    C
ATOM      3  C   ALA A 702       3.882  13.125 -40.277  1.00  0.00      A    C

With 2.0.0

ATOM      1  N   ALA X 702       5.243  11.333 -39.231  1.00 48.95      A     
ATOM      2  CA  ALA X 702       3.878  11.924 -39.337  1.00 48.46      A     
ATOM      3  C   ALA X 702       3.882  13.125 -40.277  1.00 48.29      A 

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

No branches or pull requests

1 participant