Skip to content

Commit

Permalink
Add visualisation options to easy_run script
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjcroucher committed Nov 21, 2020
1 parent 78bf62b commit ea9e4cb
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions scripts/poppunk_easy_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ def get_options():
parser.add_argument('--r-files', help='List of sequence names and files (as for --r-files')
parser.add_argument('--output', help='Prefix for output files')

parser.add_argument('--other-args', help="Other arguments to pass to poppunk. e.g. "
parser.add_argument('--analysis-args', help="Other arguments to pass to poppunk. e.g. "
"'--min-k 13 --max-k 29'")
parser.add_argument('--viz', help = "Run visualisation of output", default = False, action = "store_true")
parser.add_argument('--viz-args', help = "Options to use for visualisation")
parser.add_argument('--poppunk-exe', help="Location of poppunk executable. Use "
"'python poppunk-runner.py' to run from source tree")
parser.add_argument('--viz-exe', help = "Location of poppunk_visualisation executable")

return parser.parse_args()

Expand All @@ -34,10 +37,10 @@ def get_options():
else:
poppunk = args.poppunk_exe

if args.other_args is None:
if args.analysis_args is None:
pp_args = ""
else:
pp_args = args.other_args
pp_args = args.analysis_args

sys.stderr.write("Running --create-db\n")
create_db_cmd = poppunk + " --create-db --r-files " + args.r_files + " --output " + args.output + " " + pp_args
Expand All @@ -54,4 +57,20 @@ def get_options():
sys.stderr.write(refine_cmd + "\n")
subprocess.run(refine_cmd, shell=True, check=True)

if args.viz:

if args.viz_exe is None:
poppunk_viz = "poppunk_visualise"
else:
poppunk_viz = args.viz_exe

if args.viz_args is None:
viz_extra = ""
else:
viz_extra = args.viz_args

viz_cmd = poppunk_viz + " --ref-db " + args.output + " --output " + args.output + " " + viz_extra
sys.stderr.write(viz_cmd + "\n")
subprocess.run(viz_cmd, shell=True, check=True)

sys.exit(0)

0 comments on commit ea9e4cb

Please sign in to comment.