Refactor subworkflows and add tests#780
Conversation
|
Warning Newer version of the nf-core template is available. Your pipeline is using an old version of the nf-core template: 3.5.1. For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation. |
|
fellen31
left a comment
There was a problem hiding this comment.
Awesome!
Missing a CHANGELOG (use dangoslen/changelog-enforcer@v3 perhaps?)
I understand if all tests can't be real tests from the start, but I would also include stub tests for all normal tests. Sometimes the stubs in the modules might differ, and it's good to check that both work as expected.
| path(workflow.out.vcf_ann[0][1].toString()).vcf.variantsMD5, | ||
| path(workflow.out.vcf_ann[0][1].toString()).vcf.summary |
There was a problem hiding this comment.
Should work, no? Or is there a difference between .get() and [] (e.g. path(process.out.vcf.get(0).get(1)).vcf.variantsMD5)?
| path(workflow.out.vcf_ann[0][1].toString()).vcf.variantsMD5, | |
| path(workflow.out.vcf_ann[0][1].toString()).vcf.summary | |
| path(workflow.out.vcf_ann[0][1]).vcf.variantsMD5, | |
| path(workflow.out.vcf_ann[0][1]).vcf.summary |
| { assert snapshot( | ||
| workflow.out.vcf.collect { meta, vcf -> file(vcf).name }, | ||
| workflow.out.tbi.collect { meta, tbi -> file(tbi).name } | ||
| ).match() } |
There was a problem hiding this comment.
Since it's a stub test, could you not just do?
| { assert snapshot( | |
| workflow.out.vcf.collect { meta, vcf -> file(vcf).name }, | |
| workflow.out.tbi.collect { meta, tbi -> file(tbi).name } | |
| ).match() } | |
| { assert snapshot(workflow.out).match() } |
| tag "subworkflows" | ||
| tag "call_snv" | ||
|
|
||
| test("CALL_SNV - deepvariant wgs") { |
There was a problem hiding this comment.
Such a massive number of input parameters 😄 Should you have a stub test as well?
| workflow.out.genome_vcf.collect { meta, vcf -> file(vcf).name }, | ||
| workflow.out.genome_tabix.collect { meta, tbi -> file(tbi).name }, | ||
| workflow.out.mt_vcf.collect { meta, vcf -> file(vcf).name } |
There was a problem hiding this comment.
What about also using vcf.variantsMD5 and vcf.summary here?
| assertAll( | ||
| { assert workflow.success }, | ||
| { assert snapshot( | ||
| path(workflow.out.vcf[0][1]).vcf.variantsMD5, |
| params { | ||
| outdir = "$outputDir" | ||
| } |
There was a problem hiding this comment.
Why do you need an outdir? 🤔
| assertAll( | ||
| { assert workflow.success }, | ||
| { assert snapshot( | ||
| path(workflow.out.vcf[0][1]).vcf.summary |
| params { | ||
| outdir = "$outputDir" | ||
| } |
There was a problem hiding this comment.
Why do you need an outdir? 🤔
| } | ||
|
|
||
| withName: '.*SUBSAMPLE_MT_FRAC:SAMTOOLS_VIEW' { | ||
| ext.args = { "--output-fmt BAM -h -F 4 -s ${meta.seedfrac}" } |
There was a problem hiding this comment.
Is seedfrac set in the subworkflow? I didn't see it in the inputs.
| when { | ||
| params { | ||
| mt_subsample_reads = 18000 | ||
| outdir = "$outputDir" |
There was a problem hiding this comment.
Why do you need an outdir? 🤔
There was a problem hiding this comment.
This outdir is still here.
fellen31
left a comment
There was a problem hiding this comment.
Nice! One outdir left, then I would also add stub tests for those that doesn't have it.
| NFT_VER: ${{ env.NFT_VER }} | ||
| with: | ||
| max_shards: 7 | ||
| max_shards: 14 |
There was a problem hiding this comment.
Would have a stub test here as well.
There was a problem hiding this comment.
Would add a stub test here as well.
There was a problem hiding this comment.
Would add a stub test here as well.
There was a problem hiding this comment.
Would add a stub test here as well.
There was a problem hiding this comment.
Would add a stub test here as well.
| when { | ||
| params { | ||
| mt_subsample_reads = 18000 | ||
| outdir = "$outputDir" |
There was a problem hiding this comment.
This outdir is still here.
|
I would also add this PR to the Changelog. |
PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).nextflow run . -profile test_singleton,docker --outdir <OUTDIR>).nextflow run . -profile debug,test,docker --outdir <OUTDIR>).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).