From 1348f0c9a821332cafe354cf3bd63fd9d9a135e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20S=C3=A1nchez-Izquierdo=20Besora?= Date: Tue, 5 May 2026 11:36:57 +0200 Subject: [PATCH] Updated Mol_analysis.py + README with new -nomkndx option --- Mol_Analysis.py | 14 +++++++++----- README | 1 + example/Mol_An/plot.pdf | Bin 79591 -> 79591 bytes example/Mol_An/r_gyrate.xvg | 4 ++-- example/Mol_An/rmsd.xvg | 4 ++-- example/Mol_An/rmsd_Protein.xvg | 4 ++-- .../rmsf10/rmsf_Protein_n_C-alpha_10000.xvg | 4 ++-- .../rmsf10/rmsf_Protein_n_C-alpha_20000.xvg | 4 ++-- .../rmsf10/rmsf_Protein_n_C-alpha_30000.xvg | 4 ++-- .../rmsf10/rmsf_Protein_n_C-alpha_40000.xvg | 2 +- .../rmsf10/rmsf_Protein_n_C-alpha_50000.xvg | 2 +- .../rmsf_od_Protein_n_C-alpha_10000.xvg | 4 ++-- .../rmsf_od_Protein_n_C-alpha_20000.xvg | 4 ++-- .../rmsf_od_Protein_n_C-alpha_30000.xvg | 4 ++-- .../rmsf_od_Protein_n_C-alpha_40000.xvg | 2 +- .../rmsf_od_Protein_n_C-alpha_50000.xvg | 2 +- example/Mol_Analysis/grouped_plot_rmsf10.pdf | Bin 15242 -> 15242 bytes 17 files changed, 32 insertions(+), 27 deletions(-) mode change 100755 => 100644 Mol_Analysis.py diff --git a/Mol_Analysis.py b/Mol_Analysis.py old mode 100755 new mode 100644 index a398fd4..805505f --- a/Mol_Analysis.py +++ b/Mol_Analysis.py @@ -964,6 +964,8 @@ def process_data(threadName, q): parser.add_argument("-end", type=int, default=None, help="End at time X (fs)") parser.add_argument("-large", action="store_true", help="Can plot 9 plots") parser.add_argument("-splitlen", metavar="slen", default=10, help="Length of timewindow for RMSF calculation (ns). If multiple than separated with comma") + parser.add_argument("-nomkndx", action="store_false", + help="Do not recreate index file; reuse existing ndxfile") args = parser.parse_args() timescales = [] try: @@ -987,7 +989,7 @@ def process_data(threadName, q): config.listread(args.f) groupfolderlist = config.getlist() # Storing defaults here: - settings = {"odir": "Mol_An", "f": None, "tpr": None, + settings = {"odir": "Mol_An", "f": None, "tpr": None, "outf": "center_traj.xtc", "outs": "updated.gro", "outp": "updated.tpr", "ndxfile": "index.ndx", "ndxparams": None, "chains": ["Protein"], "center": "Protein", @@ -998,7 +1000,7 @@ def process_data(threadName, q): try: option = config.get("Settings", key) if "," in option: - option = map(lambda s: s.strip(), option.split(",")) + option = list(map(lambda s: s.strip(), option.split(","))) elif "none" in option.lower(): option = None continue @@ -1049,7 +1051,7 @@ def process_data(threadName, q): def runandplot(folder, group=0): runner = gTools_runner(wdir=folder, splitlen=timescales, dryrun=args.n, verbose=args.v, group=group, **settings) - runner.runall(mindist=args.nomindist, pdbout=args.nopdb, num_cores=args.nt) + runner.runall(mkndx=args.nomkndx, mindist=args.nomindist, pdbout=args.nopdb, num_cores=args.nt) files_to_plot.append(runner.getfilenames()) # Adding it all to the multithreader @@ -1080,8 +1082,10 @@ def runandplot(folder, group=0): groupedfnames = [] shift = 0 # Align chains here: - #if ("p62" in label_g) and (chain == "chB"): - # shift = 709 + #if chain == "chA": + # shift = 124 + #elif chain == "chB": + # shift = 7 for model in model_g: try: groupedfnames.extend(model["rmsf"+str(i)+"_"+chain+"_n_C-alpha"]) diff --git a/README b/README index 3c2921a..da20499 100644 --- a/README +++ b/README @@ -27,6 +27,7 @@ optional arguments: -begin BEGIN Begin from time X (fs) -end END End at time X (fs) -large Can plot 9 plots + -nomkndx Use custom index for multiple chains -splitlen slen Lenght of timewindow for RMSF calculation (in ns, default=10 ns) if multiple times need to be calculated then separate with a comma diff --git a/example/Mol_An/plot.pdf b/example/Mol_An/plot.pdf index 3b4d26376c77566c1f658af3e587c4b7990e0f95..775a1cd3273f4e47776af7721f98f478964884ca 100644 GIT binary patch delta 29 lcmaF