-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f21c0f
commit a997ed0
Showing
6 changed files
with
233 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,5 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- bioconda::haplogrep=3.2.2 |
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 HAPLOGREP3_CLASSIFY { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/haplogrep3:3.2.2--hdfd78af_0': | ||
'biocontainers/haplogrep3:3.2.2--hdfd78af_0' }" | ||
|
||
input: | ||
tuple val(meta), path(inputfile) | ||
|
||
output: | ||
tuple val(meta), path("*.txt"), emit: txt | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
haplogrep3 \\ | ||
classify \\ | ||
$args \\ | ||
--in $inputfile \\ | ||
--out ${prefix}.txt | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
haplogrep3: \$(echo \$(haplogrep3 2>&1) | (sed '2!d') | (sed 's/Haplogrep 3 //')) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.txt | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
haplogrep3: \$(echo \$(haplogrep3 2>&1) | (sed '2!d') | (sed 's/Haplogrep 3 //')) | ||
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,45 @@ | ||
name: "haplogrep3_classify" | ||
description: classification into haplogroups | ||
keywords: | ||
- haplogroups | ||
- classify | ||
- mtDNA | ||
tools: | ||
- "haplogrep3": | ||
description: "A tool for mtDNA haplogroup classification." | ||
homepage: "https://github.com/genepi/haplogrep3" | ||
documentation: "https://github.com/genepi/haplogrep3" | ||
tool_dev_url: "https://github.com/genepi/haplogrep3" | ||
licence: ["MIT"] | ||
identifier: "" | ||
input: | ||
- - meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- inputfile: | ||
type: file | ||
description: valid options are hsd, vcf, or fasta files | ||
pattern: "*.{vcf,vcf.gz,fasta,hsd}" | ||
output: | ||
- txt: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- "*.txt": | ||
type: file | ||
description: text file with classification information | ||
pattern: "*.{txt}" | ||
- versions: | ||
- versions.yml: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@lucpen" | ||
maintainers: | ||
- "@lucpen" | ||
- "@ramprasadn" |
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,59 @@ | ||
|
||
nextflow_process { | ||
|
||
name "Test Process HAPLOGREP3_CLASSIFY" | ||
script "../main.nf" | ||
process "HAPLOGREP3_CLASSIFY" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "haplogrep3" | ||
tag "haplogrep3/classify" | ||
|
||
test("test-haplogrep3-classify") { | ||
|
||
config './nextflow.config' | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA12878_chrM.vcf.gz', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("test-haplogrep3-classify-stub") { | ||
|
||
options '-stub' | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA12878_chrM.vcf.gz', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
} |
72 changes: 72 additions & 0 deletions
72
modules/nf-core/haplogrep3/classify/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,72 @@ | ||
{ | ||
"test-haplogrep3-classify-stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,bd62c94d9b52732b89fbd979ded94a60" | ||
], | ||
"txt": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,bd62c94d9b52732b89fbd979ded94a60" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.3" | ||
}, | ||
"timestamp": "2025-01-28T15:34:35.106097277" | ||
}, | ||
"test-haplogrep3-classify": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"test.txt:md5,fb242df629aa6168371d1d742f0fb179" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,bd62c94d9b52732b89fbd979ded94a60" | ||
], | ||
"txt": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"test.txt:md5,fb242df629aa6168371d1d742f0fb179" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,bd62c94d9b52732b89fbd979ded94a60" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.3" | ||
}, | ||
"timestamp": "2025-01-28T15:36:19.954363253" | ||
} | ||
} |
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: HAPLOGREP3_CLASSIFY { | ||
ext.args = '--tree [email protected]' | ||
} | ||
} |