Skip to content

Commit

Permalink
Merge branch 'master' into indexg
Browse files Browse the repository at this point in the history
  • Loading branch information
famosab authored Dec 11, 2024
2 parents f28a84e + 299a26f commit 5ebb378
Show file tree
Hide file tree
Showing 23 changed files with 650 additions and 151 deletions.
19 changes: 19 additions & 0 deletions modules/nf-core/metabat2/metabat2/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,23 @@ process METABAT2_METABAT2 {
metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' )
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def decompress_depth = depth ? "gzip -d -f $depth" : ""
def depth_file = depth ? "-a ${depth.baseName}" : ""

"""
echo "" | gzip -c > ${prefix}.1.fa.gz
echo "" | gzip -c > ${prefix}.1.tooShort.fa.gz
echo "" | gzip -c > ${prefix}.1.lowDepth.fa.gz
echo "" | gzip -c > ${prefix}.1.unbinned.fa.gz
echo "" | gzip -c > ${prefix}.tsv.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' )
END_VERSIONS
"""
}
99 changes: 99 additions & 0 deletions modules/nf-core/metabat2/metabat2/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// nf-core modules test metabat2/metabat2
nextflow_process {

name "Test Process METABAT2_METABAT2"
script "../main.nf"
process "METABAT2_METABAT2"

tag "modules"
tag "modules_nfcore"
tag "metabat2"
tag "metabat2/metabat2"
tag "metabat2/jgisummarizebamcontigdepths"

test("sarscov2 - genome - fasta") {

when {
process {
"""
input[0] = [
[id: 'test', single_end: false],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
[]
]
"""
}
}

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

}

test("sarscov2 - genome - fasta - depths") {

setup {
run("METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS") {
script "../../jgisummarizebamcontigdepths/main.nf"
process {
"""
input[0] = [
[id: 'test', single_end: false],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true),
]
"""
}
}
}

when {
process {
"""
input[0] = Channel
.fromPath(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
.map { it -> [[ id:'test', single_end:false ], it] }
.join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.membership[0][1]).name).match() }
)
}

}

test("sarscov2 - genome - fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[id: 'test', single_end: false],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
[]
]
"""
}
}

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

}

}
178 changes: 178 additions & 0 deletions modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
{
"sarscov2 - genome - fasta": {
"content": [
{
"0": [

],
"1": [

],
"2": [

],
"3": [
[
{
"id": "test",
"single_end": false
},
"test.tsv.gz:md5,f50e2528d24fcd9a200cae3421945f05"
]
],
"4": [

],
"5": [
"versions.yml:md5,872d18278c2ba7812c62a8bc6b2120eb"
],
"fasta": [

],
"lowdepth": [

],
"membership": [
[
{
"id": "test",
"single_end": false
},
"test.tsv.gz:md5,f50e2528d24fcd9a200cae3421945f05"
]
],
"tooshort": [

],
"unbinned": [

],
"versions": [
"versions.yml:md5,872d18278c2ba7812c62a8bc6b2120eb"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-11T12:28:01.970872008"
},
"sarscov2 - genome - fasta - depths": {
"content": [
"test.tsv.gz"
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-11T13:08:47.777561763"
},
"sarscov2 - genome - fasta - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.1.tooShort.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.1.lowDepth.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"2": [
[
{
"id": "test",
"single_end": false
},
"test.1.unbinned.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"3": [
[
{
"id": "test",
"single_end": false
},
"test.tsv.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"4": [
[
{
"id": "test",
"single_end": false
},
"test.1.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"5": [
"versions.yml:md5,872d18278c2ba7812c62a8bc6b2120eb"
],
"fasta": [
[
{
"id": "test",
"single_end": false
},
"test.1.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"lowdepth": [
[
{
"id": "test",
"single_end": false
},
"test.1.lowDepth.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"membership": [
[
{
"id": "test",
"single_end": false
},
"test.tsv.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"tooshort": [
[
{
"id": "test",
"single_end": false
},
"test.1.tooShort.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"unbinned": [
[
{
"id": "test",
"single_end": false
},
"test.1.unbinned.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
"versions.yml:md5,872d18278c2ba7812c62a8bc6b2120eb"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-11T12:28:32.122007408"
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
process {

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

withName: METABAT2_METABAT2 {
ext.args = '--minContig 1500 --minCV 0.1 --minCVSum 0.1 --minClsSize 10 --minS 2'
}

}
2 changes: 1 addition & 1 deletion modules/nf-core/ngsbits/samplegender/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::ngs-bits=2023_02
- bioconda::ngs-bits=2024_11
6 changes: 3 additions & 3 deletions modules/nf-core/ngsbits/samplegender/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ process NGSBITS_SAMPLEGENDER {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ngs-bits:2023_02--py311ha0b7adc_2':
'biocontainers/ngs-bits:2023_02--py311ha0b7adc_2' }"
'https://depot.galaxyproject.org/singularity/ngs-bits:2024_11--py312hd80e9a6_0':
'biocontainers/ngs-bits:2024_11--py312hd80e9a6_0' }"

input:
tuple val(meta), path(bam), path(bai)
tuple val(meta2), path(fasta)
tuple val(meta2), path(fai)
tuple val(meta3), path(fai)
val method

output:
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/ngsbits/samplegender/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ input:
type: file
description: The reference FASTA to use (mandatory when CRAM files are used)
pattern: "*.{fasta,fa,fna}"
- - meta2:
- - meta3:
type: map
description: |
Groovy Map containing reference fasta information
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/ngsbits/samplegender/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nextflow_process {
tag "ngsbits"
tag "ngsbits/samplegender"

// Only a stub test here because the modules needs the full chrX and chrY
// Only a stub test here because the module needs the full chrX and chrY
test("homo_sapiens - bam, bai, [], [], sry - stub") {

options "-stub"
Expand Down
10 changes: 5 additions & 5 deletions modules/nf-core/ngsbits/samplegender/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
],
"1": [
"versions.yml:md5,72f3e70be3e6a734bf39d1a6bf6d604b"
"versions.yml:md5,9c2c2b8cf880d89b4eb1c06e3b7f7333"
],
"tsv": [
[
Expand All @@ -22,14 +22,14 @@
]
],
"versions": [
"versions.yml:md5,72f3e70be3e6a734bf39d1a6bf6d604b"
"versions.yml:md5,9c2c2b8cf880d89b4eb1c06e3b7f7333"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.1",
"nextflow": "24.10.1"
},
"timestamp": "2024-03-18T15:36:37.639882564"
"timestamp": "2024-12-10T13:36:08.650020628"
}
}
File renamed without changes.
Loading

0 comments on commit 5ebb378

Please sign in to comment.