8 picard_install_path = None
11 global picard_install_path
12 if picard_install_path:
13 return picard_install_path
14 zipball = arvados.current_job()['script_parameters']['picard_zip']
15 extracted = arvados.util.zipball_extract(
18 for f in os.listdir(extracted):
19 if (re.search(r'^picard-tools-[\d\.]+$', f) and
20 os.path.exists(os.path.join(extracted, f, '.'))):
21 picard_install_path = os.path.join(extracted, f)
23 if not picard_install_path:
24 raise Exception("picard-tools-{version} directory not found in %s" %
26 return picard_install_path
28 def run(module, **kwargs):
29 kwargs.setdefault('cwd', arvados.current_task().tmpdir)
32 '-Djava.io.tmpdir=' + arvados.current_task().tmpdir,
33 '-jar', os.path.join(install_path(), module + '.jar')]
34 execargs += [str(arg) for arg in kwargs.pop('args', [])]
35 for key, value in kwargs.pop('params', {}).items():
36 execargs += [key.upper() + '=' + str(value)]
37 sys.stderr.write("%s.run: exec %s\n" % (__name__, str(execargs)))
38 return arvados.util.run_command(execargs, **kwargs)