aboutsummaryrefslogtreecommitdiff
path: root/plip/plipcmd.py
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-07-07 20:48:27 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-07-07 20:48:27 +0530
commitb334659db44942ca1457af4752751b1281da4948 (patch)
treec2914bb093f1cc78e55fcb43caa2595ccae6b93f /plip/plipcmd.py
parent85a0b26230b239f7f5c8655c958dcdee01ca5a7b (diff)
using PLIP v2.1.3
Diffstat (limited to 'plip/plipcmd.py')
-rw-r--r--plip/plipcmd.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/plip/plipcmd.py b/plip/plipcmd.py
index e4c0815..f7dffab 100644
--- a/plip/plipcmd.py
+++ b/plip/plipcmd.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python3
+#! /usr/bin/env python
"""
Protein-Ligand Interaction Profiler - Analyze and visualize protein-ligand interactions in PDB files.
plipcmd.py - Main script for PLIP command line execution.
@@ -166,7 +166,7 @@ def run_analysis(inputstructs, inputpdbids):
logger.info(f'finished analysis, find the result files in {config.BASEPATH}')
-if __name__ == '__main__':
+def main():
"""Parse command line arguments and start main script for analysis."""
parser = ArgumentParser(prog="PLIP", description=description)
pdbstructure = parser.add_mutually_exclusive_group(required=True) # Needs either PDB ID or file
@@ -178,7 +178,7 @@ if __name__ == '__main__':
outputgroup.add_argument("-O", "--stdout", dest="stdout", action="store_true", default=False,
help="Write to stdout instead of file")
parser.add_argument("--rawstring", dest="use_raw_string", default=False, action="store_true",
- help="Use Python raw strings for stdout and stdin")
+ help="Use Python raw strings for stdin")
parser.add_argument("-v", "--verbose", dest="verbose", default=False, help="Turn on verbose mode",
action="store_true")
parser.add_argument("-q", "--quiet", dest="quiet", default=False, help="Turn on quiet mode", action="store_true")
@@ -240,9 +240,7 @@ if __name__ == '__main__':
for t in thresholds:
parser.add_argument('--%s' % t.name, dest=t.name, type=lambda val: threshold_limiter(parser, val),
help=argparse.SUPPRESS)
-
arguments = parser.parse_args()
-
# configure log levels
config.VERBOSE = True if arguments.verbose else False
config.QUIET = True if arguments.quiet else False
@@ -255,7 +253,6 @@ if __name__ == '__main__':
logger.setLevel(logging.CRITICAL)
else:
logger.setLevel(config.DEFAULT_LOG_LEVEL)
-
config.MAXTHREADS = arguments.maxthreads
config.XML = arguments.xml
config.TXT = arguments.txt
@@ -308,3 +305,7 @@ if __name__ == '__main__':
parser.error("The water bridge omega minimum angle has to be smaller than the water bridge omega maximum angle")
expanded_path = tilde_expansion(arguments.input) if arguments.input is not None else None
run_analysis(expanded_path, arguments.pdbid) # Start main script
+
+
+if __name__ == '__main__':
+ main()