Skip to content

Commit

Permalink
update malt/build module (#6994)
Browse files Browse the repository at this point in the history
* update malt/build module

* use stageAs for input fasta files

* Try HTTPS rather than s3

* Trying manually restricting memory

* Move config loading to the right place

* Update modules/nf-core/malt/build/tests/main.nf.test

Co-authored-by: Mahesh Binzer-Panchal <[email protected]>

* Update main.nf.test

* Update nextflow.config

* Get tests running

* Adjust to VM minimum

* And MALT_RUN

* use process.resourceLimits defining the memory limit

* Update modules/nf-core/malt/run/tests/nextflow.config

Co-authored-by: Mahesh Binzer-Panchal <[email protected]>

* Update modules/nf-core/malt/run/tests/nextflow.config

Co-authored-by: Mahesh Binzer-Panchal <[email protected]>

* Update modules/nf-core/malt/run/tests/nextflow.config

Co-authored-by: Mahesh Binzer-Panchal <[email protected]>

* Update nextflow.config

---------

Co-authored-by: James A. Fellows Yates <[email protected]>
Co-authored-by: Mahesh Binzer-Panchal <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent e24c973 commit 47f728e
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 43 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/malt/build/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::malt=0.61
- bioconda::malt=0.62
22 changes: 10 additions & 12 deletions modules/nf-core/malt/build/main.nf
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
process MALT_BUILD {

label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/malt:0.61--hdfd78af_0' :
'biocontainers/malt:0.61--hdfd78af_0' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/malt:0.62--hdfd78af_0'
: 'biocontainers/malt:0.62--hdfd78af_0'}"

input:
path fastas
path fastas, stageAs: 'fa_folder/'
path gff
path mapping_db

output:
path "malt_index/" , emit: index
path "versions.yml" , emit: versions
path "malt_index/", emit: index
path "versions.yml", emit: versions
path "malt-build.log", emit: log

when:
Expand All @@ -26,12 +24,12 @@ process MALT_BUILD {

"""
malt-build \\
${args} \\
-v \\
--input ${fastas.join(' ')} \\
$igff \\
--input fa_folder \\
${igff} \\
-d 'malt_index/' \\
-t $task.cpus \\
$args \\
-t ${task.cpus} \\
-mdb ${mapping_db}/*.db |&tee malt-build.log
cat <<-END_VERSIONS > versions.yml
Expand Down
2 changes: 2 additions & 0 deletions modules/nf-core/malt/build/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ output:
pattern: "malt-build.log"
authors:
- "@jfy133"
- "@LilyAnderssonLee"
maintainers:
- "@jfy133"
- "@LilyAnderssonLee"
19 changes: 13 additions & 6 deletions modules/nf-core/malt/build/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ nextflow_process {
name "Test Process MALT_BUILD"
script "../main.nf"
process "MALT_BUILD"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
Expand All @@ -16,18 +15,24 @@ nextflow_process {
script "../../../unzip/main.nf"
process {
"""
input[0] = [[], file("s3://ngi-igenomes/test-data/createtaxdb/taxonomy/megan-nucl-Feb2022.db.zip", checkIfExists: true)]
input[0] = [[], file("https://ngi-igenomes.s3.eu-west-1.amazonaws.com/test-data/createtaxdb/taxonomy/megan-nucl-Feb2022.db.zip", checkIfExists: true)]
"""
}
}
}

test("sarscov2 - fastq") {

config "./nextflow.config"
when {
params {
module_args = '-J-Xmx6G --sequenceType DNA'
}
process {
"""
input[0] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true)
def genome_1 = file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/fasta/sarscov2.fasta', checkIfExists: true )
def genome_2 = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true )
input[0] = [genome_1,genome_2]
input[1] = []
input[2] = UNZIP.out.unzipped_archive.map { it[1] }
"""
Expand Down Expand Up @@ -59,13 +64,15 @@ nextflow_process {
}

test("sarscov2 - fastq - stub") {

options "-stub"

when {
process {
"""
input[0] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta", checkIfExists: true)
def genome_1 = file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/fasta/sarscov2.fasta', checkIfExists: true )
def genome_2 = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true )
input[0] = [genome_1,genome_2]
input[1] = []
input[2] = UNZIP.out.unzipped_archive.map { it[1] }
"""
Expand Down
24 changes: 12 additions & 12 deletions modules/nf-core/malt/build/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
]
],
"1": [
"versions.yml:md5,52c299d59c90219b9b442ee54f1acc97"
"versions.yml:md5,4ad582e415ed27dd4a275a149209961b"
],
"2": [
"malt-build.log:md5,d41d8cd98f00b204e9800998ecf8427e"
Expand All @@ -22,33 +22,33 @@
"malt-build.log:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"versions": [
"versions.yml:md5,52c299d59c90219b9b442ee54f1acc97"
"versions.yml:md5,4ad582e415ed27dd4a275a149209961b"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
"nextflow": "24.10.0"
},
"timestamp": "2024-01-26T11:49:19.685017271"
"timestamp": "2024-11-15T12:14:24.942518"
},
"sarscov2 - fastq": {
"content": [
"index0.idx:md5,1954f2c00b418d00112829b0a6adb8ce",
"ref.db:md5,772a09aeb162515485b037604399f2bd",
"ref.idx:md5,7dea362b3fac8e00956a4952a3d4f474",
"ref.inf:md5,b146842067cf278ef1d23e6c2e7c0c35",
"taxonomy.idx:md5,bb335e7c378a5bd85761b6eeed16d984",
"index0.idx:md5,0ba3d8bfb7ef28d08e2a005dd3405c55",
"ref.db:md5,6b36ae031c49feaae50f4cea07d9c7f4",
"ref.idx:md5,8ba66cdf65181c7efee1d366574cb9d7",
"ref.inf:md5,042712533a0187b6566db67c6503a71e",
"taxonomy.idx:md5,e7ce35e6238f39fa0c236fcf991546e4",
"taxonomy.map:md5,5bb3f2192e925bca2e61e4b54f1671e0",
"taxonomy.tre:md5,f76fb2d5aa9b0d637234d48175841e0e",
[
"versions.yml:md5,52c299d59c90219b9b442ee54f1acc97"
"versions.yml:md5,4ad582e415ed27dd4a275a149209961b"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
"nextflow": "24.10.0"
},
"timestamp": "2024-06-30T19:04:45.72181253"
"timestamp": "2024-11-15T12:13:59.078459"
}
}
5 changes: 1 addition & 4 deletions modules/nf-core/malt/build/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
process {


withName: MALT_BUILD {
ext.args = "--sequenceType DNA"
ext.args = params.module_args
}

}
2 changes: 1 addition & 1 deletion modules/nf-core/malt/run/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nextflow_process {
script "../../../unzip/main.nf"
process {
"""
input[0] = [[], file("s3://ngi-igenomes/test-data/createtaxdb/taxonomy/megan-nucl-Feb2022.db.zip", checkIfExists: true)]
input[0] = [[], file("https://ngi-igenomes.s3.eu-west-1.amazonaws.com/test-data/createtaxdb/taxonomy/megan-nucl-Feb2022.db.zip", checkIfExists: true)]
"""
}
}
Expand Down
11 changes: 4 additions & 7 deletions modules/nf-core/malt/run/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
process {


withName: MALT_RUN {
ext.args = "-m BlastN -J-Xmx8G -a . -f SAM"
memory = 12.GB
}

withName: MALT_BUILD {
ext.args = "--sequenceType DNA"
ext.args = { "-J-Xmx${task.memory.toGiga()}G --sequenceType DNA" }
}

withName: MALT_RUN {
ext.args = { "-m BlastN -J-Xmx${task.memory.toGiga()}G -a . -f SAM" }
}
}

0 comments on commit 47f728e

Please sign in to comment.