Skip to content

Commit

Permalink
changed to run the processor on molecule not system.
Browse files Browse the repository at this point in the history
changed file writer to deferred file writer

added cli to write file if desired

changed function names for internal use

made bond_type a global variable and removed function

corrected error in sphere generation

moved system merging to martinize2
  • Loading branch information
csbrasnett committed Dec 20, 2024
1 parent 3678176 commit 2d1da84
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 110 deletions.
24 changes: 15 additions & 9 deletions bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ from vermouth.map_input import (
generate_all_self_mappings,
combine_mappings,
)
from vermouth.rcsu.contact_map import GenerateContactMap
from vermouth.rcsu.contact_map import GenerateContactMap, read_go_map
from vermouth.rcsu.go_pipeline import GoPipeline
from vermouth.gmx.topology import write_gmx_topology

Expand Down Expand Up @@ -550,8 +550,7 @@ def entry():
const=None,
type=Path,
help="Use Martini Go model. Accepts either an input file from the server, "
"or just provide the flag to calculate as part of Martinize. Can be slow for large proteins "
"(> 1500 residues)"
"or just provide the flag to calculate as part of Martinize."
)
go_group.add_argument(
"-go-eps",
Expand Down Expand Up @@ -582,6 +581,13 @@ def entry():
help=("Minimum graph distance (similar sequence distance) below which"
"contacts are removed. "),
)
go_group.add_argument(
"-go-write-file",
dest="go_write_file",
action="store_false",
default=True,
help=("Write out contact map to file if calculating as part of Martinize2.")
)

water_group = parser.add_argument_group("Apply water bias.")
water_group.add_argument(
Expand Down Expand Up @@ -830,7 +836,7 @@ def entry():
"""
Sort out the use of the go model:
go_file = True: calculate contact map
go = True: apply go model
go_file = str: parse contact map
bool(go_file) = False: no go
"""
Expand All @@ -839,9 +845,8 @@ def entry():
if args.go is None:
go = True
else:
if Path(args.go).is_file():
go_file = args.go
go = True
go_file = args.go
go = True

if args.to_ff.startswith("elnedyn"):
# FIXME: This type of thing should be added to the FF itself.
Expand Down Expand Up @@ -985,13 +990,14 @@ def entry():
vermouth.AddCysteinBridgesThreshold(args.cystein_bridge).run_system(system)

if go:
system = vermouth.MergeAllMolecules().run_system(system)
# need this here because have to get contact map at atomistic resolution
if go_file is None:
LOGGER.info("Generating Go model contact map.", type="step")
GenerateContactMap().run_system(system)
GenerateContactMap(write_file=args.go_write_file).run_system(system)
else:
LOGGER.info("Reading Go model contact map.", type="step")
GenerateContactMap(path=go_file).run_system(system)
read_go_map(system=system, path=go_file)


# Run martinize on the system.
Expand Down
Loading

0 comments on commit 2d1da84

Please sign in to comment.