Skip to content

Commit

Permalink
Merge pull request #5 from mdpoleto/1.4.0_branch
Browse files Browse the repository at this point in the history
1.4.0 branch
  • Loading branch information
mdpoleto authored Aug 3, 2022
2 parents 7ed33ca + e2489d9 commit 91ae1e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
17 changes: 10 additions & 7 deletions TUPA.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Parse user input and options
ap = argparse.ArgumentParser(description=tupa_help.header,
formatter_class=argparse.RawDescriptionHelpFormatter,
usage="python tupa.py [options]",
usage="",
add_help=False)
ap._optionals.title = 'Options'
ap.add_argument('-h', '--help', action="store_true", help='Show this message and exit')
Expand All @@ -30,18 +30,18 @@
help='Output folder in which results will be written (default: Tupã_results/)')
ap.add_argument('-config', type=str, default=None, required=False, metavar='',
help='Input configuration file (default: config.dat)')
ap.add_argument('-template', type=str, default=None, required=False, metavar='',
help='Create a template for input configuration file (default: config_sample.dat)')
ap.add_argument('-template', type=str, default=None, required=False, nargs="?", metavar='',
help='Create a template for input configuration file (default: config_template.dat)')
ap.add_argument('-dumptime', type=int, default=None, required=False, metavar='', nargs='+',
help='Choose times (in ps) to dump the coordinates from.')

cmd = ap.parse_args()
start = timeit.default_timer()
print(tupa_help.header)
#print(tupa_help.header)


if cmd.help is True:
#ap.print_help()
ap.print_help()
print(tupa_help.help)
sys.exit()
else:
Expand All @@ -51,7 +51,10 @@
traj_file = cmd.traj
outdir = cmd.outdir
configinput = cmd.config
template = cmd.template
if cmd.template == None:
template = "config_template.dat"
else:
template = cmd.template
if cmd.dumptime == None:
dumptime = []
else:
Expand Down Expand Up @@ -338,7 +341,7 @@ def pack_around(atom_group, center, boxinfo):
try:
u = mda.Universe(top_file, traj_file)
except Exception as e:
sys.exit("""\n>>> ERROR: Topology or Trajectory not found. Aren't you forgetting something?!\n""")
sys.exit("""\n>>> ERROR: Topology or Trajectory could not be loaded. Check your inputs!\n""")

else:
sys.exit("""\n>>> ERROR: Topology or Trajectory not found. Aren't you forgetting something?!\n""")
Expand Down
12 changes: 6 additions & 6 deletions tupa_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@

template_content = """[Environment Selection]
# The atoms from which we calculate the electric field
sele_environment = segid PROA
sele_environment = resid 1-200
[Probe Selection]
# Provide the probe selection for the MODE of you choice
# e.g. if bond is used, then selbond1 and selbond2 must be defined.
mode = ATOM # ATOM or BOND or COORDINATE or LIST
selatom = segid PROA and (resid 160 and name OG)
selbond1 = segid PROA and (resid 160 and name OG)
selbond2 = segid LIG and name C1
selatom = resname LIG and name C5
selbond1 = resname LIG and name C5
selbond2 = resname LIG and name C1
probecoordinate = [0,0,0]
file_of_coordinates = /path/to/file/of/list/of/probe/coordinates
Expand All @@ -43,8 +43,8 @@
[Solvent]
include_solvent = True # or False
solvent_cutoff = 10 # in Angstrom
solvent_selection = segid TIP3
solvent_cutoff = 15 # in Angstrom
solvent_selection = resname TIP3 or resname CL
[Time]
dt = 10 # Frequency of frames written in your trajectory (in picosecond)
Expand Down

0 comments on commit 91ae1e1

Please sign in to comment.