modules icon indicating copy to clipboard operation
modules copied to clipboard

Launching one-off subworkflows

Open edmundmiller opened this issue 4 years ago • 9 comments

edmundmiller avatar Nov 16 '21 14:11 edmundmiller

Anyone have any ideas how we can pass the input channels in?

Workflow `ALIGN_BOWTIE2` declares 2 input channels but 0 were specified

edmundmiller avatar Nov 16 '21 15:11 edmundmiller

Anyone have any ideas how we can pass the input channels in?

Workflow `ALIGN_BOWTIE2` declares 2 input channels but 0 were specified

I've tried several variations and so far nothing works. I came to the conclusion it wasn't possible to pass anything to take, except by using another script.

mahesh-panchal avatar Nov 23 '21 17:11 mahesh-panchal

Can this work though? Consider if this snippet was at the bottom of main.nf:

workflow {
    
    ALIGN_BOWTIE2( 
        params.reads // channel: [ val(meta), [ reads ] ]
        params.index // channel: /path/to/bowtie2/index/
    )
}

How would one tell Nextflow the string path is actually a file path?

mahesh-panchal avatar Nov 23 '21 20:11 mahesh-panchal

I have a feeling we need something like https://www.nextflow.io/docs/edge/dsl2.html#module-templates And then we can call a template that handles the file input params, or maybe something that just takes a samplesheet and outputs a meta map like channel, and then we pass in the subworkflow name in the template.

edmundmiller avatar Nov 27 '21 16:11 edmundmiller

Doesn't that mean the process has to take care of the file staging Nextflow usually does? Otherwise what's the difference to writing another anonymous workflow which calls the named workflow?

mahesh-panchal avatar Dec 01 '21 10:12 mahesh-panchal

That was all that I was imagining the template would be is an anonymous workflow, that might hook it up to a samplesheet module or something. Your snippet might work with fromfilepairs and maybe some magic to turn the name into a meta.id

edmundmiller avatar Dec 05 '21 20:12 edmundmiller

Shall we close this one, as I'm assuming it's no longer relevant. @Emiller88 @mahesh-panchal

maxulysse avatar Oct 10 '22 12:10 maxulysse

Fine by me.

mahesh-panchal avatar Oct 10 '22 12:10 mahesh-panchal

I think it's even more relevant now that we've actually added subworkflows

edmundmiller avatar Oct 10 '22 13:10 edmundmiller

Hi there!

We've noticed there hasn't been much activity here. Are you still planning on working on this? If not, you can ignore this message and we'll close your PR in about 2 weeks

Cheers the nf-core maintainers

matthdsm avatar Mar 06 '23 14:03 matthdsm

Closing in favor of https://github.com/nf-wrap

edmundmiller avatar Mar 07 '23 03:03 edmundmiller