Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test suite for UMI handling functionality #1467

Merged
merged 7 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Special thanks to the following for their contributions to the release:
- [PR #1369](https://github.com/nf-core/rnaseq/pull/1369) - Add umicollapse as an alternative to umi-tools
- [PR #1461](https://github.com/nf-core/rnaseq/pull/1461) - Add FASTQ linting during preprocessing
- [PR #1463](https://github.com/nf-core/rnaseq/pull/1463) - Move channel operations outside of the onComplete() block
- [PR #1467](https://github.com/nf-core/rnaseq/pull/1467) - Add test suite for UMI handling functionality

### Software dependencies

Expand Down
4 changes: 4 additions & 0 deletions tests/.nftignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ star_rsem/*.{genes,isoforms}.results
star_rsem/log/*.log
star_salmon/log/*.Log.{final.out,out,progress.out}
trimgalore/*fastq.gz_trimming_report.txt
umitools/*.umi_extract.log
{hisat2,star_rsem,star_salmon}/*.{bam,bam.bai}
{hisat2,star_rsem,star_salmon}/bigwig/*.{forward,reverse}.bigWig
{hisat2,star_rsem,star_salmon}/dupradar/box_plot/*_duprateExpBoxplot.pdf
Expand All @@ -31,6 +32,7 @@ trimgalore/*fastq.gz_trimming_report.txt
{hisat2,star_rsem,star_salmon}/stringtie/*.ballgown/t_data.ctab
{hisat2,star_rsem,star_salmon}/stringtie/*.gene.abundance.txt
{hisat2,star_rsem,star_salmon}/stringtie/*.{coverage,transcripts}.gtf
{hisat2,star_rsem,star_salmon}/umitools/genomic_dedup_log/*_UMICollapse.log
{multiqc,multiqc/**}/multiqc_report.html
{multiqc,multiqc/**}/multiqc_report_data/fastqc_{raw,trimmed}_top_overrepresented_sequences_table.txt
{multiqc,multiqc/**}/multiqc_report_data/hisat2_pe_plot.txt
Expand Down Expand Up @@ -81,6 +83,8 @@ trimgalore/*fastq.gz_trimming_report.txt
{salmon,star_rsem,star_salmon}/deseq2_qc/deseq2.sample.dists.txt
{salmon,star_rsem,star_salmon}/deseq2_qc/size_factors/*.txt
{salmon,star_rsem,star_salmon}/deseq2_qc/size_factors/deseq2.size_factors.RData
{salmon,star_rsem,star_salmon}/umitools/{genomic,transcriptomic}_dedup_log/*
{salmon,star_rsem,star_salmon}/umitools/prepare_for_salmon_log/*
{salmon,star_salmon}/*/aux_info/fld.gz
{salmon,star_salmon}/*/aux_info/meta_info.json
{salmon,star_salmon}/*/libParams/flenDist.txt
Expand Down
110 changes: 110 additions & 0 deletions tests/umi.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
nextflow_pipeline {

name "Test pipeline with dummy UMI settings"
script "../main.nf"

test("Params: --aligner hisat2 --umi_dedup_tool 'umicollapse'") {

when {
params {
with_umi = true
umitools_extract_method = "regex"
umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*"
umitools_dedup_stats = true
skip_bbsplit = true
umi_dedup_tool = 'umicollapse'
aligner = 'hisat2'
outdir = "$outputDir"
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}

test("--umi_dedup_tool 'umitools'") {

when {
params {
with_umi = true
umitools_extract_method = "regex"
umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*"
umitools_dedup_stats = true
skip_bbsplit = true
outdir = "$outputDir"
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}

test("--umi_dedup_tool 'umitools - stub") {

options "-stub"

when {
params {
with_umi = true
umitools_extract_method = "regex"
umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*"
umitools_dedup_stats = true
outdir = "$outputDir"
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}
}
Loading
Loading