diff --git a/modules/hmtnote/main.nf b/modules/hmtnote/main.nf new file mode 100644 index 00000000..a1796924 --- /dev/null +++ b/modules/hmtnote/main.nf @@ -0,0 +1,45 @@ +process HMTNOTE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::hmtnote=0.7.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hmtnote:0.7.2--pyhdfd78af_0': + 'quay.io/biocontainers/hmtnote:0.7.2--pyhdfd78af_0' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*_annotated.vcf"), emit: vcf + 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}" + + """ + hmtnote \\ + annotate \\ + $vcf \\ + ${prefix}_annotated.vcf \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hmtnote: \$(echo \$(hmtnote --version 2>&1) | sed 's/^.*hmtnote, version //; s/Using.*\$//' )) + END_VERSIONS + """ + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_annotated.vcf + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hmtnote: \$(echo \$(hmtnote --version 2>&1) | sed 's/^.*hmtnote, version //; s/Using.*\$//' )) + END_VERSIONS + """ +} diff --git a/modules/hmtnote/meta.yml b/modules/hmtnote/meta.yml new file mode 100644 index 00000000..92b4be1b --- /dev/null +++ b/modules/hmtnote/meta.yml @@ -0,0 +1,39 @@ +name: hmtnote +description: Human mitochondrial variants annotation using HmtVar. +keywords: + - hmtnote mitochondria annotation +tools: + - hmtnote: + description: Human mitochondrial variants annotation using HmtVar. + homepage: https://github.com/robertopreste/HmtNote + documentation: https://hmtnote.readthedocs.io/en/latest/usage.html + tool_dev_url: None + doi: "https://doi.org/10.1101/600619" + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + - vcf: + type: file + description: vcf file + pattern: "*.vcf" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - vcf: + type: file + description: annotated vcf + pattern: "*_annotated.vcf" + +authors: + - "@sysbiocoder" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 59ab6df0..142e9d41 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -966,6 +966,10 @@ hmmer/hmmsearch: - modules/hmmer/hmmsearch/** - tests/modules/hmmer/hmmsearch/** +hmtnote: + - modules/hmtnote/** + - tests/modules/hmtnote/** + homer/annotatepeaks: - modules/homer/annotatepeaks/** - tests/modules/homer/annotatepeaks/** diff --git a/tests/modules/hmtnote/main.nf b/tests/modules/hmtnote/main.nf new file mode 100644 index 00000000..9bee719c --- /dev/null +++ b/tests/modules/hmtnote/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HMTNOTE } from '../../../modules/hmtnote/main.nf' + +workflow test_hmtnote { + + input = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + ] + + HMTNOTE ( input) +} diff --git a/tests/modules/hmtnote/nextflow.config b/tests/modules/hmtnote/nextflow.config new file mode 100644 index 00000000..abd2c8e6 --- /dev/null +++ b/tests/modules/hmtnote/nextflow.config @@ -0,0 +1,7 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + withName: HMTNOTE { + ext.args = '--basic --variab' + } +} diff --git a/tests/modules/hmtnote/test.yml b/tests/modules/hmtnote/test.yml new file mode 100644 index 00000000..10b7225f --- /dev/null +++ b/tests/modules/hmtnote/test.yml @@ -0,0 +1,6 @@ +- name: hmtnote test_hmtnote + command: nextflow run ./tests/modules/hmtnote -entry test_hmtnote -c ./tests/config/nextflow.config -c ./tests/modules/hmtnote/nextflow.config + tags: + - hmtnote + files: + - path: output/hmtnote/test_annotated.vcf