I would like to ask advice about parameter design ...
# pipeline-maintainers
c
I would like to ask advice about parameter design for my #C06TRU74N4D pipeline. I have a module that can export the final results to "axt", "bam", "bed", "blast", "blasttab", "blasttab+", "chain", "cram", "gff", "html", "psl", "sam" and "tab" formats. At the moment the pipeline accepts only one output format via the
export_aln_to
parameter, whose value is checked against the list via the
nextflow_schema.json
file. But some users want two or three exports, because downstream tools are have various non-compatible requirements. At the moment they just run the pipeline with
--resume
and a different value for
export_aln_to
. I see two possibilities: • Expand
export_aln_to
to support a list of comma-separated values, for instance
axt,bam,chain
. The drawback is that I can not use
nextflow_schema.json
anymore to sanitise the input. • Add new
export_aln_to2
,
export_aln_to3
and maybe even
export_aln_to4
arguments. The drawback is that it is ugly and potentially confusing. I have a working proof of principle for both, but I struggle to decide by myself. I welcome your comments and suggestions.
j
Not particularly helpful, but in the past we do the former and do the sanitisation/validation with groovy/nextflow code
I wonder if such functioanlity could somehow be added to nf-schema actually @Nicolas Vannieuwkerke? Thoughts?
n
This already happens in a lot of pipelines and people have found some smart workarounds for this using regex patterns: (e.g. in Sarek: https://github.com/nf-core/sarek/blob/5fe5cdff171e3baed603b3990cab7f7fd3fcb992/nextflow_schema.json#L110-L116)
So the first option with a pattern like the one used in Sarek would be the ideal solution here šŸ˜›. I'm a bit wary of adding a lot of custom stuff to the nextflow JSON schema because this increases the maintenance burden for the plugin (which is just a side project for me) and it will require updates in a lot of other places like nf-core tools and Platform šŸ˜›
šŸ‘ 1
c
Awesome. It works like a charm and is better than either solution that I thought about.
šŸŽ‰ 1
n
Glad to hear that!!!