This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to pass custom software specific variables to nf-core/sarek nextflow pipeline?

I'm attempting to call whole genome variants using nf-core/sarek nextflow pipeline. In QC step there is an option that invokes trim_galore quality trimming, but i don't know how to pass my custom adapters to be cut as well.

Here is an example of trim_galore line i want to adapt to sarek pipeline:

 trim_galore \
--adapter AAGTCGGAGGCCAAGCGGTCTTAGGAAGACAA \
--adapter2 AAGTCGGATCGTAGCCATGTCGTTCTGTGAGCCAAGGAGTTG \
--quality 20 \
--paired \
--no_report_file \
reads1.fq.gz \
reads2.fq.gz

And here is an example of sarek comman line i would like to pass these trim_galore parameters to:

    nextflow run nf-core/sarek \
--input samples.tsv \
--split_fastq 2000000 \
--tools 'HaploTypeCaller' \
--genome GRCh38 \
--save_reference \
--species 'homo_sapiens' \
-profile singularity \
--trim_fastq 
wgs

The fastest way to get help for nf-core pipelines is to join the Slack: https://nf-co.re/join/slack

I currently see no way to pass in a custom argument such as --adapter, so this would need to be added by the pipeline developers.

https://github.com/nf-core/sarek/blob/master/main.nf#L861-L869

Something like params.trim_galore_additional and then:

trim_galore \
        ${params.trim_galore_additional} \
        --cores ${cores} \
        --paired \
        --fastqc \
        --gzip \
        ${c_r1} ${c_r2} \
        ${tpc_r1} ${tpc_r2} \
        ${nextseq} \
        ${idSample}_${idRun}_R1.fastq.gz ${idSample}_${idRun}_R2.fastq.gz

So eventually via config file or command like you could add:

--trim_galore_additional '--adapter <seq> --adapter2 <seq2>'

or if you specify nothing then this will be an empty string and gets ignored. Just ask at the Slack, they are helpful and friendly guys.

The bad solution i use right now is just edit main.nf

Why is that bad? If the option you need is not in there you have two ways to go: a) ask for it to be added or b) fork it and add it yourself.

It becomes less reproducible that way

Also if you do open a pull request with your changes, once merged it will benefit all users :)

Wanted to note that with the upcoming DSL2 pieline release you will be able to append additional command line flags like this to _any_ process via a config file (no need to edit any pipeline files). This will be true for all nf-core pipelines as they transition to DSL2.

DSL2 = Nextflow domain specific language 2, new syntax and for nf-core marks the start of a modular design using reusable pipeline components: https://github.com/nf-core/modules

0 answers

No answers yet.

Log in to answer this question.