options = sparser.Options([ # opt attribute type num default multi description ("--help", "help", bool, 0, False, False, "Print help and exit"), ("-v", "verbose", bool, 0, False, False, "Be verbose"), ("-tpr", "tpr", str, 1, None, False, "Run input file (TPR)"), ("-trr", "trajectory", str, 1, None, False, "Input trajectory (TRR)"), ("-parent", "parent", str, 1, None, False, "Parent trajectory (TRR)"), ("-lmb", "lmb", str, 1, None, False, "Input lambda file (DAT)"), ("-par", "parfile", str, 1, None, False, "Input TPS parameter file"), ("-ndx", "index", str, 1, None, True, "Input index file"), ("-out", "out", str, 1, "lambda.dat", False, "Lambda output file"), ("-pi", "pathinfiles", str, 1, None, True, "Path input file(s)"), ("-po", "pathoutfile", str, 1, None, False, "Path output file"), ("-log", "log", str, 1, "tipsi.log", False, "Output file"), ("-fw", "forward", str, 1, None, False, "Forward shooting point"), ("-bw", "backward", str, 1, None, False, "Backward shooting point"), "Monitoring options:", ("-offset", "offset", int, 1, 0, False, "Trajectory file offset"), ("-pid", "pid", int, 1, None, False, "PID to monitor"), ("-sleep", "interval", float, 1, 600, False, "Interval between checks for active processes"), "Molecular/mathematical expressions evaluated in context of reference and frame:", ("-init", "init", str, 1, None, True, "Expressions evaluated before loading trajectory: -I const=expression"), ("-E", "expressions", str, 1, None, True, "Expressions not saved to output file: -E tmp=expression"), ("-P", "parameters", str, 1, None, True, "Parameter expressions: -P param=expression"), ("-S", "states", str, 1, None, True, "State expressions: -S state=expression"), ("-I", "interfaces", str, 1, None, True, "Interface expressions: -I iface=expression"), ("-B", "bias", str, 1, None, True, "Shooting point selection bias expressions: -B expression"), ("-Q", "stop", str, 1, None, False, "Stop condition: -Q expression"), ("-O", "print", str, 1, None, True, "Print to terminal: -P expression"), ("-W", "write", str, 2, None, True, "Write to file: -W file expression"), ("-X", "coords", str, 1, None, True, "Coordinate sets (PDB/GRO/TPR/TRR): -X ref1=file.gro"), "Path options", ("-R", "recrossing", str, 1, None, True, "Recrossing rules: -R A-I-A=A"), ("-2way", "twowayprob", str, 1, "0", False, "Probability of two-way shooting"), ("-rand", "randomize", str, 1, "0", False, "Velocity randomization"), ("-minlen", "minpathlength", int, 1, 10, False, "Minimum path length"), "Further TPS/MD control:", ("-maxf", "maxframes", int, 1, -1, False, "Maximum number of frames per run"), ("-mdp", "mdparam", str, 1, None, True, "MD parameters: -mdp par=val"), ])
#!/usr/bin/env python2.7 import sys, sparser options = sparser.Options([ # opt attribute type num default multi description ( "--help", "help", bool, 0, False, False, "Print help and exit"), ( "-s", "tpr", str, 1, None, False, "Run input file (TPR)"), ( "-f", "trr", str, 1, None, False, "Input trajectory (TRR|GRO|PDB)"), ( "-n", "index", str, 1, None, False, "Input index file"), ( "-e", "expression", str, 1, None, True, "Expression"), ( "-o", "output", str, 1, None, False, "Output file (stdout if not given)"), ( "-offset", "offset", int, 1, 0, False, "File offset for reading trajectory"), ]) def main(argv=None): options.parse(argv or sys.argv[1:]) return 0 if __name__ == "__main__": sys.exit(main())
""" Command line editor for Gromacs' TPR files. """ __author__ = "Tsjerk A. Wassenaar" __year__ = 2015 import sys import gmx import sparser options = sparser.Options([ # opt attribute type num default multi description ("--help", "help", bool, 0, False, False, "Print help and exit"), ("-tpr", "tpr", str, 1, None, False, "Run input file (TPR)"), ("-o", "out", str, 1, None, False, "Output run input file (TPR)"), ("-p", "par", str, 1, None, True, "Read or set parameters: par=val"), ]) def main(argv=None): if argv == None: argv = sys.argv options.parse(argv[1:]) tpr = gmx.tpr.TPR(options.tpr) edited = False for par in options.par:
""" MOlecular DYnamics CAlculator. (c)2014 Tsjerk A. Wassenaar """ import sys import sparser # Simple parser import calculator # General purpose extensible calculator import gmx # Gromacs stuff options = sparser.Options([ # opt attribute type num default multi description ( "--help", "help", bool, 0, False, False, "Print help and exit"), ( "-s", "ref", str, 1, None, False, "Reference file (TPR|GRO|PDB|TRR)"), ( "-f", "trj", str, 1, None, False, "Input trajectory (TRR|GRO|PDB)"), ( "-n", "index", str, 1, None, True, "Input index file"), ( "-e", "expression", str, 1, None, True, "Expression"), ]) def main(argv=None): options.parse(argv or sys.argv[1:]) if not options.trj: print "No input trajectory file (TRR|PDB|GRO) given." return 1 trj = gmx.open(options.trj) if options.ref:
options = sparser.Options([ # opt attribute type num default multi description ("--help", "help", bool, 0, False, False, "Print help and exit"), ("-tpr", "tpr", str, 1, None, False, "Run input file (TPR)"), ("-trr", "trj", str, 1, None, False, "Input trajectory (TRR)"), ("-f", "parfile", str, 1, None, False, "Input TPS parameter file"), ("-n", "index", str, 1, None, True, "Input index file"), ("-o", "out", str, 1, None, False, "Output file"), ("-fw", "forward", str, 1, None, False, "Forward shooting point"), ("-bw", "backward", str, 1, None, False, "Backward shooting point"), ("-log", "log", str, 1, None, False, "Log file"), "Monitoring options:", ("-offset", "offset", int, 1, 0, False, "Trajectory file offset"), ("-pid", "pid", int, 1, None, False, "PID to monitor"), "Molecular/mathematical expressions evaluated in context of reference and frame:", ("-init", "init", str, 1, None, True, "Expressions evaluated before loading trajectory"), ("-E", "expressions", str, 1, None, True, "Expressions not saved to output file"), ("-P", "parameters", str, 1, None, True, "Parameter expressions"), ("-S", "states", str, 1, None, True, "State expressions"), ("-I", "interfaces", str, 1, None, True, "Interface expressions"), ("-B", "bias", str, 1, None, True, "Shooting point selection bias expressions"), ("-stop", "stop", str, 1, None, False, "Stop conditions (expression)"), ("-2way", "twowayprob", str, 1, "0", False, "Probability of two-way shooting"), ("-rand", "randomize", str, 1, "0", False, "Velocity randomization"), "Further TPS control:", ("-maxf", "maxframes", int, 1, -1, False, "Maximum number of frames per run"), ])