marrink-lab / polyply_1.0

Generate input parameters and coordinates for atomistic and coarse-grained simulations of polymers, ssDNA, and carbohydrates
Apache License 2.0
125 stars 22 forks source link

gen_seq incorrect edges from itp #281

Open fgrunewald opened 2 years ago

fgrunewald commented 2 years ago

Describe the bug Gen_seq generates incorrect edges when pairs are present. As gen_seq uses the legacy polyply_parser module to read_itp files it creates edges between residue for example for pair entries. This in turn leads to the sequence graph having many more edges than expected which messes with the actual polyply output.

Command line arguments Provide all polyply calls and arguments needed to reproduce the issue:

polyply gen_seq -f test.itp -from_file A:test -seq A -o test.json

Expected behavior Given the test itp below one would expect a liner graph with edges between residues 1-2-3-4-5. But instead one gets a graph with edges between residues [1-2, 1-3, 2-3, 2-4, 3-4, 3-4, 4-5]

Additional Files

[  moleculetype ]
test 3

[ atoms ]
 1 SN0  1  R1  BB2  2  0.0 45.0
 2 SC2  1  R1  BB3  3  0.0 45.0
 3 TN0  2  R2  SC1  4  0.0 45.0
 4 TT2  2  R3  SC2  5  0.0 45.0
 5 TT3  3  R3  SC3  6  0.0 45.0
 6 Q0    3  R4  BB1 13 -1.0 72.0
 7 SN0  4  R4  BB2 14  0.0 45.0
 8 SC2  4  R5  BB3 15  0.0 45.0
[ bonds ]
1 2
2 3
3 4
4 5
5 6
6 7
7 8
[ pairs ]
1 4
2 5
3 6
4 7
5 8