MolSSI / mmic_mda

Tactic MMIC translator for MDAnalysis/MMSchema
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Bug in MolToMdaComponent #1

Open anabiman opened 3 years ago

anabiman commented 3 years ago

Description

Converting MMElemental.Molecule to MdaMol yields an incorrect list of residues in MDAnalysis.Universe. The resindices list looks fishy.

Code snippet

mda_mol =  schema_mol.to_data("MDAnalysis")
uni = mda_mol.data
print(uni.atoms.resindices)
print(uni.atoms.residues)

Output

array([1314, 1314, 1314, ...,    3,    3,    3])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/levnon/miniconda3/lib/python3.8/site-packages/MDAnalysis/core/groups.py", line 2321, in residues
    rg = self.universe.residues[unique_int_1d(self.resindices)]
  File "/home/levnon/miniconda3/lib/python3.8/site-packages/MDAnalysis/core/groups.py", line 549, in __getitem__
    return self._derived_class(self.ix[item], self.universe)
IndexError: index 1314 is out of bounds for axis 0 with size 329

Additional info

MDAnalysis.version = 1.0.0