Permalink
Browse files

Add --cwl_engine argument to cwl_run.

Allow running the reference implementation using planemo.
  • Loading branch information...
jmchilton committed Nov 5, 2015
1 parent e7a8dde commit dd94ddcd2d473b864b0043bc7e68dcc826deedb1
Showing with 27 additions and 4 deletions.
  1. +5 −1 planemo/commands/cmd_cwl_run.py
  2. +3 −2 planemo/cwl/__init__.py
  3. +19 −1 planemo/cwl/run.py
@@ -26,4 +26,8 @@ def cli(ctx, path, job_path, **kwds):
% planemo cwl_run cat1-tool.cwl cat-job.json
"""
return cwl.run_galaxy(ctx, path, job_path, **kwds)
engine = kwds.get("cwl_engine", "galaxy")
if engine == "galaxy":
return cwl.run_galaxy(ctx, path, job_path, **kwds)
else:
return cwl.run_cwltool(ctx, path, job_path, **kwds)
@@ -1,5 +1,6 @@
from .client import run_cwl_tool
from .run import run_galaxy, run_cwltool

__all__ = [
'run_cwl_tool',
'run_galaxy',
'run_cwltool',
]
@@ -1,3 +1,9 @@
from planemo.io import conditionally_captured_io
from planemo import galaxy_serve
from .client import run_cwl_tool
from planemo import io

from cwltool.main import main


def run_galaxy(ctx, path, job_path, **kwds):
@@ -6,11 +12,23 @@ def run_galaxy(ctx, path, job_path, **kwds):
with conditionally_captured_io(conformance_test):
with galaxy_serve.serve_daemon(ctx, [path], **kwds) as config:
try:
cwl_run = cwl.run_cwl_tool(path, job_path, config, **kwds)
cwl_run = run_cwl_tool(path, job_path, config, **kwds)
except Exception:
io.warn("Problem running cwl tool...")
print(config.log_contents)
raise

print(cwl_run.cwl_command_state)
return 0


def run_cwltool(ctx, path, job_path, **kwds):
args = []
if kwds.get("conformance_test", False):
args.append("--conformance-test")
if ctx.verbose:
args.append("--verbose")

args.extend([path, job_path])
ctx.vlog("Calling cwltool with arguments %s" % args)
return main(args)

0 comments on commit dd94ddc

Please sign in to comment.