mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-14 05:43:08 +00:00
Add haplogrep2 (#2030)
* feat added haplogrep classify * feat made module * fix added correct container * feat removed md5sum * fix trying to fix issue with version.yml * fix some small things * fix version * fix on meta.yml * fix stub run * fix Apply suggestions from code review Co-authored-by: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> * fix Apply suggestions from code review2 Co-authored-by: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Co-authored-by: Taniguti <ltaniguti@gmail.com> Co-authored-by: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
This commit is contained in:
parent
393dbd6dda
commit
cad9133c71
6 changed files with 134 additions and 0 deletions
49
modules/haplogrep2/classify/main.nf
Normal file
49
modules/haplogrep2/classify/main.nf
Normal file
|
@ -0,0 +1,49 @@
|
|||
process HAPLOGREP2_CLASSIFY {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::haplogrep=2.4.0" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/haplogrep:2.4.0--hdfd78af_0':
|
||||
'quay.io/biocontainers/haplogrep:2.4.0--hdfd78af_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(inputfile)
|
||||
val(format)
|
||||
|
||||
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}"
|
||||
"""
|
||||
haplogrep \\
|
||||
classify \\
|
||||
$args \\
|
||||
--in $inputfile \\
|
||||
--out ${prefix}.txt \\
|
||||
--format $format
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
haplogrep2: \$(echo \$(haplogrep --version 2>&1) | (sed 's/htt.*//') | (sed 's/.*v//'))
|
||||
END_VERSIONS
|
||||
"""
|
||||
|
||||
stub:
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
"""
|
||||
touch ${prefix}.txt
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
haplogrep2: \$(echo \$(haplogrep --version 2>&1) | (sed 's/htt.*//') | (sed 's/.*v//'))
|
||||
END_VERSIONS
|
||||
"""
|
||||
|
||||
}
|
43
modules/haplogrep2/classify/meta.yml
Normal file
43
modules/haplogrep2/classify/meta.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
name: "haplogrep2_classify"
|
||||
description: classification into haplogroups
|
||||
keywords:
|
||||
- haplogroups.
|
||||
tools:
|
||||
- "haplogrep2":
|
||||
description: "A tool for mtDNA haplogroup classification."
|
||||
homepage: "https://github.com/seppinho/haplogrep-cmd"
|
||||
documentation: "https://github.com/seppinho/haplogrep-cmd"
|
||||
tool_dev_url: "https://github.com/seppinho/haplogrep-cmd"
|
||||
doi: ""
|
||||
licence: "['MIT']"
|
||||
|
||||
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}"
|
||||
- format:
|
||||
type: stringformat of file either vcf fasta or hsd
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
- txt:
|
||||
type: file
|
||||
description: text file with classification information
|
||||
pattern: "*.{txt}"
|
||||
|
||||
authors:
|
||||
- "@lucpen"
|
|
@ -1139,6 +1139,10 @@ haplocheck:
|
|||
- modules/haplocheck/**
|
||||
- tests/modules/haplocheck/**
|
||||
|
||||
haplogrep2/classify:
|
||||
- modules/haplogrep2/classify/**
|
||||
- tests/modules/haplogrep2/classify/**
|
||||
|
||||
happy/happy:
|
||||
- modules/happy/happy/**
|
||||
- tests/modules/happy/happy/**
|
||||
|
|
16
tests/modules/haplogrep2/classify/main.nf
Normal file
16
tests/modules/haplogrep2/classify/main.nf
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { HAPLOGREP2_CLASSIFY } from '../../../../modules/haplogrep2/classify/main.nf'
|
||||
|
||||
workflow test_haplogrep2_classify {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_mito_vcf'], checkIfExists: true)
|
||||
]
|
||||
format = 'vcf'
|
||||
|
||||
HAPLOGREP2_CLASSIFY ( input,format )
|
||||
}
|
5
tests/modules/haplogrep2/classify/nextflow.config
Normal file
5
tests/modules/haplogrep2/classify/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
17
tests/modules/haplogrep2/classify/test.yml
Normal file
17
tests/modules/haplogrep2/classify/test.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
- name: haplogrep2 classify
|
||||
command: nextflow run ./tests/modules/haplogrep2/classify -entry test_haplogrep2_classify -c ./tests/config/nextflow.config -c ./tests/modules/haplogrep2/classify/nextflow.config
|
||||
tags:
|
||||
- haplogrep2
|
||||
- haplogrep2/classify
|
||||
files:
|
||||
- path: output/haplogrep2/test.txt
|
||||
- path: output/haplogrep2/versions.yml
|
||||
|
||||
- name: haplogrep2 classify stubs
|
||||
command: nextflow run ./tests/modules/haplogrep2/classify -stub-run -entry test_haplogrep2_classify -c ./tests/config/nextflow.config -c ./tests/modules/haplogrep2/classify/nextflow.config
|
||||
tags:
|
||||
- haplogrep2
|
||||
- haplogrep2/classify
|
||||
files:
|
||||
- path: output/haplogrep2/test.txt
|
||||
- path: output/haplogrep2/versions.yml
|
Loading…
Reference in a new issue