volkamerlab / opencadd

A Python library for structural cheminformatics
https://opencadd.readthedocs.io
MIT License
89 stars 18 forks source link

Superposition: Cast universes w and w/o models to atom groups #149

Closed dominiquesydow closed 1 year ago

dominiquesydow commented 1 year ago

Description

Universes can come with or without models. Currently, we only consider universes with models in our superposition module: the first model is selected for the alignment. After this selection, the object type changes from an MDA Universe to AtomGroup.

Example:

# With models
structures = [Structure.from_pdbid("4y72"), Structure.from_pdbid("1xqz"), Structure.from_pdbid("1m17")]
align(structures, user_select=False, method=METHODS["mda"]);

# Without models (casting an MDA NoDataError)
f1, f2, f3 = ...  # Path to PDB files*
structures = [Structure.from_string(f1), Structure.from_string(f2), Structure.from_string(f3)]
align(structures, user_select=False, method=METHODS["mda"]);

*Download PBD files (terminal):

for pdb in 4y72 1xqz 1m17; do wget https://www.rcsb.org/structure/$pdb -o $pdb.pdb; done

Solution

Cast all universes (regardless of whether they contain models or not) to AtomGroup objects.

Todos

Status

codecov-commenter commented 1 year ago

Codecov Report

Merging #149 (656f6b3) into master (097e3b5) will decrease coverage by 0.02%. The diff coverage is 83.33%.

:exclamation: Current head 656f6b3 differs from pull request most recent head 5c932d0. Consider uploading reports for the commit 5c932d0 to get more accurate results