diff --git a/bin/martinize2 b/bin/martinize2 index 49eecd885..b7979fa22 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -549,7 +549,7 @@ def entry(): "-go-eps", dest="go_eps", type=float, - default=0.0, + default=9.414, help=("The strength of the Go model structural bias in kJ/mol."), ) go_group.add_argument( diff --git a/vermouth/rcsu/contact_map.py b/vermouth/rcsu/contact_map.py index b8ee5936d..f4a9fb36f 100644 --- a/vermouth/rcsu/contact_map.py +++ b/vermouth/rcsu/contact_map.py @@ -36,15 +36,27 @@ def read_go_map(file_path): lines = _file.readlines() contacts = [] + OV=0 + rCSU=0 for line in lines: tokens = line.strip().split() if len(tokens) == 0: continue if tokens[0] == "R" and len(tokens) == 18: - contacts.append((int(tokens[5]), tokens[4], int(tokens[9]), tokens[8])) + # this is a bad place to filter but follows + # the old script + if tokens[11] == "1": + # this is a OV contact we take it + contacts.append((int(tokens[5]), tokens[4], int(tokens[9]), tokens[8])) + OV+=1 + if tokens[11] == "0" and tokens[14] == "1": + # this is a rCSU contact we take it + contacts.append((int(tokens[5]), tokens[4], int(tokens[9]), tokens[8])) + rCSU+=1 if len(contacts) == 0: raise IOError("You contact map is empty. Are you sure it has the right formatting?") + print(len(contacts), OV, rCSU) return contacts diff --git a/vermouth/rcsu/go_structure_bias.py b/vermouth/rcsu/go_structure_bias.py index d9b837f16..de95eeb4d 100644 --- a/vermouth/rcsu/go_structure_bias.py +++ b/vermouth/rcsu/go_structure_bias.py @@ -184,6 +184,8 @@ def contact_selector(self, molecule): resid=resIDB, chain=chainB, prefix=self.moltype)) + if (atype_b, atype_a, dist) in contact_matrix: + continue # generate backbone backbone exclusions # perhaps one day can be it's own function excl = Interaction(atoms=(bb_node_A, bb_node_B), parameters=[], meta={"group": "Go model exclusion"}) @@ -218,7 +220,7 @@ def compute_go_interaction(self, contacts): contact_bias = NonbondParam(atoms=(atype_a, atype_b), sigma=sigma, epsilon=self.go_eps, - meta={"comment": ["go bond"]}) + meta={"comment": [f"go bond {dist}"]}) self.system.gmx_topology_params["nonbond_params"].append(contact_bias) def run_molecule(self, molecule):