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

internal go contact map #643

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8591a5a
basis of implementation
csbrasnett Nov 21, 2024
56d319d
basic implementation of go model
csbrasnett Nov 26, 2024
5ca464f
implementation of working go model with flexible CLI
csbrasnett Dec 6, 2024
ba02c22
change to using _res_serial attribute, so we can deal with > 1 chain
csbrasnett Dec 7, 2024
4ecfe5a
fix contact map calculation
csbrasnett Dec 12, 2024
cf7cc8b
Merge branch 'master' into Go-contact-map
csbrasnett Dec 12, 2024
a1a217f
change implementation to using KDTree.
csbrasnett Dec 16, 2024
3468c0e
tidy up for readability and testing, added comments and docstrings
csbrasnett Dec 16, 2024
3678176
addressed smaller comments. atom2res now significantly faster with pr…
csbrasnett Dec 18, 2024
2d1da84
changed to run the processor on molecule not system.
csbrasnett Dec 20, 2024
6c6f935
fixed deferred file writing and corrected associated cli
csbrasnett Dec 20, 2024
7880986
made small corrections.
csbrasnett Dec 20, 2024
af2eff2
fix test_read_go_map.py
csbrasnett Jan 3, 2025
4777f21
fix test_go_structure_bias.py
csbrasnett Jan 3, 2025
4053b66
fixed the reading/generation check for go map
csbrasnett Jan 3, 2025
8c9585e
changed make_surface to _make_surface, shouldn't need function extern…
csbrasnett Jan 3, 2025
cae3923
first tests for contact map generation. Improved PROTEIN map handling…
csbrasnett Jan 3, 2025
ba24c49
more tests for contact map generation. refactored some contact_map fu…
csbrasnett Jan 3, 2025
b7c8da7
more contact map generation tests for main contact finding functions.
csbrasnett Jan 3, 2025
4a36a8e
sorted out written contact map checking
csbrasnett Jan 3, 2025
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
47 changes: 37 additions & 10 deletions bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import argparse
import functools
import logging
import itertools
import os.path
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
from pathlib import Path
import sys
import networkx as nx
Expand All @@ -48,7 +49,7 @@ from vermouth.map_input import (
generate_all_self_mappings,
combine_mappings,
)
from vermouth.rcsu.contact_map import read_go_map
from vermouth.rcsu.contact_map import GenerateContactMap
from vermouth.rcsu.go_pipeline import GoPipeline
from vermouth.gmx.topology import write_gmx_topology

Expand Down Expand Up @@ -546,11 +547,18 @@ def entry():
go_group.add_argument(
"-go",
dest="go",
required=False,
type=Path,
default=None,
help="Contact map to be used for the Martini Go model."
"Currently, only one format is supported. See docs.",
nargs='?',
const=None,
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
type=str,
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
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)"
# required=False,
# type=Path,
# action='store_true',
# default=False,
# help="Contact map to be used for the Martini Go model."
# "Currently, only one format is supported. See docs.",
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
)
go_group.add_argument(
"-go-eps",
Expand Down Expand Up @@ -826,6 +834,15 @@ def entry():
"be used together."
)

go = False
go_file = None
if args.go is None:
go = True
else:
if os.path.isfile(args.go):
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
go_file = args.go
go = True
pckroon marked this conversation as resolved.
Show resolved Hide resolved

if args.to_ff.startswith("elnedyn"):
# FIXME: This type of thing should be added to the FF itself.
LOGGER.info(
Expand Down Expand Up @@ -967,6 +984,14 @@ def entry():
elif args.cystein_bridge != "auto":
vermouth.AddCysteinBridgesThreshold(args.cystein_bridge).run_system(system)

go_map = False
if go:
# 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)
go_map = True
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved

# Run martinize on the system.
system = martinize(
system,
Expand All @@ -988,14 +1013,16 @@ def entry():
vermouth.ApplyPosres(node_selector, args.posres_fc).run_system(system)

# Generate the Go model if required
if args.go:

if go:
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
if not go_map:
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
LOGGER.info("Reading Go model contact map.", type="step")
GenerateContactMap(path=go_file).run_system(system)
go_name_prefix = args.molname
LOGGER.info("Reading Go model contact map.", type="step")
go_map = read_go_map(args.go)
LOGGER.info("Generating the Go model.", type="step")
GoPipeline.run_system(system,
moltype=go_name_prefix,
contact_map=go_map,
# contact_map=go_map,
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
cutoff_short=args.go_low,
cutoff_long=args.go_up,
go_eps=args.go_eps,
Expand Down
Loading
Loading