-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented chocophlan and uniref modules & tests
- Loading branch information
Showing
14 changed files
with
335 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::humann=3.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
process HUMANN_DOWNLOADCHOCOPHLANDB { | ||
tag "${params.chocophlan_db_version}" | ||
label 'process_single' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/humann:3.8--pyh7cba7a3_0': | ||
'quay.io/biocontainers/humann:3.8--pyh7cba7a3_0' }" | ||
|
||
output: | ||
path "${prefix}/chocophlan/" , emit: chocophlan_db_dir | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "chocophlan_db_${params.chocophlan_db_version}" | ||
""" | ||
mkdir -p ${prefix} | ||
https_proxy=http://klone-dip1-A-ib:3128 | ||
export https_proxy | ||
humann_databases \\ | ||
--download chocophlan ${params.chocophlan_db_version} \\ | ||
${prefix} \\ | ||
$args | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
humann: \$(echo \$(humann --version 2>&1 | sed 's/^.*humann //; s/Using.*\$//' )) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "chocophlan_db_${params.chocophlan_db_version}" | ||
""" | ||
mkdir -p ${prefix}/chocophlan/ | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
humann: \$(echo \$(humann --version 2>&1 | sed 's/^.*humann //; s/Using.*\$//' )) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
process { | ||
withName: HUMANN_DOWNLOADCHOCOPHLANDB { | ||
ext.args = "--update-config no" | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
modules/local/humann/downloadchocophlandb/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
nextflow_process { | ||
|
||
name "Test Process: HUMANN_DOWNLOADCHOCOPHLANDB" | ||
script "../main.nf" | ||
process "HUMANN_DOWNLOADCHOCOPHLANDB" | ||
|
||
tag "modules" | ||
tag "modules_local" | ||
tag "humann" | ||
tag "humann/downloadchocophlandb" | ||
|
||
|
||
test(" chocophlan_db_version = 'DEMO' ") { | ||
|
||
when { | ||
params { | ||
chocophlan_db_version = 'DEMO' | ||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test(" chocophlan_db_version = 'DEMO' -stub ") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
params { | ||
chocophlan_db_version = 'DEMO' | ||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
modules/local/humann/downloadchocophlandb/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
" chocophlan_db_version = 'DEMO' ": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
"g__Bacteroides.s__Bacteroides_dorei.centroids.v201901_v31.ffn.gz:md5,c23ab47a3f0a34abd20f0b1826482c6d", | ||
"g__Bacteroides.s__Bacteroides_vulgatus.centroids.v201901_v31.ffn.gz:md5,61a2c5aa5ff04e400147974852e5bcc2" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,3d4522d3366acea81c55007726662550" | ||
], | ||
"chocophlan_db_dir": [ | ||
[ | ||
"g__Bacteroides.s__Bacteroides_dorei.centroids.v201901_v31.ffn.gz:md5,c23ab47a3f0a34abd20f0b1826482c6d", | ||
"g__Bacteroides.s__Bacteroides_vulgatus.centroids.v201901_v31.ffn.gz:md5,61a2c5aa5ff04e400147974852e5bcc2" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,3d4522d3366acea81c55007726662550" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-02-16T13:49:34.969434147" | ||
}, | ||
" chocophlan_db_version = 'DEMO' -stub ": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
|
||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,3d4522d3366acea81c55007726662550" | ||
], | ||
"chocophlan_db_dir": [ | ||
[ | ||
|
||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,3d4522d3366acea81c55007726662550" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-02-16T13:49:44.337325581" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
humann/downloadchocophlandb: | ||
- modules/local/humann/downloadchocophlandb/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::humann=3.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
process HUMANN_DOWNLOADUNIREFDB { | ||
tag "${params.uniref_db_version}" | ||
label 'process_single' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/humann:3.8--pyh7cba7a3_0': | ||
'quay.io/biocontainers/humann:3.8--pyh7cba7a3_0' }" | ||
|
||
output: | ||
path "${prefix}/uniref/" , emit: uniref_db_dir | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "uniref_db_${params.uniref_db_version}" | ||
""" | ||
mkdir -p ${prefix} | ||
https_proxy=http://klone-dip1-A-ib:3128 | ||
export https_proxy | ||
humann_databases \\ | ||
--download uniref ${params.uniref_db_version} \\ | ||
${prefix} \\ | ||
$args | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
humann: \$(echo \$(humann --version 2>&1 | sed 's/^.*humann //; s/Using.*\$//' )) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "uniref_db_${params.uniref_db_version}" | ||
""" | ||
mkdir -p ${prefix}/uniref/ | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
humann: \$(echo \$(humann --version 2>&1 | sed 's/^.*humann //; s/Using.*\$//' )) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
process { | ||
withName: HUMANN_DOWNLOADUNIREFDB { | ||
ext.args = "--update-config no" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
nextflow_process { | ||
|
||
name "Test Process: HUMANN_DOWNLOADUNIREFDB" | ||
script "../main.nf" | ||
process "HUMANN_DOWNLOADUNIREFDB" | ||
|
||
tag "modules" | ||
tag "modules_local" | ||
tag "humann" | ||
tag "humann/downloadunirefdb" | ||
|
||
|
||
test(" uniref_db_version = 'DEMO_diamond' ") { | ||
|
||
when { | ||
params { | ||
uniref_db_version = 'DEMO_diamond' | ||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test(" uniref_db_version = 'DEMO_diamond' -stub ") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
params { | ||
uniref_db_version = 'DEMO_diamond' | ||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
modules/local/humann/downloadunirefdb/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
" uniref_db_version = 'DEMO_diamond' ": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
"uniref90_demo_prots_v201901b.dmnd:md5,1d2f8df48a349d72436425aafa29a6b1" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,9701558bc32dc67749aad70c9a67960f" | ||
], | ||
"uniref_db_dir": [ | ||
[ | ||
"uniref90_demo_prots_v201901b.dmnd:md5,1d2f8df48a349d72436425aafa29a6b1" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,9701558bc32dc67749aad70c9a67960f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-02-16T14:04:05.712218097" | ||
}, | ||
" uniref_db_version = 'DEMO_diamond' -stub ": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
|
||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,9701558bc32dc67749aad70c9a67960f" | ||
], | ||
"uniref_db_dir": [ | ||
[ | ||
|
||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,9701558bc32dc67749aad70c9a67960f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-02-16T14:04:13.931593633" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
subworkflows/local/fastq_microbial_pathway_humann/nextflow.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
includeConfig '../../../modules/local/humann/downloadchocophlandb/nextflow.config' | ||
includeConfig '../../../modules/local/humann/downloadunirefdb/nextflow.config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
includeConfig "../../subworkflows/local/fastq_microbial_pathway_humann/nextflow.config" |