Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests #281

Merged
merged 26 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cae2921
Sort atoms in writing conect records
pckroon Jun 10, 2020
6454195
Correct typo in datafiles license
pckroon Jun 10, 2020
ac21a66
Initial tier0 tests
pckroon Jun 10, 2020
8279952
Implement pdb and itp comparison by parsing
Jun 11, 2020
6ee687c
Make integration tests run more reliably
Jun 22, 2020
d96c18b
Smarter handling of `command`, fuzzy comparison for interaction param…
Jun 23, 2020
c664cf6
Sort interactions before comparing in integration tests
pckroon Aug 5, 2020
f39d469
Change CLI defaults for elastic network to be the same as martinize1
pckroon Aug 5, 2020
f1cf328
Add tier1 tests
pckroon Jul 29, 2020
223a6cb
Add ASP0 modification + mapping to elnedyn22
pckroon Aug 5, 2020
0775af6
Make vermouth.gmx expose read_itp
Aug 10, 2020
8fa84c4
Py35 compatability
Aug 10, 2020
f021458
Merge remote-tracking branch 'origin/master' into integration_tests
Aug 21, 2020
df3cc22
Fix warning counter
Aug 21, 2020
b6dbee3
Address most data comments
Aug 21, 2020
4d2119b
Tighten tests --- ensure files exist
Aug 21, 2020
2d9523f
Change 'step' to more correct 'model'
Aug 21, 2020
c350a3a
Don't rewrite cg.pdb to data files
Aug 24, 2020
8ee7eff
Put back vetted cg.pdb files that got overwritten by accident
Aug 24, 2020
ea347ed
Fix small bug in locate_charge_dummies
Aug 24, 2020
ed9621a
Protein termini for martini30 FFs
Aug 24, 2020
87262d8
Change rubber bands due to coordinate change from termini mapping
Aug 24, 2020
ca783d5
Change scfix dihedral phase due to mapping change of termini
Aug 24, 2020
1fbc1c1
Change position of terminus due to mapping
Aug 24, 2020
b0ba242
Approx abs tol to 1e-3 for positions in integration tests
Aug 25, 2020
c2a1d5d
Merge branch 'master' into integration_tests
pckroon Aug 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def entry():
help='Write elastic bonds')
rb_group.add_argument('-ef', dest='rb_force_constant', type=float, default=500,
help='Elastic bond force constant Fc in kJ/mol/nm^2')
rb_group.add_argument('-el', dest='rb_lower_bound', type=float, default=0.5,
rb_group.add_argument('-el', dest='rb_lower_bound', type=float, default=0,
pckroon marked this conversation as resolved.
Show resolved Hide resolved
help='Elastic bond lower cutoff: F = Fc if rij < lo')
rb_group.add_argument('-eu', dest='rb_upper_bound', type=float, default=0.9,
help='Elastic bond upper cutoff: F = 0 if rij > up')
Expand All @@ -364,7 +364,7 @@ def entry():
default=None)
rb_group.add_argument('-ea', dest='rb_decay_factor', type=float, default=0,
help='Elastic bond decay factor a')
rb_group.add_argument('-ep', dest='rb_decay_power', type=float, default=0,
rb_group.add_argument('-ep', dest='rb_decay_power', type=float, default=1,
pckroon marked this conversation as resolved.
Show resolved Hide resolved
help='Elastic bond decay power p')
rb_group.add_argument('-em', dest='rb_minimum_force', type=float, default=0,
help='Remove elastic bonds with force constant lower than this')
Expand Down Expand Up @@ -706,6 +706,7 @@ def entry():

# TODO: allow ignoring warnings per class/amount (i.e. ignore 2
# inconsistent-data warnings)

number_of_warnings = COUNTER.number_of_counts_by(level=logging.WARNING)
if args.maxwarn < number_of_warnings:
LOGGER.error('{} warnings were encountered. No output files will be '
Expand Down
5 changes: 5 additions & 0 deletions vermouth/data/force_fields/elnedyn22/modifications.ff
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ BB {"replace": {"atype": "P5", "charge": 0}}
NH2-ter
[ atoms ]
BB {"replace": {"atype": "P5", "charge": 0}}

[ modification ]
ASP0
[ atoms ]
SC1 {"resname": "ASP", "replace": {"atype": "P3", "charge": 0}}
pckroon marked this conversation as resolved.
Show resolved Hide resolved
21 changes: 0 additions & 21 deletions vermouth/data/force_fields/martini30b32/aminoacids.ff
Original file line number Diff line number Diff line change
Expand Up @@ -738,27 +738,6 @@ BB ++BB 1 0.640 2500
+BB +++BB 1 0.640 2500
BB +++BB 1 0.970 2500

;; Protein terminii. These links should be applied last.
[ link ]
[ molmeta ]
neutral_termini not(true)
[ features ]
neutral_termini
[ atoms ]
BB {"replace": {"atype": "Qp", "charge": 1}}
[ non-edges ]
BB -BB

[ link ]
[ molmeta ]
neutral_termini not(true)
[ features ]
neutral_termini
[ atoms ]
BB {"replace": {"atype": "Qn", "charge": -1}}
[ non-edges ]
BB +BB

;; Cystein bridge
[ link ]
resname "CYS"
Expand Down
10 changes: 10 additions & 0 deletions vermouth/data/force_fields/martini30b32/modifications.ff
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[ modification ]
C-ter
[ atoms ]
BB {"replace": {"atype": "Qn", "charge": -1}}

[ modification ]
N-ter
[ atoms ]
BB {"replace": {"atype": "Qp", "charge": 1}}

37 changes: 0 additions & 37 deletions vermouth/data/force_fields/martini30dev/aminoacids.ff
Original file line number Diff line number Diff line change
Expand Up @@ -817,43 +817,6 @@ BB ++BB 1 0.640 2500
+BB +++BB 1 0.640 2500
BB +++BB 1 0.970 2500

;; Protein terminii. These links should be applied last.
[ link ]
[ molmeta ]
neutral_termini not(true)
[ features ]
neutral_termini
[ atoms ]
BB {"replace": {"atype": "Q1", "charge": 1}}
[ non-edges ]
BB -BB

[ link ]
[ molmeta ]
neutral_termini not(true)
[ atoms ]
BB {"replace": {"atype": "Q1", "charge": -1}}
[ non-edges ]
BB +BB

[ link ]
[ molmeta ]
neutral_termini true
[ atoms ]
BB {"replace": {"atype": "P4"}}
[ non-edges ]
BB -BB

[ link ]
[ molmeta ]
neutral_termini true
[ features ]
neutral_termini
[ atoms ]
BB {"replace": {"atype": "P5"}}
[ non-edges ]
BB +BB

;; Cystein bridge
[ link ]
resname "CYS"
Expand Down
19 changes: 19 additions & 0 deletions vermouth/data/force_fields/martini30dev/modifications.ff
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[ modification ]
C-ter
[ atoms ]
BB {"replace": {"atype": "Q1", "charge": -1}}

[ modification ]
N-ter
[ atoms ]
BB {"replace": {"atype": "Q1", "charge": 1}}

[ modification ]
COOH-ter
[ atoms ]
BB {"replace": {"atype": "P5", "charge": 0}}

[ modification ]
NH2-ter
[ atoms ]
BB {"replace": {"atype": "P4", "charge": 0}}
25 changes: 25 additions & 0 deletions vermouth/data/mappings/elnedyn/elnedyn22/modifications.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,28 @@ N BB 0
CA BB
C BB 0
O BB 0


[modification]
[ from ]
universal
[ to ]
elnedyn22
[ from blocks ]
ASP0
[ to blocks ]
ASP0
[ from nodes ]
pckroon marked this conversation as resolved.
Show resolved Hide resolved
CB
CG
OD1
[ from edges ]
CB CG
CG OD1
CG OD2
[ mapping ]
CB SC1
CG SC1
OD1 SC1
OD2 SC1
HD2 SC1
150 changes: 150 additions & 0 deletions vermouth/data/mappings/martini30/modifications.mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
[ modification ]
[ from ]
universal
[ to ]
martini30b32

[ from blocks ]
C-ter
[ to blocks ]
C-ter

[ from nodes ]
N
HN

[ from edges ]
HN N
N CA

[ mapping ]
CA BB
C BB
O BB
OXT BB


[modification]
[ from ]
universal
[ to ]
martini30b32
[ from blocks ]
N-ter
[ to blocks ]
N-ter

[ from nodes ]
C
O

[ from edges ]
C O
CA C

[ mapping ]
HN1 BB
HN2 BB
HN3 BB
N BB
CA BB
C BB
O BB

;#################
;# Martini 30dev #
;#################

[ modification ]
[ from ]
universal
[ to ]
martini30dev
[ from blocks ]
C-ter
[ to blocks ]
C-ter
[ from nodes ]
N
HN
[ from edges ]
HN N
N CA
[ mapping ]
CA BB
C BB
O BB
OXT BB


[modification]
[ from ]
universal
[ to ]
martini30dev
[ from blocks ]
N-ter
[ to blocks ]
N-ter
[ from nodes ]
C
O
[ from edges ]
C O
CA C
[ mapping ]
HN1 BB
HN2 BB
HN3 BB
N BB
CA BB
C BB
O BB

[ modification ]
[ from ]
universal
[ to ]
martini30dev
pckroon marked this conversation as resolved.
Show resolved Hide resolved
[ from blocks ]
COOH-ter
[ to blocks ]
COOH-ter
[ from nodes ]
N
HN
[ from edges ]
HN N
N CA
[ mapping ]
HN BB
N BB
CA BB
C BB
O BB
HO BB
OXT BB


[modification]
[ from ]
universal
[ to ]
martini30dev
[ from blocks ]
NH2-ter
[ to blocks ]
NH2-ter
[ from nodes ]
C
O
[ from edges ]
C O
CA C
[ mapping ]
HN1 BB
HN2 BB
N BB
CA BB
C BB
O BB
1 change: 1 addition & 0 deletions vermouth/gmx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@

from .gro import read_gro, write_gro
from .itp import write_molecule_itp
from .itp_read import read_itp
from .rtp import read_rtp
4 changes: 2 additions & 2 deletions vermouth/pdb/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def write_pdb_string(system, conect=True, omit_charges=True, nan_missing_pos=Fal
format_string = 'CONECT '
for mol_idx, molecule in enumerate(system.molecules):
for node_idx in molecule:
todo = [nodeidx2atomid[(mol_idx, n_idx)]
for n_idx in molecule[node_idx] if n_idx > node_idx]
todo = sorted(nodeidx2atomid[(mol_idx, n_idx)]
for n_idx in molecule[node_idx] if n_idx > node_idx)
while todo:
current, todo = todo[:4], todo[4:]
fmt = ['CONECT'] + [number_fmt]*(len(current) + 1)
Expand Down
4 changes: 1 addition & 3 deletions vermouth/processors/locate_charge_dummies.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ def colinear_pair():
"""
vector = np.random.rand(3)
vector /= np.linalg.norm(vector)
vector *= 2
points = np.stack([np.zeros((3, )), vector])
points -= points / 2
points -= vector/2
return points


Expand Down Expand Up @@ -193,7 +192,6 @@ def locate_all_dummies(molecule, attribute_tag=DEFAULT_DUMMY_ATTRIBUTE):
dummy_keys = [pair[1] for pair in dummy_pairs]
locate_dummy(molecule, anchor_key, dummy_keys, attribute_tag)


class LocateChargeDummies(Processor):
def __init__(self, attribute_tag=DEFAULT_DUMMY_ATTRIBUTE):
super().__init__()
pckroon marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### DETAILS:

# Original PDB CODE: 1ICO
# Structure from NMR experiment: select the first model to martinize
# Replace the residue name DPR (d-proline, residue 8) and DAL (d-alanine, residue 23) for PRO and ALA
# Maybe could be used to test d- amino acids

### TEST:

# -ff martini22
# -cys auto
# -dssp
Loading