diff --git a/modules/gfaffix/main.nf b/modules/gfaffix/main.nf new file mode 100644 index 00000000..3ae5ad66 --- /dev/null +++ b/modules/gfaffix/main.nf @@ -0,0 +1,36 @@ +process GFAFFIX { + tag "$meta.id" + label 'process_single' + + conda (params.enable_conda ? 'bioconda::gfaffix=0.1.4' : null) + + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gfaffix:0.1.4--hec16e2b_0' : + 'quay.io/biocontainers/gfaffix:0.1.4--hec16e2b_0' }" + + input: + tuple val(meta), path(gfa) + + output: + tuple val(meta), path("*.gfa"), emit: gfa + tuple val(meta), path("*.txt"), emit: affixes + 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}" + """ + gfaffix \\ + $args \\ + $gfa \\ + -o ${prefix}.gfaffix.gfa > ${prefix}.affixes.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gfaffix: \$(gfaffix --version 2>&1 | grep -o 'gfaffix .*' | cut -f2 -d ' ') + END_VERSIONS + """ +} diff --git a/modules/gfaffix/meta.yml b/modules/gfaffix/meta.yml new file mode 100644 index 00000000..0c3924a3 --- /dev/null +++ b/modules/gfaffix/meta.yml @@ -0,0 +1,46 @@ +name: gfaffix +description: Collapse walk-preserving shared affixes in variation graphs in GFA format +keywords: + - gfa + - graph + - pangenome + - variation graph +tools: + - gfaffix: + description: | + GFAffix identifies walk-preserving shared affixes in variation graphs and + collapses them into a non-redundant graph structure. + homepage: https://github.com/marschall-lab/GFAffix + documentation: https://github.com/marschall-lab/GFAffix + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - gfa: + type: file + description: Variation graph in GFA format + pattern: "*.{gfa}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - gfa: + type: file + description: Non-redundant variation graph in GFA 1.0 format + pattern: "*.{gfa}" + - affixes: + type: file + description: Shared affixes in tab-separated values (TSV) text format + pattern: "*.{txt}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@heuermh" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 99df6ba1..ec981331 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1087,6 +1087,10 @@ genrich: - modules/genrich/** - tests/modules/genrich/** +gfaffix: + - modules/gfaffix/** + - tests/modules/gfaffix/** + gffread: - modules/gffread/** - tests/modules/gffread/** diff --git a/tests/modules/gfaffix/main.nf b/tests/modules/gfaffix/main.nf new file mode 100644 index 00000000..333866c0 --- /dev/null +++ b/tests/modules/gfaffix/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GFAFFIX } from '../../../modules/gfaffix/main.nf' + +workflow test_gfaffix { + input = [ [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['assembly_gfa'], checkIfExists: true)] + ] + + GFAFFIX ( input ) +} diff --git a/tests/modules/gfaffix/nextflow.config b/tests/modules/gfaffix/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gfaffix/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gfaffix/test.yml b/tests/modules/gfaffix/test.yml new file mode 100644 index 00000000..d88db7c6 --- /dev/null +++ b/tests/modules/gfaffix/test.yml @@ -0,0 +1,9 @@ +- name: gfaffix + command: nextflow run ./tests/modules/gfaffix -entry test_gfaffix -c ./tests/config/nextflow.config -c ./tests/modules/gfaffix/nextflow.config + tags: + - gfaffix + files: + - path: output/gfaffix/test.gfaffix.gfa + md5sum: 7b51abeeab7706393957fcb66d31704a + - path: output/gfaffix/test.affixes.txt + md5sum: c3540baa386462552d7ebe4e4b7eda6a