deGrootLab / pmx

Toolkit for free-energy calculation setup/analysis and biomolecular structure handling
GNU Lesser General Public License v3.0
132 stars 50 forks source link

Why does PMX ligandHybrid fail for this specific ligand? #32

Closed noahharrison64 closed 1 year ago

noahharrison64 commented 1 year ago

Hi,

I'm attempting to run non-eq FEP and using some PMX tools to help generate the topologies to do so. Using ligandHybrid fails when I include a certain single ligand (ejm46) in the pair, while working fine with all other ligand pairs. The command I'm using is: 'pmx ligandHybrid -i1 ejm42.pdb -i2 ejm46.pdb -itp1 ejm42.top -itp2 ejm46.top -pairs pairs_a.dat -oA merged.pdb -oitp merged.itp -offitp ffmerged.itp'

The resulting error is as follows:

b'ligandHybridToplog_> Reading ligand 1 from: "/home/noah/Documents/md/toolkit/output/ejm42_ejm46/input/ejm42.pdb"' b'ligandHybridToplog_> Reading ligand 2 from: "/home/noah/Documents/md/toolkit/output/ejm42_ejm46/input/ejm46.pdb"' b'ligandHybridToplog_> Reading topology 1 from: "/home/noah/Documents/md/toolkit/output/ejm42_ejm46/input/ejm42.top"' b'ligandHybridToplog_> Reading topology 2 from: "/home/noah/Documents/md/toolkit/output/ejm42_ejm46/input/ejm46.top"' b'Traceback (most recent call last):' b' File "/home/noah/anaconda3/envs/biosimspace/bin/pmx", line 33, in ' b" sys.exit(load_entry_point('pmx==0+untagged.879.gb0b5684', 'console_scripts', 'pmx')())" b' File "/home/noah/anaconda3/envs/biosimspace/lib/python3.9/site-packages/pmx-0+untagged.879.gb0b5684-py3.9-linux-x86_64.egg/pmx/scripts/cli.py", line 97, in entry_point' b' PmxCli()' b' File "/home/noah/anaconda3/envs/biosimspace/lib/python3.9/site-packages/pmx-0+untagged.879.gb0b5684-py3.9-linux-x86_64.egg/pmx/scripts/cli.py", line 44, in init' b' getattr(self, args.command)()' b' File "/home/noah/anaconda3/envs/biosimspace/lib/python3.9/site-packages/pmx-0+untagged.879.gb0b5684-py3.9-linux-x86_64.egg/pmx/scripts/cli.py", line 64, in ligandHybrid' b' ligandHybrid.entry_point()' b' File "/home/noah/anaconda3/envs/biosimspace/lib/python3.9/site-packages/pmx-0+untagged.879.gb0b5684-py3.9-linux-x86_64.egg/pmx/scripts/ligandHybrid.py", line 189, in entry_point' b' main(args)' b' File "/home/noah/anaconda3/envs/biosimspace/lib/python3.9/site-packages/pmx-0+untagged.879.gb0b5684-py3.9-linux-x86_64.egg/pmx/scripts/ligandHybrid.py", line 246, in main' b' itp2 = TopolBase(args.itp2)' b' File "/home/noah/anaconda3/envs/biosimspace/lib/python3.9/site-packages/pmx-0+untagged.879.gb0b5684-py3.9-linux-x86_64.egg/pmx/forcefield.py", line 140, in init' b' self.read()' b' File "/home/noah/anaconda3/envs/biosimspace/lib/python3.9/site-packages/pmx-0+untagged.879.gb0b5684-py3.9-linux-x86_64.egg/pmx/forcefield.py", line 177, in read' b' self.read_molecules(lines)' b' File "/home/noah/anaconda3/envs/biosimspace/lib/python3.9/site-packages/pmx-0+untagged.879.gb0b5684-py3.9-linux-x86_64.egg/pmx/forcefield.py", line 249, in read_molecules' b' self.molecules.append([entr[0], int(entr[1])])' b'IndexError: list index out of range'

Input files are here. Is there any reason this might be happening? Have checked the top files and the pdb files but can't see any issues. Again, since this works for other pairs including ejm42, but always fails if ejm46 is included in a pair, it's safe to say this issue is specific to ejm46 input data.

zetadin commented 1 year ago

The topology files contain two [ system ] and [ molecules ] each. The first one seems to be inserted into the middle of the dihedral definitions. When parsing of [ molecules ], ligandHybrid doesn't know what to make of the subsequent lines that are supposed to be in [ dihedrals ]. Remove this inserted section, and try again.

34     30     31     36      1  0  0.650844  3
34     30     31     37      1  0  0.650844  3

; remove this [ system ] BioSimSpace System

[ molecules ] ;molecule name nr. MOL 1

1 ; end remove 19 18 29 32 9 180 10.46 2 20 8 10 25 1 180 15.167 2 21 3 9 24 1 180 15.167 2

noahharrison64 commented 1 year ago

Hi Yuriy,

Don't know how I missed that, something must have gone with my top file processing! Thanks for pointing that out,

Noah