Make_hybrid.py list index out of range error

Hi,

Could someone suggest where my problem is coming from with the following output from make_hybrid.py?

I’m using the charmm36 forcefield and following the latest ligand tutorial.

My only commands to this point:

atoms_to_morph.py -i1 .PEP1.pdb -i2 SPEP1.pdb -o pep_spep_pairs.dat -alignment -H2H

And:
/make_hybrid.py -l1 PEP1.pdb -l2 SPEP1.pdb -itp1 pep.itp -itp2 .spep.itp -pairs pep_spep_pairs.dat -oa pep_spep_merged.pdb -oitp pep_spep_hybrid.itp -ffitp pep_spep_dummy.itp -scDUMd 0.1

returns the below error…

Thank you,

Dan

make_hybrid__log_> Reading ligand 1 from: “…/PEP/PEP1.pdb”
make_hybrid__log_> Reading ligand 2 from: “…/SPEP/SPEP1.pdb”
make_hybrid__log_> Reading itp file 1 from: “…/PEP/pep.itp”
make_hybrid__log_> Reading itp file 2 from: “…/SPEP/spep.itp”
make_hybrid__log_> Assigning forcefield parameters…
make_hybrid__log_> Making pairs…
make_hybrid__log_> Reading file with atom pairs: “pep_spep_pairs.dat”
make_hybrid__log_> Generated 7 atom-atom pairs
make_hybrid__log_> Dummies in state A: 5
make_hybrid__log_> Dummies in state B: 5
make_hybrid__log_> Making B-states…
make_hybrid__log_> Atom…: 1 CG2O3 | 0.57 | 12.01 -> CG2O3 | 0.57 | 12.01
make_hybrid__log_> Atom…: 2 OG2D2 | -0.76 | 16.00 -> OG2D2 | -0.76 | 16.00
make_hybrid__log_> Atom…: 3 OG2D2 | -0.76 | 16.00 -> OG2D2 | -0.76 | 16.00
make_hybrid__log_> Atom…: 4 CG2D1O | -0.25 | 12.01 -> CG2D1O | -0.15 | 12.01
make_hybrid__log_> Atom…: 5 CG2DC3 | -0.46 | 12.01 -> CG2DC3 | -0.42 | 12.01
make_hybrid__log_> Atom…: 11 HGA5 | 0.23 | 1.01 -> HGA5 | 0.21 | 1.01
make_hybrid__log_> Atom…: 12 HGA5 | 0.23 | 1.01 -> HGA5 | 0.21 | 1.01
make_hybrid__log_> Dummy…: 13 DUM_PG2 | 0.00 | 30.97 -> PG2 | 1.60 | 30.97
make_hybrid__log_> Dummy…: 14 DUM_SG2P1 | 0.00 | 32.06 -> SG2P1 | -0.79 | 32.06
make_hybrid__log_> Dummy…: 15 DUM_OG2S1 | 0.00 | 16.00 -> OG2S1 | -0.90 | 16.00
make_hybrid__log_> Dummy…: 16 DUM_OG2S1 | 0.00 | 16.00 -> OG2S1 | -0.90 | 16.00
make_hybrid__log_> Dummy…: 17 DUM_OG2S1 | 0.00 | 16.00 -> OG2S1 | -0.90 | 16.00
make_hybrid__log_> Dummy…: 6 OG303 | -0.13 | 16.00 -> DUM_OG303 | 0.00 | 16.00
make_hybrid__log_> Dummy…: 7 PG2 | 0.84 | 30.97 -> DUM_PG2 | 0.00 | 30.97
make_hybrid__log_> Dummy…: 8 OG2P1 | -0.84 | 16.00 -> DUM_OG2P1 | 0.00 | 16.00
make_hybrid__log_> Dummy…: 9 OG2P1 | -0.84 | 16.00 -> DUM_OG2P1 | 0.00 | 16.00
make_hybrid__log_> Dummy…: 10 OG2P1 | -0.84 | 16.00 -> DUM_OG2P1 | 0.00 | 16.00
make_hybrid__log_> Generating bonded parameters…
Traceback (most recent call last):
File “/Users/danielburns/pmx/pmx/scripts/ligands/make_hybrid.py”, line 1216, in
main( sys.argv )
File “/Users/danielburns/pmx/pmx/scripts/ligands/make_hybrid.py”, line 750, in main
entr = get_ff2_entry([idB1, idB2], itp2, gmx45, what= ‘bond’)
File “/Users/danielburns/pmx/pmx/scripts/ligands/make_hybrid.py”, line 296, in get_ff2_entry
return out[3:][0]
IndexError: list index out of range

If anybody has this issue it is because you need to process your cgenff itp file with a script that was provided to me by Vytas Gapsys. If you need it, let me know.

Right, the topologies used by the hybrid topology generation script need to have all the bonded parameters defined explicitly.

Hello, I share the same issue with you, which is also “IndexError: list index out of range”. Could you please tell me how to deal with it?

The details of the mistake are listed below:

My only commands to this point:
python2.7 make_hybrid.py -l1 lig_3a/MOL_tleap.pdb -l2 lig_5/MOL_tleap.pdb -itp1 lig_3a/MOL.itp -itp2 lig_5/MOL.itp -pairs pairs.dat -oa merged.pdb -oitp MOL.itp -ffitp ffmerged.itp -scDUMd 0.0

returns the below error:
make_hybrid__log_> Reading ligand 1 from: “lig_3a/MOL_tleap.pdb”
make_hybrid__log_> Reading ligand 2 from: “lig_5/MOL_tleap.pdb”
make_hybrid__log_> Reading itp file 1 from: “lig_3a/MOL.itp”
make_hybrid__log_> Reading itp file 2 from: “lig_5/MOL.itp”
make_hybrid__log_> Assigning forcefield parameters…
Traceback (most recent call last):
File “/home/112/pmx/pmx/scripts/ligands/make_hybrid.py”, line 1308, in
main( sys.argv )
File “/home/112/pmx/pmx/scripts/ligands/make_hybrid.py”, line 556, in main
assign_ff(m1,itp1)
File “/home/112/pmx/pmx/scripts/ligands/make_hybrid.py”, line 202, in assign_ff
at = itp.atoms[i]
IndexError: list index out of range

Difficult to tell without the inputs. Seems like some mismatch between pdb and itp or maybe the topology is corrupt

I noticed that new user can’t creat a new topic, so I continued to write my question here.
Could anybody suggest where my problem is coming from with the output from one_ff_file.py?My only command is: one_ff_file.py -ffitp lig_1/atomtype.itp lig_2/atomtype.itp -ffitp_out ffMOL.itp
The error return is listed in the picture above.It can’t produce a correct file even if the difference of the atomtype between two molecular is only a fluorine.
Did I get something wrong with my inputfiles?
Thank you
Jeffrey

Hi Jeffrey,

what is the error you get? The picture you posted doesn’t seem to contain the error. Also, please provide both input files so that we can try to reproduce the error.

thanks and best regards,

Bert

Sorry for incomplete information。Here showed below is the detail of my error. However, the two files of .itp cannot be uploaded, so I paste them in following places.

atomtype.itp
[ atomtypes ]
;name mass charge ptype sigma epsilon Amb
c3 0.00000 0.00000 A 3.39967e-01 4.57730e-01 ; 1.91 0.1094
ca 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860
oh 0.00000 0.00000 A 3.06647e-01 8.80314e-01 ; 1.72 0.2104
hc 0.00000 0.00000 A 2.64953e-01 6.56888e-02 ; 1.49 0.0157
ha 0.00000 0.00000 A 2.59964e-01 6.27600e-02 ; 1.46 0.0150
ho 0.00000 0.00000 A 0.00000e+00 0.00000e+00 ; 0.00 0.0000

atomtype.itp
[ atomtypes ]
;name mass charge ptype sigma epsilon Amb
c3 0.00000 0.00000 A 3.39967e-01 4.57730e-01 ; 1.91 0.1094
ca 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860
oh 0.00000 0.00000 A 3.06647e-01 8.80314e-01 ; 1.72 0.2104
f 0.00000 0.00000 A 3.11815e-01 2.55224e-01 ; 1.75 0.0610
hc 0.00000 0.00000 A 2.64953e-01 6.56888e-02 ; 1.49 0.0157
ha 0.00000 0.00000 A 2.59964e-01 6.27600e-02 ; 1.46 0.0150
ho 0.00000 0.00000 A 0.00000e+00 0.00000e+00 ; 0.00 0.0000


.

thanks for the input files. Unfortunately, using those I cannot reproduce the error. With a fresh install of pmx I get “All finished correctly” as output.

and as output file:

[ atomtypes ]
f 0.00000 0.00000 A 3.11815e-01 2.55224e-01
oh 0.00000 0.00000 A 3.06647e-01 8.80314e-01
ca 0.00000 0.00000 A 3.39967e-01 3.59824e-01
;name mass charge ptype sigma epsilon
ho 0.00000 0.00000 A 0.00000e+00 0.00000e+00
c3 0.00000 0.00000 A 3.39967e-01 4.57730e-01
hc 0.00000 0.00000 A 2.64953e-01 6.56888e-02
ha 0.00000 0.00000 A 2.59964e-01 6.27600e-02

could you try with a clean git pull and see if you still get the error?

Hi, bgroot,

I have tried with a git pull and redownloaded the pmx package from github for a few times, but the error is still the same without any change. Are there any other solutions that I can continue to try. Sorry for such disturbance.

Thank you,
Jeffrey

it’s difficult to diagnose as we cannot reproduce it with your input, using two different machines.
I also noted you had posted another error above that also gave a “IndexError: list index out of range”. Would you have the possibility to test on another machine (or python environment) to cross-check?

I followed the protein-ligand complex parameterization process based on the GROMACS tutorial and ran the “cgenff_charmm2gmx_py3_nx2.py” script to obtain the .prm, .itp, .pdb, and .top files.

As mentioned earlier, I encountered an “IndexError: list index out of range” error during the creation of the hybrid_structure_topology, specifically in the “Construct bonds…” section.

Following the advice provided in the previous response, I was instructed to explicitly enter parameters in the .itp file starting from the [bonds] section. However, when I attempted to do this by referring to the .prm file, the parameters didn’t match.

What am I missing here?

What do you mean by “parameters didn’t match”? Could it be that there is some mismatch between cgenff versions used?

Hi, I share the same issue with you, which is also “IndexError: list index out of range ”. Can you share the script you mentioned, please?