mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
add module for pbptyper (#2005)
* add module for pbptyper * add optional database parameter
This commit is contained in:
parent
940d7fe9d6
commit
a5976c50be
6 changed files with 125 additions and 0 deletions
38
modules/pbptyper/main.nf
Normal file
38
modules/pbptyper/main.nf
Normal 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
52
modules/pbptyper/meta.yml
Normal 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"
|
|
@ -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/**
|
||||||
|
|
13
tests/modules/pbptyper/main.nf
Normal file
13
tests/modules/pbptyper/main.nf
Normal 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, [] )
|
||||||
|
}
|
5
tests/modules/pbptyper/nextflow.config
Normal file
5
tests/modules/pbptyper/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
}
|
13
tests/modules/pbptyper/test.yml
Normal file
13
tests/modules/pbptyper/test.yml
Normal 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
|
Loading…
Reference in a new issue