Skip to content

Commit dd94ddc

Browse files
committed
Add --cwl_engine argument to cwl_run.
Allow running the reference implementation using planemo.
1 parent e7a8dde commit dd94ddc

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

planemo/commands/cmd_cwl_run.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ def cli(ctx, path, job_path, **kwds):
2626
2727
% planemo cwl_run cat1-tool.cwl cat-job.json
2828
"""
29-
return cwl.run_galaxy(ctx, path, job_path, **kwds)
29+
engine = kwds.get("cwl_engine", "galaxy")
30+
if engine == "galaxy":
31+
return cwl.run_galaxy(ctx, path, job_path, **kwds)
32+
else:
33+
return cwl.run_cwltool(ctx, path, job_path, **kwds)

planemo/cwl/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from .client import run_cwl_tool
1+
from .run import run_galaxy, run_cwltool
22

33
__all__ = [
4-
'run_cwl_tool',
4+
'run_galaxy',
5+
'run_cwltool',
56
]

planemo/cwl/run.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
from planemo.io import conditionally_captured_io
2+
from planemo import galaxy_serve
3+
from .client import run_cwl_tool
4+
from planemo import io
5+
6+
from cwltool.main import main
17

28

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

1521
print(cwl_run.cwl_command_state)
1622
return 0
23+
24+
25+
def run_cwltool(ctx, path, job_path, **kwds):
26+
args = []
27+
if kwds.get("conformance_test", False):
28+
args.append("--conformance-test")
29+
if ctx.verbose:
30+
args.append("--verbose")
31+
32+
args.extend([path, job_path])
33+
ctx.vlog("Calling cwltool with arguments %s" % args)
34+
return main(args)

0 commit comments

Comments
 (0)