Skip to content

Commit

Permalink
Merge pull request #1245 from adamrtalbot/nf-test_quantify_rsem
Browse files Browse the repository at this point in the history
nf test quantify rsem
  • Loading branch information
maxulysse authored Mar 8, 2024
2 parents 4823279 + 74853ce commit 417d0d1
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 0 deletions.
71 changes: 71 additions & 0 deletions subworkflows/local/quantify_rsem/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
nextflow_workflow {

name "Test Workflow QUANTIFY_RSEM"
script "../main.nf"
workflow "QUANTIFY_RSEM"
config "./nextflow.config"

tag 'RSEM_CALCULATEEXPRESSION'
tag 'RSEM_MERGE_COUNTS'
tag 'BAM_SORT_STATS_SAMTOOLS'

test("homo_sapiens") {

setup {
run("RSEM_PREPAREREFERENCE") {
script "../../../../modules/nf-core/rsem/preparereference/main.nf"
process {
"""
input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true))
input[1] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true))
"""
}
}
}

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test', strandedness: 'forward' ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_2.fastq.gz', checkIfExists: true)
]
])
input[1] = RSEM_PREPAREREFERENCE.out.index
input[2] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true))
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(
workflow.out.counts_gene,
workflow.out.counts_transcript,
workflow.out.stat,
workflow.out.bam_star,
workflow.out.bam_genome,
workflow.out.bam_transcript,
workflow.out.counts_transcript,
workflow.out.bam,
workflow.out.bai,
workflow.out.csi,
workflow.out.stats,
workflow.out.flagstat,
workflow.out.idxstats,
workflow.out.merged_counts_gene,
workflow.out.merged_tpm_gene,
workflow.out.merged_counts_transcript,
workflow.out.merged_tpm_transcript,
workflow.out.versions
).match()
},
{ assert snapshot(file(workflow.out.logs[0][1]).name).match('logs') }
)
}
}

}
110 changes: 110 additions & 0 deletions subworkflows/local/quantify_rsem/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"logs": {
"content": [
"test.log"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-03-07T18:25:31.476361"
},
"homo_sapiens": {
"content": [
[
[
{
"id": "test",
"strandedness": "forward"
},
"test.genes.results:md5,c7ec226f76736ea805771e73553ae359"
]
],
[
[
{
"id": "test",
"strandedness": "forward"
},
"test.isoforms.results:md5,99f7f80aa505b44ca429fdebbd7dd5d8"
]
],
[
[
{
"id": "test",
"strandedness": "forward"
},
[
"test.cnt:md5,76249e6b2f3c104f414aae596ba2c2f4",
"test.model:md5,a7a4bc1734918ef5848604e3362b83e2",
"test.theta:md5,de2e4490c98cc5383a86ae8225fd0a28"
]
]
],
[

],
[

],
[
[
{
"id": "test",
"strandedness": "forward"
},
"test.transcript.bam:md5,ed681d39f5700ffc74d6321525330d93"
]
],
[
[
{
"id": "test",
"strandedness": "forward"
},
"test.isoforms.results:md5,99f7f80aa505b44ca429fdebbd7dd5d8"
]
],
[

],
[

],
[

],
[

],
[

],
[

],
[
"rsem.merged.gene_counts.tsv:md5,f3b586000c97c89aec45360772e73df1"
],
[
"rsem.merged.gene_tpm.tsv:md5,e6ae3dfa9913a7c15b705ec27c376212"
],
[
"rsem.merged.transcript_counts.tsv:md5,235c002b811360183494a2aac74d1f5b"
],
[
"rsem.merged.transcript_tpm.tsv:md5,d38f22667e3b8012f1d783b8d5159ccc"
],
[
"versions.yml:md5,2aa5252eb2ffb409cf556a165d40f8a9",
"versions.yml:md5,ae1676b60b6335fff8f1188288103a1c"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-03-07T18:15:03.001083"
}
}
12 changes: 12 additions & 0 deletions subworkflows/local/quantify_rsem/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
process {

// Needs the glob to force the config to be applied
withName: "RSEM_PREPAREREFERENCE" {
ext.args = "--star "
}

withName: "RSEM_CALCULATEEXPRESSION" {
ext.args = '--star --star-gzipped-read-file'
}

}

0 comments on commit 417d0d1

Please sign in to comment.