-
Notifications
You must be signed in to change notification settings - Fork 10
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
Added handling of virtual sites + Fixed an issue in BI #7
Merged
Merged
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
6051f03
Error handling of VS reader from .itp
fiskissimo 48f5c5f
Added the options to write the VS in the itp output
fiskissimo 79b5518
CG trajectory builder
fiskissimo 3e61eee
Creation of the aa2cg_trajectory universe: need to fetch the atom mas…
fiskissimo e59d5a7
Created a list for the masses associated to the atomtypes (ns.cg_ato…
fiskissimo c3d10bb
AA to CG trajectory conversion in map_aa2cg_traj(ns)
fiskissimo 13de889
new aa2cg distribution estimation and call of the conversion
fiskissimo da78181
Code working on evaluate_model (VS not tested)
fiskissimo 1f624f5
MOT-CG handling VS_n
fiskissimo 163721e
ongoing
CharlyEmpereurmot 23f133f
Added VS functions + Fixed BI
CharlyEmpereurmot 6d6c409
Changing authors display for paper + Some light cleaning
CharlyEmpereurmot 660a81e
Rolled back the mass writing in the ITP if masses are present
CharlyEmpereurmot 8867597
Corrected some line numbers in error messages
CharlyEmpereurmot b99d3fd
Fixed bug SASA + Fixed paths + VS ongoing
CharlyEmpereurmot a04fcb8
Fix VS (missing only vs3 func 3, 4 + vs4 func 2) + Fix MDP (Luca) + C…
CharlyEmpereurmot afaa7b7
Fix dihedral verify func + Enable evaluate model without args + Paths…
CharlyEmpereurmot fcee475
Added and validated vs3_func3 + Some cleaning
CharlyEmpereurmot 140271f
Added and validated vs3_func4 + Some cleaning
CharlyEmpereurmot e5eeea8
Modified README to indicate virtual sites and MARTINI 3 are supported
CharlyEmpereurmot 686517a
Integrated some changes that were not sent in the few last commits
CharlyEmpereurmot a84ae99
Added and validated vs4 func_2
CharlyEmpereurmot 8d15ccb
Added choice between COM and COG for mapping interpretation
CharlyEmpereurmot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ G1 (PAMAM) in water | |
[ molecules ] | ||
; Compound #mols | ||
G1 1 | ||
W 1247 | ||
CL- 8 | ||
W 1248 | ||
CL- 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = 'v1.1.2' | ||
__version__ = '1.1.3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -662,3 +662,5 @@ def main(): | |
run(ns) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,38 +21,44 @@ | |
def run(ns): | ||
|
||
from numpy import VisibleDeprecationWarning | ||
warnings.filterwarnings("ignore", category=VisibleDeprecationWarning) # filter MDAnalysis + numpy deprecation stuff that is annoying | ||
warnings.filterwarnings("ignore", category=VisibleDeprecationWarning) # filter MDAnalysis + numpy deprecation stuff that is annoying | ||
|
||
# TODO: make it possible to feed a delta for Rg in case the model has scaling ? | ||
# TODO: make it possible to feed a delta/offset for Rg in case the model has bonds scaling ? | ||
|
||
ns.molname_in = None # TODO: arguments that exist only in the scope of optimization (useless for manual model evaluation) -- but this could be modified to be allowed to evaluate models in mixed membranes, averaging distribs for given molecule name only | ||
# get basenames for simulation files | ||
ns.cg_itp_basename = os.path.basename(ns.cg_itp_filename) | ||
|
||
# NOTE: some arguments exist only in the scope of optimization (optimize_model.py) or only in the scope of model | ||
# evaluation (evaluate_mode.py), so they need to be defined here | ||
ns.molname_in = None | ||
ns.gyr_aa_mapped, ns.gyr_aa_mapped_std = None, None | ||
# ns.sasa_aa_mapped, ns.sasa_aa_mapped_std = None, None | ||
ns.aa_rg_offset = 0 | ||
ns.sasa_aa_mapped, ns.sasa_aa_mapped_std = None, None | ||
ns.aa_rg_offset = 0 # TODO: allow an argument more in evaluate_model, like in optimiwe_model, for adding an offset to Rg | ||
|
||
scg.set_MDA_backend(ns) | ||
|
||
# TODO: add missing checks -- if some are missing | ||
# TODO: factorize all checks and put them in global lib | ||
if not os.path.isfile(ns.aa_tpr_filename): | ||
msg = ( | ||
"Cannot find coordinate file of the atomistic simulation" | ||
"(GRO, PDB, or other trajectory formats supported by MDAnalysis)" | ||
f"Cannot find topology file of the atomistic simulation at location: {ns.aa_tpr_filename}\n" | ||
f"(TPR or other portable topology formats supported by MDAnalysis)" | ||
) | ||
raise exceptions.MissingCoordinateFile(msg) | ||
if not os.path.isfile(ns.aa_traj_filename): | ||
msg = ( | ||
"Cannot find trajectory file of the atomistic simulation" | ||
"(XTC, TRR, or other trajectory formats supported by MDAnalysis)" | ||
f"Cannot find trajectory file of the atomistic simulation at location: {ns.aa_traj_filename}\n" | ||
f"(XTC, TRR, or other trajectory formats supported by MDAnalysis)" | ||
) | ||
raise exceptions.MissingTrajectoryFile(msg) | ||
|
||
if not os.path.isfile(ns.cg_map_filename): | ||
msg = "Cannot find CG beads mapping file (NDX-like file format)" | ||
msg = ( | ||
f"Cannot find CG beads mapping file at location: {ns.cg_map_filename}\n" | ||
f"(NDX-like file format)" | ||
) | ||
raise exceptions.MissingIndexFile(msg) | ||
|
||
if not os.path.isfile(ns.cg_itp_filename): | ||
msg = "Cannot find ITP file of the CG model" | ||
msg = f"Cannot find ITP file of the CG model at location: {ns.cg_itp_filename}" | ||
raise exceptions.MissingItpFile(msg) | ||
|
||
# check bonds scaling arguments conflicts | ||
|
@@ -71,7 +77,7 @@ def run(ns): | |
|
||
# display parameters for function compare_models | ||
if not os.path.isfile(ns.cg_tpr_filename) or not os.path.isfile(ns.cg_traj_filename): | ||
# switch to atomistic mapping inspection exclusively (= do NOT use real CG distributions) | ||
# switch to atomistic mapping inspection exclusively (= do NOT plot the CG distributions) | ||
print('Could not find file(s) for either CG topology or trajectory') | ||
print(' Going for inspection of AA-mapped distributions exclusively') | ||
print() | ||
|
@@ -85,7 +91,26 @@ def run(ns): | |
except IndexError as e: | ||
ns.plot_filename = ns.plot_filename+'.png' | ||
|
||
scg.create_bins_and_dist_matrices(ns) | ||
scg.create_bins_and_dist_matrices(ns) # bins for EMD calculations | ||
scg.read_ndx_atoms2beads(ns) # read mapping, get atoms accurences in beads | ||
scg.get_atoms_weights_in_beads(ns) # get weights of atoms within beads | ||
|
||
scg.read_cg_itp_file(ns) # load the ITP object and find out geoms grouping | ||
scg.process_scaling_str(ns) # process the bonds scaling specified by user | ||
|
||
print() | ||
scg.read_aa_traj(ns) # create universe and read traj | ||
scg.load_aa_data(ns) # read atoms attributes | ||
scg.make_aa_traj_whole_for_selected_mols(ns) | ||
|
||
# for each CG bead, create atom groups for trajectory geoms calculation using mass and atom weights across beads | ||
scg.get_beads_MDA_atomgroups(ns) | ||
|
||
print('\nMapping the trajectory from AA to CG representation') | ||
scg.initialize_cg_traj(ns) | ||
scg.map_aa2cg_traj(ns) | ||
print() | ||
|
||
scg.compare_models(ns, manual_mode=True, calc_sasa=False) | ||
|
||
|
||
|
@@ -128,7 +153,6 @@ def main(): | |
help='XTC file of your CG trajectory (omit for solo AA inspection)', | ||
type=str, default=config.metavar_cg_traj, | ||
metavar=' ' + scg.par_wrap(config.metavar_cg_traj)) | ||
# required_args.add_argument('-figmolname', dest='figmolname', help='TODO REMOVE', type=str, required=True) # TODO: remove, this was just for figures | ||
|
||
optional_args = args_parser.add_argument_group(bullet + 'CG MODEL SCALING') | ||
# optional_args.add_argument('-nb_threads', dest='nb_threads', help='number of threads to use', type=int, default=1, metavar='1') # TODO: does NOT work properly -- modif MDAnalysis code with OpenMP num_threads(n) in the pragma | ||
|
@@ -147,8 +171,6 @@ def main(): | |
help=config.help_bonds2angles_scoring_factor, type=float, | ||
default=config.bonds2angles_scoring_factor, | ||
metavar=' ' + scg.par_wrap(config.bonds2angles_scoring_factor)) | ||
# ONLY FOR PAPER FIGURES | ||
# optional_args.add_argument('-datamol', dest='datamol', help='Save bonded score and Rg values for each frame across simulation', type=str, default='MOL_EXEC_MODE') | ||
|
||
graphical_args = args_parser.add_argument_group(bullet + 'FIGURE DISPLAY') | ||
graphical_args.add_argument('-mismatch_ordering', dest='mismatch_order', | ||
|
@@ -191,14 +213,17 @@ def main(): | |
action='store_true', default=False) | ||
|
||
# display help if script was called without arguments | ||
if len(sys.argv) == 1: | ||
args_parser.print_help() | ||
sys.exit() | ||
# if len(sys.argv) == 1: | ||
# args_parser.print_help() | ||
# sys.exit() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's no do this in fact, because we might want to execute the script from within a directory in which all files are already present |
||
|
||
# arguments handling, display command line if help or no arguments provided | ||
ns = args_parser.parse_args() | ||
input_cmdline = ' '.join(map(cmd_quote, sys.argv)) | ||
print('Working directory:', os.getcwd()) | ||
print('Command line:', input_cmdline) | ||
|
||
run(ns) | ||
run(ns) | ||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here I let only the verified ones and the program checks that the ITP uses functions we have validated as working. For evolving the code you thus need to put into these arrays the functions you want to work on, if they are not there already.