Skip to content

Commit 631f0e3

Browse files
authored
Merge pull request #1467 from nf-core/test_umi
Add test suite for UMI handling functionality
2 parents 674645e + 52ba2d4 commit 631f0e3

File tree

5 files changed

+2942
-6
lines changed

5 files changed

+2942
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Special thanks to the following for their contributions to the release:
1717
- [PR #1369](https://github.com/nf-core/rnaseq/pull/1369) - Add umicollapse as an alternative to umi-tools
1818
- [PR #1461](https://github.com/nf-core/rnaseq/pull/1461) - Add FASTQ linting during preprocessing
1919
- [PR #1463](https://github.com/nf-core/rnaseq/pull/1463) - Move channel operations outside of the onComplete() block
20+
- [PR #1467](https://github.com/nf-core/rnaseq/pull/1467) - Add test suite for UMI handling functionality
2021

2122
### Software dependencies
2223

tests/.nftignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ star_rsem/*.{genes,isoforms}.results
1313
star_rsem/log/*.log
1414
star_salmon/log/*.Log.{final.out,out,progress.out}
1515
trimgalore/*fastq.gz_trimming_report.txt
16+
umitools/*.umi_extract.log
1617
{hisat2,star_rsem,star_salmon}/*.{bam,bam.bai}
1718
{hisat2,star_rsem,star_salmon}/bigwig/*.{forward,reverse}.bigWig
1819
{hisat2,star_rsem,star_salmon}/dupradar/box_plot/*_duprateExpBoxplot.pdf
@@ -31,6 +32,7 @@ trimgalore/*fastq.gz_trimming_report.txt
3132
{hisat2,star_rsem,star_salmon}/stringtie/*.ballgown/t_data.ctab
3233
{hisat2,star_rsem,star_salmon}/stringtie/*.gene.abundance.txt
3334
{hisat2,star_rsem,star_salmon}/stringtie/*.{coverage,transcripts}.gtf
35+
{hisat2,star_rsem,star_salmon}/umitools/genomic_dedup_log/*_UMICollapse.log
3436
{multiqc,multiqc/**}/multiqc_report.html
3537
{multiqc,multiqc/**}/multiqc_report_data/fastqc_{raw,trimmed}_top_overrepresented_sequences_table.txt
3638
{multiqc,multiqc/**}/multiqc_report_data/hisat2_pe_plot.txt
@@ -81,6 +83,8 @@ trimgalore/*fastq.gz_trimming_report.txt
8183
{salmon,star_rsem,star_salmon}/deseq2_qc/deseq2.sample.dists.txt
8284
{salmon,star_rsem,star_salmon}/deseq2_qc/size_factors/*.txt
8385
{salmon,star_rsem,star_salmon}/deseq2_qc/size_factors/deseq2.size_factors.RData
86+
{salmon,star_rsem,star_salmon}/umitools/{genomic,transcriptomic}_dedup_log/*
87+
{salmon,star_rsem,star_salmon}/umitools/prepare_for_salmon_log/*
8488
{salmon,star_salmon}/*/aux_info/fld.gz
8589
{salmon,star_salmon}/*/aux_info/meta_info.json
8690
{salmon,star_salmon}/*/libParams/flenDist.txt

tests/umi.nf.test

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
nextflow_pipeline {
2+
3+
name "Test pipeline with dummy UMI settings"
4+
script "../main.nf"
5+
6+
test("Params: --aligner hisat2 --umi_dedup_tool 'umicollapse'") {
7+
8+
when {
9+
params {
10+
with_umi = true
11+
umitools_extract_method = "regex"
12+
umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*"
13+
umitools_dedup_stats = true
14+
skip_bbsplit = true
15+
umi_dedup_tool = 'umicollapse'
16+
aligner = 'hisat2'
17+
outdir = "$outputDir"
18+
}
19+
}
20+
21+
then {
22+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
23+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
24+
// stable_path: All files in ${params.outdir}/ with stable content
25+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
26+
assertAll(
27+
{ assert workflow.success},
28+
{ assert snapshot(
29+
// Number of successful tasks
30+
workflow.trace.succeeded().size(),
31+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
32+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
33+
// All stable path name, with a relative path
34+
stable_name,
35+
// All files with stable contents
36+
stable_path
37+
).match() }
38+
)
39+
}
40+
}
41+
42+
test("--umi_dedup_tool 'umitools'") {
43+
44+
when {
45+
params {
46+
with_umi = true
47+
umitools_extract_method = "regex"
48+
umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*"
49+
umitools_dedup_stats = true
50+
skip_bbsplit = true
51+
outdir = "$outputDir"
52+
}
53+
}
54+
55+
then {
56+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
57+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
58+
// stable_path: All files in ${params.outdir}/ with stable content
59+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
60+
assertAll(
61+
{ assert workflow.success},
62+
{ assert snapshot(
63+
// Number of successful tasks
64+
workflow.trace.succeeded().size(),
65+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
66+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
67+
// All stable path name, with a relative path
68+
stable_name,
69+
// All files with stable contents
70+
stable_path
71+
).match() }
72+
)
73+
}
74+
}
75+
76+
test("--umi_dedup_tool 'umitools - stub") {
77+
78+
options "-stub"
79+
80+
when {
81+
params {
82+
with_umi = true
83+
umitools_extract_method = "regex"
84+
umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*"
85+
umitools_dedup_stats = true
86+
outdir = "$outputDir"
87+
}
88+
}
89+
90+
then {
91+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
92+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
93+
// stable_path: All files in ${params.outdir}/ with stable content
94+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
95+
assertAll(
96+
{ assert workflow.success},
97+
{ assert snapshot(
98+
// Number of successful tasks
99+
workflow.trace.succeeded().size(),
100+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
101+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
102+
// All stable path name, with a relative path
103+
stable_name,
104+
// All files with stable contents
105+
stable_path
106+
).match() }
107+
)
108+
}
109+
}
110+
}

0 commit comments

Comments
 (0)