normal backward.py fails with "list index out of range"

More
1 year 9 months ago #9452 by tsjerk
Hey :)

In my version (the current on github), that's line 519. Please update to that version. Did you add your new residue to the list of AminoAcids in line 20 of backward.py?

Cheers,

Tsjerk

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #9453 by Saman Fatihi
Replied by Saman Fatihi on topic backward.py fails with "list index out of range"
Hi
Thanks for the quick response.
1. I updated the backward.py to the current version, still getting the same error.

#command
python backward.py -f GLP-CG.gro -raw projected1.gro -o 0-backward1.gro -kick 0.05 -sol -p GLP-topol.top -po backmapped1.top -n backmapped1.ndx -from martini -to charmm36
#error
Traceback (most recent call last):
File "backward.py", line 760, in <module>
struc = Structure(options["-f"].value,strict=options["-strict"].value)
File "backward.py", line 519, in __init__
d12.append(d12[-1])
IndexError: list index out of range

2. Yes, I have added the residue name to the list of aa.
AminoAcids = "ALA CYS ASP GLU PHE GLY HIS ILE LYS LEU MET ASN PRO GLN ARG SER THR VAL TRP TYR ACE NH2 GLP".split()

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago - 1 year 9 months ago #9454 by Saman Fatihi
Replied by Saman Fatihi on topic backward.py fails with "list index out of range"
Hey cneale,
1. The residue has 130 atoms and 13 beads for CG.
#CG entry for the residue
13
120GLP BB 1 1.706 1.123 2.081
120GLP NH3 2 1.901 1.266 2.085
120GLP PO4 3 2.266 1.199 2.357
120GLP GL1 4 2.265 1.597 2.382
120GLP GL2 5 2.256 1.655 2.079
120GLP C1A 6 2.241 2.003 2.526
120GLP D2A 7 2.093 2.339 2.309
120GLP C3A 8 2.272 2.812 2.355
120GLP C4A 9 2.383 3.274 2.283
120GLP C1B 10 2.274 1.986 1.946
120GLP C2B 11 2.283 2.500 1.867
120GLP C3B 12 2.112 2.922 1.923
120GLP C4B 13 2.037 3.414 1.897
4.32147 4.32147 4.32147

#Mapping file
[ molecule ]
GLP

[ martini ]
BB NH3 PO4 GL1 GL2 C1A D2A C3A C4A C1B C2B C3B C4B

[ mapping ]
charmm36

[ atoms ]
1 N1 BB
2 HN BB
3 CA BB
4 HA1 BB
5 HA2 BB
6 C BB
7 O BB
8 N2 NH3
9 HN1 NH3
10 C12 NH3 NH3 NH3 PO4
11 H12A NH3 NH3 NH3 PO4
12 H12B NH3 NH3 NH3 PO4
13 C11 NH3 PO4
14 H11A NH3 PO4
15 H11B NH3 PO4
16 P PO4
17 O13 PO4
18 O14 PO4
19 O12 PO4 PO4 PO4 NH3
20 O11 PO4 PO4 GL1
21 C1 GL1 GL1 PO4
22 HA GL1 GL1 PO4
23 HB GL1 GL1 PO4
24 C2 GL1 GL1 GL2
25 HS GL1 GL1 GL2
26 O21 GL1 GL1 GL2 C1A
27 C21 GL1 C1A
28 O22 GL1
29 C22 C1A C1A GL1
30 H2R C1A C1A GL1
31 H2S C1A C1A GL1
32 C3 GL2 GL2 GL2 PO4
33 HX GL2 GL2 GL2 PO4
34 HY GL2 GL2 GL2 PO4
35 O31 GL2
36 C31 GL2 GL1 C1B
37 O32 GL2
38 C32 C1B C1B GL2
39 H2X C1B C1B GL2
40 H2Y C1B C1B GL2
; First tail
41 C23 C1A
42 H3R
43 H3S
44 C24 C1A C1A C1A D2A
45 H4R
46 H4S
47 C25 C1A D2A
48 H5R
49 H5S
50 C26 D2A D2A D2A C1A
51 H6R
52 H6S
53 C27 D2A
54 H7R
55 H7S
56 C28 D2A D2A D2A C3A
57 H8R
58 H8S
59 C29 D2A D2A C3A
60 H91 D2A C3A
61 C210 C3A C3A D2A
62 H101 D2A C3A
63 C211 C3A C3A C3A D2A
64 H11R
65 H11S
66 C212 C3A
67 H12R
68 H12S
69 C213 C3A C3A C3A C4A
70 H13R
71 H13S
72 C214 C3A C4A
73 H14R
74 H14S
75 C215 C4A C4A C4A C3A
76 H15R
77 H15S
78 C216 C4A
79 H16R
80 H16S
81 C217 C4A
82 H17R
83 H17S
84 C218 C4A
85 H18R
86 H18S
87 H18T
; Other tail
88 C33 C1B
89 H3X C1B
90 H3Y C1B
91 C34 C1B C1B C2B
92 H4X C1B C1B C2B
93 H4Y C1B C1B C2B
94 C35 C1B C2B
95 H5X C1B C2B
96 H5Y C1B C2B
97 C36 C2B C2B C1B
98 H6X C2B C2B C1B
99 H6Y C2B C2B C1B
100 C37 C2B
101 H7X C2B
102 H7Y C2B
103 C38 C2B C2B C2B C3B
104 H8X C2B C2B C2B C3B
105 H8Y C2B C2B C2B C3B
106 C39 C2B C2B C3B
107 H9X C2B C2B C3B
108 H9Y C2B C2B C3B
109 C310 C3B C2B
110 H10X C3B C2B
111 H10Y C3B C2B
112 C311 C3B C3B C2B
113 H11X C3B C3B C2B
114 H11Y C3B C3B C2B
115 C312 C3B
116 H12X C3B
117 H12Y C3B
118 C313 C3B C3B C4B
119 H13X C3B C3B C4B
120 H13Y C3B C3B C4B
121 C314 C4B C3B
122 H14X C4B C3B
123 H14Y C4B C3B
124 C315 C4B C4B C3B
125 H15X C4B C4B C3B
126 H15Y C4B C4B C3B
127 C316 C4B
128 H16X C4B
129 H16Y C4B
130 H16Z C4B
The .itp file contains parameters for the same 130 atoms with the same atom names and order.

2. The molecule name is the same as the residue name in all the required files.
3. The [martini] section contains all the beads for the CG residue.
4. I tried removing the mapping file from the directory, and still got the same error. Not sure where the mismatch is.

Any suggestions?
Thanks again
Last edit: 1 year 9 months ago by Saman Fatihi.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #9458 by cneale
In Mapping/__init__.py there is a listing like this:
# Listing of aminoacids
_aminoacids = [
"ALA", "CYS", "ASP", "GLU", "PHE", "GLY", "HIS", "ILE", "LYS", "LEU",
...

Suggest add GLP there. Does it help?

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #9459 by Saman Fatihi
Replied by Saman Fatihi on topic backward.py fails with "list index out of range"
I added GLP to the list in __init__.py
Still no luck. Getting the same error.

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #9460 by cneale
If you made the GLP name addition in both places and the mapping file exists and has the correct file name, then the only thing I can think to do is to rename GLP everywhere to something that won't pick up a partial match (e.g., right now with GLU) and see if the error message you get is more informative. I haven't tracked it down, but I remember thinking previously that this partial matching was going on. So perhaps rename all GLP as XYZ and all glp as xyz and see if that helps. If you still get a cryptic message, you could post everything here and I will take a look by testing it myself if you like.

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #9461 by Saman Fatihi
Replied by Saman Fatihi on topic backward.py fails with "list index out of range"
Hi, cneale,
Can you share your email so I can share the files with you?

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #9462 by Saman Fatihi
Replied by Saman Fatihi on topic backward.py fails with "list index out of range"
Hi, cneale,
Can you share your email so I can share the files with you?

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #9463 by Saman Fatihi
Replied by Saman Fatihi on topic backward.py fails with "list index out of range"
Hi, cneale,
Can you share your email so I can share the files with you?

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #9464 by cneale
Much better to post them somewhere and provide a link, that way others can look too if they have time. But if that's not possible, sure, send them to candrewn at google's email domain.

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago - 1 year 8 months ago #9465 by Saman Fatihi
Replied by Saman Fatihi on topic backward.py fails with "list index out of range"
Hi again,
So I think I made some progress, this time I am getting a detailed error:

Residues defined for transformation from martini to charmm36:
dict_keys('GLY', 'PRO', 'LYS', 'ILE', 'DAT3', 'GLU', 'ASN', 'LEU', 'CYS', 'GLN', 'ALA', 'THR', 'C', 'DC', 'DAT5', 'U', 'MET', 'TYR', 'VAL', 'PHE', 'SER', 'GLP', 'DGT5', 'DG', 'DTT3', 'ASP', 'A', 'TRP', 'DT', 'DCT5', 'ARG', 'HIS', 'DTT5', 'G', 'DCT3', 'DA', 'DGT3', 'POPE')
None
Problem determining mapping coordinates for atom N1 of residue GLP.
atomlist:
'N', 'HN', 'CA', 'HA1', 'HA2', 'C', 'O', 'N1', 'HN1', 'C12', 'H12A', 'H12B', 'C11', 'H11A', 'H11B', 'P', 'O13', 'O14', 'O11', 'O12', 'C1', 'HA', 'HB', 'C2', 'HS', 'O21', 'C21', 'O22', 'C22', 'H2R', 'H2S', 'C3', 'HX', 'HY', 'O31', 'C31', 'O32', 'C32', 'H2X', 'H2Y', 'C23', 'H3R', 'H3S', 'C24', 'H4R', 'H4S', 'C25', 'H5R', 'H5S', 'C26', 'H6R', 'H6S', 'C27', 'H7R', 'H7S', 'C28', 'H8R', 'H8S', 'C29', 'H91', 'C210', 'H101', 'C211', 'H11R', 'H11S', 'C212', 'H12R', 'H12S', 'C213', 'H13R', 'H13S', 'C214', 'H14R', 'H14S', 'C215', 'H15R', 'H15S', 'C216', 'H16R', 'H16S', 'C217', 'H17R', 'H17S', 'C218', 'H18R', 'H18S', 'H18T', 'C33', 'H3X', 'H3Y', 'C34', 'H4X', 'H4Y', 'C35', 'H5X', 'H5Y', 'C36', 'H6X', 'H6Y', 'C37', 'H7X', 'H7Y', 'C38', 'H8X', 'H8Y', 'C39', 'H9X', 'H9Y', 'C310', 'H10X', 'H10Y', 'C311', 'H11X', 'H11Y', 'C312', 'H12X', 'H12Y', 'C313', 'H13X', 'H13Y', 'C314', 'H14X', 'H14Y', 'C315', 'H15X', 'H15Y', 'C316', 'H16X', 'H16Y', 'H16Z'
want:
N1
should be mapping from:

have:
dict_keys('BB', 'NH', 'PO4', 'GL1', 'GL2', 'C1A', 'D2A', 'C3A', 'C4A', 'C1B', 'C2B', 'C3B', 'C4B', 'CA', 'C', 'O', 'N', 'H', 'HN')
Bailing out...
'N1', 'HN1', 'C12', 'H12A', 'H12B', 'C11', 'H11A', 'H11B', 'P', 'O13', 'O14', 'O11', 'O12', 'C1', 'HA', 'HB', 'C2', 'HS', 'O21', 'C21', 'O22', 'C22', 'H2R', 'H2S', 'C3', 'HX', 'HY', 'O31', 'C31', 'O32', 'C32', 'H2X', 'H2Y', 'C23', 'H3R', 'H3S', 'C24', 'H4R', 'H4S', 'C25', 'H5R', 'H5S', 'C26', 'H6R', 'H6S', 'C27', 'H7R', 'H7S', 'C28', 'H8R', 'H8S', 'C29', 'H91', 'C210', 'H101', 'C211', 'H11R', 'H11S', 'C212', 'H12R', 'H12S', 'C213', 'H13R', 'H13S', 'C214', 'H14R', 'H14S', 'C215', 'H15R', 'H15S', 'C216', 'H16R', 'H16S', 'C217', 'H17R', 'H17S', 'C218', 'H18R', 'H18S', 'H18T', 'C33', 'H3X', 'H3Y', 'C34', 'H4X', 'H4Y', 'C35', 'H5X', 'H5Y', 'C36', 'H6X', 'H6Y', 'C37', 'H7X', 'H7Y', 'C38', 'H8X', 'H8Y', 'C39', 'H9X', 'H9Y', 'C310', 'H10X', 'H10Y', 'C311', 'H11X', 'H11Y', 'C312', 'H12X', 'H12Y', 'C313', 'H13X', 'H13Y', 'C314', 'H14X', 'H14Y', 'C315', 'H15X', 'H15Y', 'C316', 'H16X', 'H16Y', 'H16Z'


What I could understand is that for some reason it's not reading 7 atoms for the BB bead from the mapping file, hence the mismatch. The list of atoms mentioned above have only 123 atoms, while I have 130 atoms in the mapping as well as the topol file.

Feeling stuck.

All the required files are here,
acsirres-my.sharepoint.com/:f:/g/persona...NKhlU3ZweUw?e=f8Jcln
Last edit: 1 year 8 months ago by Saman Fatihi. Reason: Atom list missing

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #9469 by cneale
Problem 1: In your CG pdb file, you use the name NH for a bead, but in your mapping file, you call this bead NH3. To solve this, I changed the name to NH in the mapping file.

Problem 2: You have two copies of the protein in your .pdb, but your .top file lists only one protein. To solve this, I put 2 instead of 1 copy of Protein_chain_A in your .top file.

So, while I agree that the error messages are cryptic, I believe that the issues were with malformed inputs.

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #9480 by Saman Fatihi
Replied by Saman Fatihi on topic backward.py fails with "list index out of range"
It worked!! :D
Thanks a lot for your help and time.

Please Log in or Create an account to join the conversation.

Time to create page: 0.114 seconds