shirtsgroup / InterMol

Conversion tool for molecular simulations
MIT License
185 stars 53 forks source link

IndexError: index 8 is out of bounds for axis 1 with size 8 #360

Closed skblnw closed 4 years ago

skblnw commented 4 years ago

When converting from Gromacs (gro and top) to desmond python convert.py --gro_in in.gro topol.top --desmond

Seems sth wrong with write_exclusions

ERROR 2019-10-09 17:37:16 index 8 is out of bounds for axis 1 with size 8 Traceback (most recent call last): File "/usr/local/packages/InterMol/intermol/convert.py", line 595, in _save_desmond des.save('{0}.cms'.format(oname), system) File "/usr/local/packages/python/2.7.8/lib/python2.7/site-packages/intermol-0.1.0.dev0-py2.7.egg/intermol/desmond/desmond_parser.py", line 50, in save return parser.write() File "/usr/local/packages/python/2.7.8/lib/python2.7/site-packages/intermol-0.1.0.dev0-py2.7.egg/intermol/desmond/desmond_parser.py", line 1919, in write lines += self.write_exclusions(moleculetype) File "/usr/local/packages/python/2.7.8/lib/python2.7/site-packages/intermol-0.1.0.dev0-py2.7.egg/intermol/desmond/desmond_parser.py", line 1446, in write_exclusions atombonds[bond.atom1,natombonds[bond.atom1]] = bond.atom2 IndexError: index 8 is out of bounds for axis 1 with size 8

Interestingly, this only happen when number of monomers in my system increases to 3. Here's how part of the top looks like

[ molecules ] ; Compound #mols Protein_chain_A 1 Protein_chain_B 1 Protein_chain_A 1 Protein_chain_B 1 Protein_chain_A 1 Protein_chain_B 1

When I reduced the system to ABAB, it worked fine. I have tried multiple combination of my monomers, so I suspect that the problem came from InterMol.

mrshirts commented 4 years ago

Hmm. It may be because it's confused by different molecules with the same name. I can take a look if there were input files. What would happen if you listed all the A first, and all the B? i.e.:

molecules ] ; Compound #mols Protein_chain_A 3 Protein_chain_B 3

Obviously would have to reorder the coordinates as well.

skblnw commented 4 years ago

Thank you for the reply. I was thinking the same thing and eventually solved the issue. Just wondering whether it is a bug or something.

mrshirts commented 4 years ago

Did that indeed fix the problem? It's a lower priority to fix if one can just work around it this way, but eventually it would be good to address.

On Thu, Oct 10, 2019 at 12:48 PM Kevin notifications@github.com wrote:

Thank you for the reply. I was thinking the same thing and eventually solved the issue. Just wondering whether it is a bug or something.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/shirtsgroup/InterMol/issues/360?email_source=notifications&email_token=ABATPVDXLBO5XA4ARYMNFNDQN52JBA5CNFSM4I7FKSIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA5MN3Q#issuecomment-540722926, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABATPVBMYLWHWLVCTO6WPSDQN52JBANCNFSM4I7FKSIA .