diff --git a/modules/gamma/main.nf b/modules/gamma/main.nf new file mode 100644 index 00000000..e176ee68 --- /dev/null +++ b/modules/gamma/main.nf @@ -0,0 +1,41 @@ +def VERSION = '2.1' // Version information not provided by tool on CLI + +process GAMMA { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gamma=2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gamma%3A2.1--hdfd78af_0': + 'quay.io/biocontainers/gamma:2.1--hdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + path(db) + + output: + tuple val(meta), path("*.gamma") , emit: gamma + tuple val(meta), path("*.psl") , emit: psl + tuple val(meta), path("*.gff") , optional:true , emit: gff + tuple val(meta), path("*.fasta"), optional:true , emit: fasta + 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}" + """ + GAMMA.py \\ + $args \\ + $fasta \\ + $db \\ + $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gamma: $VERSION + END_VERSIONS + """ +} diff --git a/modules/gamma/meta.yml b/modules/gamma/meta.yml new file mode 100644 index 00000000..316b685b --- /dev/null +++ b/modules/gamma/meta.yml @@ -0,0 +1,63 @@ +name: "gamma" +description: Gene Allele Mutation Microbial Assessment +keywords: + - gamma + - gene-calling +tools: + - "gamma": + description: "Tool for Gene Allele Mutation Microbial Assessment" + homepage: "https://github.com/rastanton/GAMMA" + documentation: "https://github.com/rastanton/GAMMA" + tool_dev_url: "https://github.com/rastanton/GAMMA" + doi: "10.1093/bioinformatics/btab607" + licence: "['Apache License 2.0']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: FASTA file + pattern: "*.{fa,fasta}" + - db: + type: file + description: Database in FASTA format + pattern: "*.{fa,fasta}" + +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" + + - gamma: + type: file + description: GAMMA file with annotated gene matches + pattern: "*.{gamma}" + + - psl: + type: file + description: PSL file with all gene matches found + pattern: "*.{psl}" + + - gff: + type: file + description: GFF file + pattern: "*.{gff}" + + - fasta: + type: file + description: multifasta file of the gene matches + pattern: "*.{fasta}" + +authors: + - "@sateeshperi" + - "@rastanton" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a1a969e7..263e83a8 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -675,6 +675,10 @@ freebayes: - modules/freebayes/** - tests/modules/freebayes/** +gamma: + - modules/gamma/** + - tests/modules/gamma/** + gatk4/applybqsr: - modules/gatk4/applybqsr/** - tests/modules/gatk4/applybqsr/** diff --git a/tests/modules/gamma/main.nf b/tests/modules/gamma/main.nf new file mode 100644 index 00000000..f9477706 --- /dev/null +++ b/tests/modules/gamma/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GAMMA } from '../../../modules/gamma/main.nf' + +workflow test_gamma { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + + db = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + + GAMMA ( input, db ) +} diff --git a/tests/modules/gamma/nextflow.config b/tests/modules/gamma/nextflow.config new file mode 100644 index 00000000..bbbf4de0 --- /dev/null +++ b/tests/modules/gamma/nextflow.config @@ -0,0 +1,7 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + ext.args = '--fasta' + +} diff --git a/tests/modules/gamma/test.yml b/tests/modules/gamma/test.yml new file mode 100644 index 00000000..1b493b49 --- /dev/null +++ b/tests/modules/gamma/test.yml @@ -0,0 +1,13 @@ +- name: gamma test_gamma + command: nextflow run tests/modules/gamma -entry test_gamma -c tests/config/nextflow.config + tags: + - gamma + files: + - path: output/gamma/test.fasta + md5sum: df37b48466181311e0a679f3c5878484 + - path: output/gamma/test.gamma + md5sum: 3256708fa517a65ed01d99e0e3c762ae + - path: output/gamma/test.psl + md5sum: 162a2757ed3b167ae1e0cdb24213f940 + - path: output/gamma/versions.yml + md5sum: 3fefb5b46c94993362243c5f9a472057