adding srst2 module

This commit is contained in:
jvhagey 2022-04-27 18:01:28 -04:00
parent 6a46e7cf11
commit 839ee59ca1
6 changed files with 181 additions and 0 deletions

View file

@ -0,0 +1,47 @@
process SRST2_SRST2 {
tag "${meta.id}"
label 'process_low'
conda (params.enable_conda ? "bioconda::srst2=0.2.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/srst2%3A0.2.0--py_4':
'quay.io/biocontainers/srst2:0.2.0--py_4'}"
input:
tuple val(meta), path(fastq_s), path(db)
output:
tuple val(meta), path("*_genes_*_results.txt") , emit: gene_results
tuple val(meta), path("*_fullgenes_*_results.txt") , optional:true, emit: fullgene_results
tuple val(meta), path("*.pileup") , emit: pileup
tuple val(meta), path("*.sorted.bam") , emit: sorted_bam
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}"
def read_s = meta.single_end ? "--input_se ${fastq_s}" : "--input_pe ${fastq_s[0]} ${fastq_s[1]}"
if (meta.db=="gene") {
database = "--gene_db ${db}"
} else if (meta.db=="mlst") {
database = "--mlst_db ${db}"
} else {
return
}
"""
srst2 \\
${read_s} \\
--threads $task.cpus \\
--output ${prefix} \\
${database} \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
srst2: \$(echo \$(srst2 --version 2>&1) | sed 's/srst2 //' ))
END_VERSIONS
"""
}

View file

@ -0,0 +1,68 @@
name: srst2_srst2
description: |
Short Read Sequence Typing for Bacterial Pathogens is a program designed to take Illumina sequence data,
a MLST database and/or a database of gene sequences (e.g. resistance genes, virulence genes, etc)
and report the presence of STs and/or reference genes.
keywords:
- mlst
- typing
- illumina
tools:
- srst2:
description: "Short Read Sequence Typing for Bacterial Pathogens"
homepage: {http://katholt.github.io/srst2/}
documentation: {https://github.com/katholt/srst2/blob/master/README.md}
tool_dev_url: {https://github.com/katholt/srst2}
doi: ""
licence: ['BSD']
input:
- meta:
type: map0.2.0-4
description: |
Groovy Map containing sample information
id: should be the identification number or sample name
single_end: should be true for single end data and false for paired in data
db: should be either 'gene' to use the --gene_db option or "mlst" to use the --mlst_db option
e.g. [ id:'sample', single_end:false , db:'gene']
- fasta:
type: file
description: |
gzipped fasta file. If files are NOT in
MiSeq format sample_S1_L001_R1_001.fastq.gz uses --forward and --reverse parameters; otherwise
default is _1, i.e. expect forward reads as sample_1.fastq.gz).
pattern: "*.fastq.gz"
- db:
type: file
description: Database in FASTA format
pattern: "*.fasta"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'sample', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- txt:
type: file
description: results text file
pattern: "*_fullgenes_*_results.txt"
- txt:
type: file
description: results text file
pattern: "*_genes_*_results.txt"
- bam:
type: file
description: Sorted BAM file
pattern: "*.sorted.bam"
- pileup:
type: file
description: SAMtools pileup file
pattern: "*.pileup"
authors:
- "@jvhagey"

View file

@ -1767,6 +1767,10 @@ sratools/prefetch:
- modules/sratools/prefetch/**
- tests/modules/sratools/prefetch/**
srst2/srst2:
- modules/srst2/srst2/**
- tests/modules/srst2/srst2/**
ssuissero:
- modules/ssuissero/**
- tests/modules/ssuissero/**

View file

@ -0,0 +1,28 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SRST2_SRST2 } from '../../../../modules/srst2/srst2/main.nf'
workflow test_srst2_srst2_paired_end {
input = [
[ id:'test', single_end:false, db:"gene"], // meta map
[ file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true),
file(params.test_data['bacteroides_fragilis']['illumina']['test1_2_fastq_gz'], checkIfExists: true) ],
file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/resFinder_20180221_srst2.fasta') // Change to params.test_data syntax after the data is included in tests/config/test_data.config
]
SRST2_SRST2(input)
}
workflow test_srst2_srst2_single_end {
input = [
[ id:'test', single_end:true, db:"gene" ], // meta map
file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true),
file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/srst2/resFinder_20180221_srst2.fasta') // Change to params.test_data syntax after the data is included in tests/config/test_data.config
]
SRST2_SRST2(input)
}

View file

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

View file

@ -0,0 +1,29 @@
- name: srst2 srst2 test_srst2_srst2_paired_end
command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_paired_end -c tests/config/nextflow.config
tags:
- srst2/srst2
- srst2
files:
- path: /tmp/tmp03v2z3fu/srst2/test__genes__resFinder_20180221_srst2__results.txt
md5sum: 099aa6cacec5524b311f606debdfb3a9
- path: /tmp/tmp03v2z3fu/srst2/test__test1.resFinder_20180221_srst2.pileup
md5sum: 64b512ff495b828c456405ec7b676ad1
- path: /tmp/tmp03v2z3fu/srst2/test__test1.resFinder_20180221_srst2.sorted.bam
- path: /tmp/tmp03v2z3fu/srst2/versions.yml
md5sum: b446a70f1a2b4f60757829bcd744a214
- name: srst2 srst2 test_srst2_srst2_single_end
command: nextflow run tests/modules/srst2/srst2 -entry test_srst2_srst2_single_end -c tests/config/nextflow.config
tags:
- srst2/srst2
- srst2
files:
- path: /tmp/tmp3kabyta4/srst2/test__fullgenes__resFinder_20180221_srst2__results.txt
md5sum: d0762ef8c38afd0e0a34cce52ed1a3db
- path: /tmp/tmp3kabyta4/srst2/test__genes__resFinder_20180221_srst2__results.txt
md5sum: b8850c6644406d8b131e471ecc3f9013
- path: /tmp/tmp3kabyta4/srst2/test__test1_1.resFinder_20180221_srst2.pileup
md5sum: 5f6279dc8124aa762a9dfe3d7a871277
- path: /tmp/tmp3kabyta4/srst2/test__test1_1.resFinder_20180221_srst2.sorted.bam
- path: /tmp/tmp3kabyta4/srst2/versions.yml
md5sum: 790fe00493c6634d17801a930073218b