I have the following (simplified) nextflow module. It has one process, which runs a multiple sequence alignment on a fasta file, and a workflow that runs this process (eventually it will run other processes too):
process clustal_omega_msa {
input:
path fastas
output:
path 'clustal.sto'
script:
"""
cat ${fastas} > merged.fa
clustalo -infile merged.fa --outfmt=stockholm
"""
container "https://depot.galaxyproject.org/singularity/clustalo:1.2.4--h1b792b2_4"
}
workflow msa {
take:
path fastas
main:
clustal_omega_msa(fastas)
}
I want this workflow to be both importable as a sub-workflow, and also executable directly. For this reason I have specified no parameters, and only used inputs (because I believe parameters can't be specified when calling a subworkflow).
However, I can see no way to run this subworkflow directly on the command line.
If I run nextflow run msa.nf -entry msa
I get the following error:
No such variable: fastas
-- Check script 'msa.nf' at line: 1 or see '.nextflow.log' file for more details
This makes sense - I haven't specified where these files come from. But how can I? If I follow the config part of the docs and create a nextflow.config
with the following contents:
fastas = "/some/path/to/*.fasta"
I still get this error. I am also aware there is a -params-file
option, but I believe that only works for parameters, not inputs.