Merge pull request #1548 from rpetit3/rp3-add-shigatyper

add module for shigatyper
This commit is contained in:
Chris Cheshire 2022-05-03 12:21:43 +01:00 committed by GitHub
commit 1baf143607
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 185 additions and 0 deletions

View file

@ -0,0 +1,64 @@
process SHIGATYPER {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::shigatyper=2.0.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/shigatyper%3A2.0.1--pyhdfd78af_0':
'quay.io/biocontainers/shigatyper:2.0.1--pyhdfd78af_0' }"
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("${prefix}.tsv") , emit: tsv
tuple val(meta), path("${prefix}-hits.tsv"), optional: true, emit: hits
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}"
if (meta.is_ont) {
"""
shigatyper \\
$args \\
--SE $reads \\
--ont \\
--name $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' )
END_VERSIONS
"""
} else if (meta.single_end) {
"""
shigatyper \\
$args \\
--SE $reads \\
--name $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' )
END_VERSIONS
"""
} else {
"""
shigatyper \\
$args \\
--R1 ${reads[0]} \\
--R2 ${reads[1]} \\
--name $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' )
END_VERSIONS
"""
}
}

View file

@ -0,0 +1,47 @@
name: "shigatyper"
description: Determine Shigella serotype from Illumina or Oxford Nanopore reads
keywords:
- fastq
- shigella
- serotype
tools:
- "shigatyper":
description: "Typing tool for Shigella spp. from WGS Illumina sequencing"
homepage: "https://github.com/CFSAN-Biostatistics/shigatyper"
documentation: "https://github.com/CFSAN-Biostatistics/shigatyper"
tool_dev_url: "https://github.com/CFSAN-Biostatistics/shigatyper"
doi: "10.1128/AEM.00165-19"
licence: "['Public Domain']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false, is_ont:false ]
- reads:
type: file
description: Illumina or Nanopore FASTQ file
pattern: "*.fastq.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 TSV formatted file with ShigaTyper results
pattern: "*.tsv"
- hits:
type: file
description: A TSV formatted file with individual gene hits
pattern: "*-hits.tsv"
authors:
- "@rpetit3"

View file

@ -1719,6 +1719,10 @@ seqwish/induce:
- modules/seqwish/induce/** - modules/seqwish/induce/**
- tests/modules/seqwish/induce/** - tests/modules/seqwish/induce/**
shigatyper:
- modules/shigatyper/**
- tests/modules/shigatyper/**
shovill: shovill:
- modules/shovill/** - modules/shovill/**
- tests/modules/shovill/** - tests/modules/shovill/**

View file

@ -0,0 +1,36 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SHIGATYPER } from '../../../modules/shigatyper/main.nf'
workflow test_shigatyper_pe {
input = [
[ id:'test', single_end:false, is_ont:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
SHIGATYPER ( input )
}
workflow test_shigatyper_se {
input = [
[ id:'test', single_end:true, is_ont:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]
]
SHIGATYPER ( input )
}
workflow test_shigatyper_ont {
input = [
[ id:'test', single_end:true, is_ont:true ], // meta map
[ file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) ]
]
SHIGATYPER ( 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: shigatyper test_shigatyper_pe
command: nextflow run tests/modules/shigatyper -entry test_shigatyper_pe -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config
tags:
- shigatyper
files:
- path: output/shigatyper/test.tsv
md5sum: 4f7d38c956993800546b9acb9881d717
- path: output/shigatyper/versions.yml
md5sum: d8ca45ed88dfba9bc570c01e4b49773b
- name: shigatyper test_shigatyper_se
command: nextflow run tests/modules/shigatyper -entry test_shigatyper_se -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config
tags:
- shigatyper
files:
- path: output/shigatyper/test.tsv
md5sum: 4f7d38c956993800546b9acb9881d717
- path: output/shigatyper/versions.yml
md5sum: 8bbf165da5a5df3b7771a33aad197eec
- name: shigatyper test_shigatyper_ont
command: nextflow run tests/modules/shigatyper -entry test_shigatyper_ont -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config
tags:
- shigatyper
files:
- path: output/shigatyper/test.tsv
md5sum: 4f7d38c956993800546b9acb9881d717
- path: output/shigatyper/versions.yml
md5sum: 0da333e1178e9e7e84a9116ad5a5ff71