Skip to content

Commit

Permalink
fix some more issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrunewald committed Oct 17, 2023
1 parent fbbf8f5 commit 71a8d2e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
14 changes: 13 additions & 1 deletion vermouth/rcsu/contact_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion vermouth/rcsu/go_structure_bias.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 71a8d2e

Please sign in to comment.