add module for pbptyper (#2005)

* add module for pbptyper

* add optional database parameter
This commit is contained in:
Robert A. Petit III 2022-09-07 15:29:03 -06:00 committed by GitHub
parent 940d7fe9d6
commit a5976c50be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 125 additions and 0 deletions

38
modules/pbptyper/main.nf Normal file
View file

@ -0,0 +1,38 @@
process PBPTYPER {
tag "$meta.id"
label 'process_single'
conda (params.enable_conda ? "bioconda::pbptyper=1.0.2" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/pbptyper:1.0.2--hdfd78af_0':
'quay.io/biocontainers/pbptyper:1.0.2--hdfd78af_0' }"
input:
tuple val(meta), path(fasta)
path(db)
output:
tuple val(meta), path("${prefix}.tsv"), emit: tsv
tuple val(meta), path("*.tblastn.tsv"), emit: blast
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def db_args = db ? '--db ${db}' : ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
pbptyper \\
$db_args \\
$args \\
--prefix $prefix \\
--assembly $fasta
cat <<-END_VERSIONS > versions.yml
"${task.process}":
pbptyper: \$(echo \$(pbptyper --version 2>&1) | sed 's/^.*pbptyper, version //;' )
END_VERSIONS
"""
}

52
modules/pbptyper/meta.yml Normal file
View file

@ -0,0 +1,52 @@
name: "pbptyper"
description: Assign PBP type of Streptococcus pneumoniae assemblies
keywords:
- bacteria
- pbp
- fasta
- assembly
tools:
- "pbptyper":
description: "In silico Penicillin Binding Protein (PBP) typer for Streptococcus pneumoniae assemblies"
homepage: "https://github.com/rpetit3/pbptyper"
documentation: "https://github.com/rpetit3/pbptyper"
tool_dev_url: "https://github.com/rpetit3/pbptyper"
doi: ""
licence: "['MIT']"
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}"
- db:
type: file
description: A reference PBP database (optional)
pattern: "*.{fasta,fna,fa}"
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 PBP type
pattern: "*.tsv"
- blast:
type: file
description: A tab-delimited file of all blast hits
pattern: "*.tblastn.tsv"
authors:
- "@rpetit3"

View file

@ -1723,6 +1723,10 @@ pbccs:
- modules/pbccs/** - modules/pbccs/**
- tests/modules/pbccs/** - tests/modules/pbccs/**
pbptyper:
- modules/pbptyper/**
- tests/modules/pbptyper/**
pear: pear:
- modules/pear/** - modules/pear/**
- tests/modules/pear/** - tests/modules/pear/**

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { PBPTYPER } from '../../../modules/pbptyper/main.nf'
workflow test_pbptyper {
input = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]
PBPTYPER ( input, [] )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,13 @@
- name: pbptyper test_pbptyper
command: nextflow run ./tests/modules/pbptyper -entry test_pbptyper -c ./tests/config/nextflow.config -c ./tests/modules/pbptyper/nextflow.config
tags:
- pbptyper
files:
- path: output/pbptyper/test-1A.tblastn.tsv
md5sum: 16bb26284bd7bf2327337fc95c055429
- path: output/pbptyper/test-2B.tblastn.tsv
md5sum: 16bb26284bd7bf2327337fc95c055429
- path: output/pbptyper/test-2X.tblastn.tsv
md5sum: 16bb26284bd7bf2327337fc95c055429
- path: output/pbptyper/test.tsv
md5sum: 7115fb3533ee30f0a7dde61a42f69185