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

File format independent data loading #20

Merged
merged 8 commits into from
Jun 6, 2024
Merged

File format independent data loading #20

merged 8 commits into from
Jun 6, 2024

Conversation

gwirn
Copy link
Collaborator

@gwirn gwirn commented Jun 5, 2024

!! This PR introduces breaking changes !!
It is not possible any more to load multiple trajectories with multiple consecutive calls to PDBData.import_pdb()

With this PR MDAnalysis is used to read in one ore multiple trajectory files. This is now done with a single call:

  • for one file without a topology file
    • PDBData.import_pdb("path/to/trajectory.pdb")
  • for one file with a topology file
    • PDBData.import_pdb("path/to/trajectory.dcd", "path/to/topology.pdb")
  • for multiple files without a topology file
    • PDBData.import_pdb(["path/to/trajectory0.pdb", "path/to/trajectory1.pdb"])
  • for multiple files with a topology file
    • PDBData.import_pdb(["path/to/trajectory0.dcd", "path/to/trajectory1.dcd"], "topology.pdb")

It still preserves the original functionality of the PDBData class.

Additionally the atom selection has changed - it can still be done via a list of atoms like ["CA", "C", "N", "CB", "O"] but can now also use the MDAnalysis selection language

@gwirn gwirn requested a review from degiacom June 5, 2024 13:47
Copy link
Member

@degiacom degiacom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very useful update. It will be breaking for anyone previously loading several multiPDB datasets in succession, but the way to update such older code to conform with this new implementation is trivial (just put all the files in a single list passed as parameter).

@degiacom degiacom merged commit dc31414 into master Jun 6, 2024
3 checks passed
@degiacom degiacom deleted the f_fileformats branch June 6, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants