Skip to content

Instantly share code, notes, and snippets.

@lparsons
Created March 15, 2016 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lparsons/a4724b51afd9027e3c0e to your computer and use it in GitHub Desktop.
Save lparsons/a4724b51afd9027e3c0e to your computer and use it in GitHub Desktop.
from galaxy.jobs import JobDestination
import os
import ast
from pprint import pprint
def bowtie2_wrapper(job):
pprint(dir(job))
pprint(job.get_parameters())
for jp in job.get_parameters():
if jp.name == "analysis_type":
pprint(jp.value)
jpv = ast.literal_eval(jp.value)
ro = jpv.get("reporting_options")
if ro is not None:
ros = ro.get("reporting_options_selector")
if ros == "a":
return 'multicore_local'
if ros == "k":
k = ro.get("k")
print("k = %s" % k)
try:
kval = int(k)
if kval >= 40:
return 'multicore_local'
except ValueError:
pass
return 'local'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment