Skip to content

Commit

Permalink
add CLI for backbone and go atomnames as per #585
Browse files Browse the repository at this point in the history
  • Loading branch information
csbrasnett committed Jan 6, 2025
1 parent 89b2023 commit 0e99a8f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
18 changes: 17 additions & 1 deletion bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,20 @@ def entry():
type=Path,
help=("Write out contact map to file if calculating as part of Martinize2.")
)
go_group.add_argument(
"-go-backbone",
dest="go_backbone",
default="BB",
type=str,
help=("Name of protein backbone bead on which to place a virtual interaction go site")
)
go_group.add_argument(
"-go-atomname",
dest="go_atomname",
default="CA",
type=str,
help=("Name of the virtual interaction go site atom")
)

water_group = parser.add_argument_group("Apply water bias.")
water_group.add_argument(
Expand Down Expand Up @@ -1022,7 +1036,9 @@ def entry():
cutoff_short=args.go_low,
cutoff_long=args.go_up,
go_eps=args.go_eps,
res_dist=args.go_res_dist,)
res_dist=args.go_res_dist,
go_anchor_bead=args.go_backbone,
go_atomname=args.go_atomname)

defines = ("GO_VIRT",)
itp_paths = {"atomtypes": "go_atomtypes.itp",
Expand Down
2 changes: 2 additions & 0 deletions vermouth/rcsu/go_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def prepare_run(self, system, moltype):
vermouth.MergeAllMolecules().run_system(system)
molecule = system.molecules[0]
molecule.meta['moltype'] = moltype
# add citations for the go model here
molecule.citations.add('M3_GO')

def run_system(self, system, **kwargs):
self.kwargs = kwargs
Expand Down
14 changes: 9 additions & 5 deletions vermouth/rcsu/go_vs_includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ class VirtualSiteCreator(Processor):
Assign molecule type names to the molecules in a system.
:func:`add_virtual_sites`
"""
def __init__(self):
def __init__(self, go_anchor_bead, go_atomname):
self.system = None
self.backbone = go_anchor_bead
self.atomname = go_atomname

def run_molecule(self, molecule):
moltype = molecule.meta.get('moltype')
Expand All @@ -50,9 +52,11 @@ def run_molecule(self, molecule):

if not self.system:
raise ValueError('This processor requires a system.')
molecule.citations.add('M3_GO')

self.add_virtual_sites(molecule, prefix=moltype)
print(self.backbone, self.atomname)
self.add_virtual_sites(molecule,
prefix=moltype,
backbone=self.backbone,
atomname=self.atomname)

return molecule

Expand All @@ -65,7 +69,7 @@ def add_virtual_sites(self, molecule, prefix, backbone='BB', atomname='CA', char
"""
Add the virtual sites for GoMartini in the molecule.
One virtual site is added per backbone bead of the the Martini protein.
One virtual site is added per backbone bead of the Martini protein.
Each virtual site copies the resid, resname, and chain of the backbone
bead. It also copies the *reference* to the position array, so the virtual
site position follows if the backbone bead is translated. The virtual sites
Expand Down

0 comments on commit 0e99a8f

Please sign in to comment.