biotite icon indicating copy to clipboard operation
biotite copied to clipboard

Implementing TRR/XTC support

Open padix-key opened this issue 1 year ago • 2 comments

Currently Biotite requires MDTraj as additional dependency only for reading coordinates from trajectory files. However, MDTraj does not support NumPy 2.0, yet, but Biotite 1.0 will require NumPy 2.0. Therefore we could think about removing the dependency by implementing at least the common trajectory file formats .trr and .xtc. Lowering the number of dependencies would also make Biotite more lightweight.

To resolve this issue,

  • the TrajectoryFile classes need to be removed,
  • new trajectory file classes need to be added implementing .trr and .xtc (maybe in structure.io.trr?) and
  • the consistency tests checking against MDTraj need to be removed (could be solved by checking against a fixed CSV file obtained once from MDTraj).

~Taking verbatim code from https://github.com/mdtraj/mdtraj is not possible due to the incompatible license.~ As the xdrfile C-library is also GPL licensed, the entire Trajectory code would need to go into a separate extension package, if we decide to drop the MDTraj dependency.

padix-key avatar Jun 28 '24 10:06 padix-key

I reached out to the MDTraj developers, asking them about their NumPy 2.0 migration plans: https://github.com/mdtraj/mdtraj/issues/1873#issuecomment-2197294604

padix-key avatar Jun 28 '24 16:06 padix-key

#529 temporarily disables trajectory functionalites: https://github.com/biotite-dev/biotite/pull/529/commits/d6ea5069454dbdf2f64b7f49dc0eeb5448889b86

After implementation if this issue, they need to be reenabled.

padix-key avatar Jun 29 '24 15:06 padix-key

Additionally, the two other common trajectory formats, netCDF and DCD, are also supported now with biotraj. I would change the PR title ("Implementing trajectory I/O support without MDTraj" perhaps?), if you're fine with this.

JHKru avatar Aug 19 '24 10:08 JHKru

Biotraj will directly work as a "drop-in replacement" for MDTraj in Biotite, so changes should remain limited to the documentation, tests and the specific py-files for these formats.

JHKru avatar Aug 19 '24 12:08 JHKru

@JHKru Could you comment in https://github.com/conda-forge/staged-recipes/pull/27312, that I can add you as Conda package maintainer?

padix-key avatar Aug 19 '24 16:08 padix-key

Closed via #627

padix-key avatar Aug 20 '24 12:08 padix-key