Hi everyone, I would like to write tests for a gen...
# help
a
Hi everyone, I would like to write tests for a genomics pipeline using nf-test, so -since I'm new to both nextflow and nf-test- I read the manual and created my first single-module and chained-module tests. Everything works as expected! ...so now I'd like to tweak the test procedure :) The pipeline is composed of
samtools
and
paraphase
, and runs
paraphase
with the
-g
flag followed by a comma-separated list of 10 genes. During testing, would it be possible to break this list in 10 different pipeline invocations, each with 1 gene? This would help keeping each test small and fast to execute. I started with gene GBA. I followed this example, and in my
tests/nextflow.config
file I wrote:
Copy code
process {
    withName: PARAPHASE {
        ext.args = '-g GBA'
    }
}
This setup works as intended: the config instructs
paraphase
to run against GBA only and produces the output that I expect. However, I cannot figure out how to write the remaining 9 blocks for the remaining 9 genes: any new section in the config will have the same
withName: PARAPHASE
, so besides the string containing the gene's name, all the 10 configurations will look identical. I looked around for a way to make them distinct, so that I can run
paraphase
with 10 different cli invocations, but I cannot figure out how. What am I missing? Have you ever encountered this scenario?
m
You're on the right track
You just need to modularize that a tiny bit more
Have something like
Copy code
process {
	withName: PARAPHASE {
        ext.args = { params.paraphrase_args }
	}
}
instead
And specify your args with different params in your run
Copy code
params {
                    paraphrase_args = "-g GBA"
                }
that way you should be able to do all 10 different invocations in a single test
a
Thank you very much, @Maxime Garcia! It works perfectly 🙂
m
BTW, you can join in #nf-test for nf-test related questions
a
ah! I missed it. Thank you, will do