volkamerlab / teachopencadd

TeachOpenCADD: a teaching platform for computer-aided drug design (CADD) using open source packages and data
https://projects.volkamerlab.org/teachopencadd
Creative Commons Attribution 4.0 International
707 stars 196 forks source link

T020: Problem with RMSD Calculation for Resname 03P #400

Open chinge55 opened 12 months ago

chinge55 commented 12 months ago

I followed the T019 and T020 talkatorials as required and there seems to be some problem with the calculation of RMSD.

Problem While running the following line on T020 Talkatorial:

rmsd = rmsd_for_atomgroups(md_universe, "backbone", ["protein", f"resname {ligand_name}"])
rmsd.head()

image The values on the final column should not have been NaN.


I think the problem is while loading the mda.Universe(). As it gives me a runtime warning:

md_universe = mda.Universe(str(DATA / "topology.pdb"), str(DATA / "trajectory.xtc"))

Warning:

UserWarning: PDB file is missing resid information.  Defaulted to '1'
  warnings.warn("PDB file is missing resid information.

Steps To replicate

  1. I tested the code on my own machine with conda.
  2. Also, I've recreated the bug on colab. https://colab.research.google.com/drive/1DEyWegGy5PBDm9LxBb3Fm8CdcdHvQNNq#scrollTo=d5MsnvTKxTYr

For the replication of the bug, I ran T019 and T020 as they were shown in the website. Only change done was adding nglview and mdanalysis on conda installation.

!conda install -q -y -c conda-forge mdtraj openmm openmmforcefields openff-toolkit pdbfixer pypdb rdkit

Changed To

!conda install -q -y -c conda-forge mdtraj openmm openmmforcefields openff-toolkit pdbfixer pypdb rdkit nglview mdanalysis

Initially I had thought that the problem was with the files created from T019 Talkatorial and downloaded a new files from the link of T020 talkatorial's README(MD_system.pdb, trajectory_.dcd). That also did not solve the issue.