Acellera / moleculekit

MoleculeKit: Your favorite molecule manipulation kit
Other
198 stars 37 forks source link

RuntimeError: Zero box size detected in `Molecule.box`. Cannot wrap simulation. #86

Closed aqred1 closed 2 years ago

aqred1 commented 2 years ago

I have two pdbs with the same number of atoms - they correspond to different proteins. When trying to compute their RMSD, I get the following error:

rmsd = MetricRmsd(mol1, 'protein and name CA')
data = rmsd.project(mol2)

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
/tmp/ipykernel_10061/796448951.py in <module>
      1 rmsd = MetricRmsd(mol1, 'protein and name CA')
----> 2 data = rmsd.project(mol2)

/ahf/colab/lib/python3.7/site-packages/moleculekit/projections/metricrmsd.py in project(self, mol)
    109 
    110         if self._pbc:
--> 111             mol.wrap(getMolProp("centersel"))
    112         # mol.coords = self._wrapPositions(mol.box, mol.coords, centersel)
    113         mol.align(
/ahf/colab/lib/python3.7/site-packages/moleculekit/molecule.py in wrap(self, wrapsel, fileBonds, guessBonds)
   1511         if np.all(self.box == 0):
   1512             raise RuntimeError(
-> 1513                 "Zero box size detected in `Molecule.box`. Cannot wrap simulation."
   1514             )
   1515 

RuntimeError: Zero box size detected in `Molecule.box`. Cannot wrap simulation.

Perhaps there's a better way to compute RMSDs. Any help is appreciated.

aqred1 commented 2 years ago

I just added pbc=False and this worked. Closing the issue.