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

Bump star version and port tests to nf-test #5529

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
207 changes: 207 additions & 0 deletions modules/nf-core/arriba/arriba/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
nextflow_process {

name "Test Process ARRIBA_ARRIBA"
script "../main.nf"
config "./nextflow.config"
process "ARRIBA_ARRIBA"

tag "modules"
tag "modules_nfcore"
tag "arriba"
tag "arriba/arriba"
tag "star"
tag "star/align"
tag "star/genomegenerate"

setup {
run("STAR_GENOMEGENERATE") {
script "../../../star/genomegenerate/main.nf"
process {
"""
input[0] = Channel.of([
[ id:'test_fasta' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]
])
input[1] = Channel.of([
[ id:'test_fai' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ]
])
input[2] = Channel.of([
[ id:'test_gtf' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
])
"""
}
}
}

test("homo_sapiens - single_end") {
setup {
run("STAR_ALIGN") {
script "../../../star/align/main.nf"
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:true ], // meta map
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_1.fastq.gz', checkIfExists: true) ]
])
input[1] = STAR_GENOMEGENERATE.out.index
input[2] = Channel.of([
[ id:'test_gtf' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
])
input[3] = false
input[4] = 'illumina'
input[5] = false
"""
}
}
}

when {
process {
"""
input[0] = STAR_ALIGN.out.bam
input[1] = Channel.of([
[ id:'test_fasta' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]
])
input[2] = Channel.of([
[ id:'test_gtf' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
])
input[3] = [[],[]]
input[4] = [[],[]]
input[5] = [[],[]]
input[6] = [[],[]]
input[7] = [[],[]]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

test("homo_sapiens - paired_end") {
setup {
run("STAR_ALIGN") {
script "../../../star/align/main.nf"
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:false ], // 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] = STAR_GENOMEGENERATE.out.index
input[2] = Channel.of([
[ id:'test_gtf' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
])
input[3] = false
input[4] = 'illumina'
input[5] = false
"""
}
}
}

when {
process {
"""
input[0] = STAR_ALIGN.out.bam
input[1] = Channel.of([
[ id:'test_fasta' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]
])
input[2] = Channel.of([
[ id:'test_gtf' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
])
input[3] = [[],[]]
input[4] = [[],[]]
input[5] = [[],[]]
input[6] = [[],[]]
input[7] = [[],[]]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

test("homo_sapiens - paired_end - stub") {

options "-stub"

setup {
run("STAR_ALIGN") {
script "../../../star/align/main.nf"
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:false ], // 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] = STAR_GENOMEGENERATE.out.index
input[2] = Channel.of([
[ id:'test_gtf' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
])
input[3] = false
input[4] = 'illumina'
input[5] = false
"""
}
}
}


when {
process {
"""
input[0] = STAR_ALIGN.out.bam
input[1] = Channel.of([
[ id:'test_fasta' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]
])
input[2] = Channel.of([
[ id:'test_gtf' ],
[ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
])
input[3] = [[],[]]
input[4] = [[],[]]
input[5] = [[],[]]
input[6] = [[],[]]
input[7] = [[],[]]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
161 changes: 161 additions & 0 deletions modules/nf-core/arriba/arriba/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"homo_sapiens - single_end": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.fusions.tsv:md5,7c3383f7eb6d79b84b0bd30a7ef02d70"
]
],
"1": [
[
{
"id": "test",
"single_end": true
},
"test.fusions.discarded.tsv:md5,a35962c2fc4bc31321dde993363e71f1"
]
],
"2": [
"versions.yml:md5,d323796555db4a58fe4c6bc08d1dec30"
],
"fusions": [
[
{
"id": "test",
"single_end": true
},
"test.fusions.tsv:md5,7c3383f7eb6d79b84b0bd30a7ef02d70"
]
],
"fusions_fail": [
[
{
"id": "test",
"single_end": true
},
"test.fusions.discarded.tsv:md5,a35962c2fc4bc31321dde993363e71f1"
]
],
"versions": [
"versions.yml:md5,d323796555db4a58fe4c6bc08d1dec30"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-29T08:56:43.739605934"
},
"homo_sapiens - paired_end": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.fusions.tsv:md5,7c3383f7eb6d79b84b0bd30a7ef02d70"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.fusions.discarded.tsv:md5,445cb87a27f063e751f93498cf8d10b5"
]
],
"2": [
"versions.yml:md5,d323796555db4a58fe4c6bc08d1dec30"
],
"fusions": [
[
{
"id": "test",
"single_end": false
},
"test.fusions.tsv:md5,7c3383f7eb6d79b84b0bd30a7ef02d70"
]
],
"fusions_fail": [
[
{
"id": "test",
"single_end": false
},
"test.fusions.discarded.tsv:md5,445cb87a27f063e751f93498cf8d10b5"
]
],
"versions": [
"versions.yml:md5,d323796555db4a58fe4c6bc08d1dec30"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-29T08:59:40.552343349"
},
"homo_sapiens - paired_end - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.fusions.tsv:md5,f50b84b1db4b83ba62ec1deacc69c260"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.fusions.discarded.tsv:md5,f50b84b1db4b83ba62ec1deacc69c260"
]
],
"2": [
"versions.yml:md5,d323796555db4a58fe4c6bc08d1dec30"
],
"fusions": [
[
{
"id": "test",
"single_end": false
},
"test.fusions.tsv:md5,f50b84b1db4b83ba62ec1deacc69c260"
]
],
"fusions_fail": [
[
{
"id": "test",
"single_end": false
},
"test.fusions.discarded.tsv:md5,f50b84b1db4b83ba62ec1deacc69c260"
]
],
"versions": [
"versions.yml:md5,d323796555db4a58fe4c6bc08d1dec30"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-29T08:33:36.830558897"
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

withName: STAR_GENOMEGENERATE {
ext.args = '--genomeSAindexNbases 11'
ext.args = '--genomeSAindexNbases 9'
}

withName: STAR_ALIGN {
Expand Down
2 changes: 2 additions & 0 deletions modules/nf-core/arriba/arriba/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arriba/arriba:
- "modules/nf-core/arriba/arriba/**"
6 changes: 2 additions & 4 deletions modules/nf-core/star/align/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::star=2.7.10a
- bioconda::samtools=1.18
- bioconda::htslib=1.18
- conda-forge::gawk=5.1.0
- bioconda::htslib=1.19.1
- bioconda::star=2.7.11b