question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

snakemake 6.8.0 → CWL

See original GitHub issue

From @sofiakarb

The issue I am currenlty facing has to do with Snakemake (v:6.8.0) - cwltool (v:3.1.20210521105815). More specifically, my Snakefile is the following:

from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider
HTTP = HTTPRemoteProvider()

rule workflow:
    input:
        input_file=HTTP.remote("remote_link", keep_local=True)
    params:
        channels=[0, 1, 2, 3, 4],
        psd_output_file_name="psd.json",
        output_file_name="output.png"
    output:
        output="output.png"
    cwl:
        "file:workflow.cwl"

While executing snakemake -c 1, I get an error related to cwltool :

INFO /../bin/cwltool 3.1.20210521105815
ERROR Workflow error, try again with --debug for more information:
Invalid job input record:
../../../../tmp/tmpw06vyrgf:1:2: the `input_file` field is not valid because
                                   is not a dict

This is because .yml file that holds the information about Class: File is skipped due to the fact that Snakemake only needs the Snakefile (in which all input, parameters, outputs and cwl workflow file are provided). I can see two solutions, one from Snakemake side, where I must specificly provide the Class:File in the input_file field, and the other solution having a way cwltool to not provide errors (maybe just a warning?)

Thank you beforehand for your support.

_Originally posted by @sofiakarb in https://github.com/common-workflow-language/cwltool/issues/758#issuecomment-951760232_

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sofiakarbcommented, Nov 29, 2021

Dear @mr-c, sorry for the late response. Our workflow definition is under an internal gitlab repo so it will not be possible for you to reproduce it -for now. I will try to find some time to work an a simpler example and let you know. For now the solution previously shared seems to work fine

1reaction
sofiakarbcommented, Oct 26, 2021

A solution (temporal?) that worked for us is the following:

rule workflow:
    input:
    params:
        input_file={"class": "File", "path": "https://object.cscs.ch/v1/AUTH_25b4e28a742d4987a7b6f84c0c36512e/hbp-01852/data-originals/sub-1/hbp-01852_sub-1_chs-32_hem-RH_ana-ISO000_stim-SPN.smr"},
        channels=[0, 1, 2, 3, 4],
        psd_output_file_name="psd.json",
        output_file_name="output.png"
    output:
        output="output.png"
    cwl:
        "file:workflow.cwl"

We removed the HTTPRemoteProvider, and placed everything inside the params: (including the input_file). This remote location is then taking care of by the cwltool which also sees the correct Class:File and stops the error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interoperability — Snakemake 6.8.0 documentation
Snakemake workflows can be exported to CWL, such that they can be executed in any CWL-enabled workflow engine. Since, CWL is less powerful...
Read more >
providing a string for an input with type File needs a better ...
The issue I am currenlty facing has to do with Snakemake (v:6.8.0) - cwltool (v:3.1.20210521105815). More specifically, my Snakefile is the ...
Read more >
snakemake : export DAG for a specific rule file - Stack Overflow
This will depend on how individual .rules are defined, but it's possible to pass a specific Snakefile using -s : snakemake -s step1.rules ......
Read more >
Package Recipe 'snakemake' — Bioconda documentation
Snakemake workflows are essentially Python scripts extended by declarative code to define rules. Rules describe how to create output files from input files....
Read more >
Using rapid prototyping to choose a bioinformatics workflow ...
To select a workflow management system, a rapid survey of available systems was undertaken, and candidates were shortlisted: Snakemake, cwltool ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found