From 3ef618fed25c5929a065fe775cef3de1f5dc2b60 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Wed, 7 Sep 2022 09:29:28 -0600 Subject: [PATCH] add module for pasty (#2003) * add module for pasty * run prettier * line up those commas * Update main.nf --- modules/pasty/main.nf | 36 ++++++++++++++++++++ modules/pasty/meta.yml | 52 +++++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 +++ tests/modules/pasty/main.nf | 13 ++++++++ tests/modules/pasty/nextflow.config | 5 +++ tests/modules/pasty/test.yml | 11 ++++++ 6 files changed, 121 insertions(+) create mode 100644 modules/pasty/main.nf create mode 100644 modules/pasty/meta.yml create mode 100644 tests/modules/pasty/main.nf create mode 100644 tests/modules/pasty/nextflow.config create mode 100644 tests/modules/pasty/test.yml diff --git a/modules/pasty/main.nf b/modules/pasty/main.nf new file mode 100644 index 00000000..35aec314 --- /dev/null +++ b/modules/pasty/main.nf @@ -0,0 +1,36 @@ +process PASTY { + tag "$meta.id" + label 'process_single' + + conda (params.enable_conda ? "bioconda::pasty=1.0.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pasty:1.0.0--hdfd78af_0': + 'quay.io/biocontainers/pasty:1.0.0--hdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("${prefix}.tsv") , emit: tsv + tuple val(meta), path("${prefix}.blastn.tsv") , emit: blast + tuple val(meta), path("${prefix}.details.tsv"), emit: details + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + pasty \\ + $args \\ + --prefix $prefix \\ + --assembly $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pasty: \$(echo \$(pasty --version 2>&1) | sed 's/^.*pasty, version //;' ) + END_VERSIONS + """ +} diff --git a/modules/pasty/meta.yml b/modules/pasty/meta.yml new file mode 100644 index 00000000..718abf81 --- /dev/null +++ b/modules/pasty/meta.yml @@ -0,0 +1,52 @@ +name: "pasty" +description: Serogroup Pseudomonas aeruginosa assemblies +keywords: + - bacteria + - serogroup + - fasta + - assembly +tools: + - "pasty": + description: "A tool for in silico serogrouping of Pseudomonas aeruginosa isolates" + homepage: "https://github.com/rpetit3/pasty" + documentation: "https://github.com/rpetit3/pasty" + tool_dev_url: "https://github.com/rpetit3/pasty" + doi: "" + licence: "['Apache-2.0']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: An assembly in FASTA format + pattern: "*.{fasta,fasta.gz,fna,fna.gz,fa,fa.gz}" + +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" + - tsv: + type: file + description: A tab-delimited file with the predicted serogroup + pattern: "*.tsv" + - blast: + type: file + description: A tab-delimited file of all blast hits + pattern: "*.blastn.tsv" + - details: + type: file + description: A tab-delimited file with details for each serogroup + pattern: "*.details.tsv" + +authors: + - "@rpetit3" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 62343b70..0b06af4e 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1707,6 +1707,10 @@ paraclu: - modules/paraclu/** - tests/modules/paraclu/** +pasty: + - modules/pasty/** + - tests/modules/pasty/** + pbbam/pbmerge: - modules/pbbam/pbmerge/** - tests/modules/pbbam/pbmerge/** diff --git a/tests/modules/pasty/main.nf b/tests/modules/pasty/main.nf new file mode 100644 index 00000000..2dc5ea98 --- /dev/null +++ b/tests/modules/pasty/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PASTY } from '../../../modules/pasty/main.nf' + +workflow test_pasty { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + PASTY ( input ) +} diff --git a/tests/modules/pasty/nextflow.config b/tests/modules/pasty/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/pasty/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/pasty/test.yml b/tests/modules/pasty/test.yml new file mode 100644 index 00000000..3a4e9b12 --- /dev/null +++ b/tests/modules/pasty/test.yml @@ -0,0 +1,11 @@ +- name: pasty test_pasty + command: nextflow run ./tests/modules/pasty -entry test_pasty -c ./tests/config/nextflow.config -c ./tests/modules/pasty/nextflow.config + tags: + - pasty + files: + - path: output/pasty/test.blastn.tsv + md5sum: 45de2825f0bb3cc8fe9f2b7c419f66f2 + - path: output/pasty/test.details.tsv + md5sum: d6822beea048a27af839087dfc14a536 + - path: output/pasty/test.tsv + md5sum: edbae35d3edc17283ea73f7f3eb22087