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

fix alignBioPairwise for updated biopython #1816

Merged
merged 16 commits into from
Feb 8, 2024

Conversation

jamesmkrieger
Copy link
Contributor

The output of Biopython PairwiseAligner align has changed drastically in the latest versions, so the new code has an if block and handles the output depending on whether it matches the new version.

@jamesmkrieger
Copy link
Contributor Author

I think this should be the last thing to be able to use the latest biopython

This was referenced Jan 17, 2024
@jamesmkrieger
Copy link
Contributor Author

oh, Biopython is also not including the biomolecular transformations for assemblies so ProDy can't parse the MMTF files that it writes

@jamesmkrieger
Copy link
Contributor Author

We'll still need checks here too, which can be done using 3enl and 3p3w

@jamesmkrieger
Copy link
Contributor Author

oh, Biopython is also not including the biomolecular transformations for assemblies so ProDy can't parse the MMTF files that it writes

This was actually due to a bug that is now fixed here

@jamesmkrieger
Copy link
Contributor Author

It looks like biotite now works with the output of ProDy. We're still missing the biomoltrans and bonds because biopython doesn't handle those, but then we just get 0 bonds and empty records and it's probably ok.

Python 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.20.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from biotite.structure.io.mmtf import MMTFFile

In [2]: from prody import *

In [3]: ag, header = parsePDB('prody/tests/datafiles/pdb2k39_ca.pdb', header=True)
@> 76 atoms and 116 coordinate set(s) were parsed in 0.13s.
@> Secondary structures were assigned to 37 residues.

In [4]: writeMMTF('prody/tests/datafiles/mmtf2k39_ca', ag, header=header)
Out[4]: 'prody/tests/datafiles/mmtf2k39_ca.mmtf'

In [5]: mmtf_file = MMTFFile.read('prody/tests/datafiles/mmtf2k39_ca.mmtf')

In [6]: mmtf_file['numGroups']
Out[6]: 8816

In [7]: ag.numResidues()*ag.numCoordsets()
Out[7]: 8816

In [8]: mmtf_file['numAtoms']
Out[8]: 8816

In [9]: ag.numAtoms()*ag.numCoordsets()
Out[9]: 8816

In [10]: ag, header = parsePDB('prody/tests/datafiles/pdb6flr.pdb', header=True)
@> 6073 atoms and 1 coordinate set(s) were parsed in 0.19s.
@> Secondary structures were assigned to 484 residues.

In [11]: writeMMTF('prody/tests/datafiles/mmtf6flr', ag, header=header)
/home/jkrieger/software/miniconda/envs/biotite/lib/python3.10/site-packages/Bio/PDB/StructureBuilder.py:89: PDBConstructionWarning: WARNING: Chain A is discontinuous at line 0.
  warnings.warn(
/home/jkrieger/software/miniconda/envs/biotite/lib/python3.10/site-packages/Bio/PDB/StructureBuilder.py:89: PDBConstructionWarning: WARNING: Chain B is discontinuous at line 0.
  warnings.warn(
Out[11]: 'prody/tests/datafiles/mmtf6flr.mmtf'

In [12]: mmtf_file = MMTFFile.read('prody/tests/datafiles/mmtf6flr.mmtf')

In [13]: mmtf_file['numGroups']
Out[13]: 791

In [14]: ag.numResidues()*ag.numCoordsets()
Out[14]: 791

In [15]: ag.numResidues()
Out[15]: 791

In [16]: mmtf_file['numAtoms']
Out[16]: 6073

In [17]: ag.numAtoms()
Out[17]: 6073

In [18]: ag.getCoords()[0]
Out[18]: array([18.18 , 51.053, 34.125])

In [19]: mmtf_file['xCoordList'][0], mmtf_file['yCoordList'][0], mmtf_file['zCoordList'][0]
Out[19]: (18.18, 51.053, 34.125)

This was done in a fresh environment

@jamesmkrieger jamesmkrieger merged commit 0a27ae8 into prody:master Feb 8, 2024
4 checks passed
@jamesmkrieger jamesmkrieger deleted the update_alignBioPairwise branch March 15, 2024 13:06
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.

1 participant