Skip to content

Commit

Permalink
add module for stecfinder (nf-core#2702)
Browse files Browse the repository at this point in the history
* add module for stecfinder

* make prettier

* Update modules/nf-core/stecfinder/main.nf

---------

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
  • Loading branch information
2 people authored and Leon Rauschning committed Oct 16, 2023
1 parent 8bda146 commit 1abd72c
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 0 deletions.
34 changes: 34 additions & 0 deletions modules/nf-core/stecfinder/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
process STECFINDER {
tag "$meta.id"
label 'process_low'

conda "bioconda::stecfinder=1.1.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/stecfinder:1.1.0--pyhdfd78af_0':
'biocontainers/stecfinder:1.1.0--pyhdfd78af_0' }"

input:
tuple val(meta), path(seqs)

output:
tuple val(meta), path("*.tsv"), emit: tsv
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}"
"""
stecfinder \\
-i $seqs \\
$args \\
-t $task.cpus > ${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
stecfinder: \$(echo \$(stecfinder --version 2>&1) | sed 's/^.*STECFinder version: //;' )
END_VERSIONS
"""
}
44 changes: 44 additions & 0 deletions modules/nf-core/stecfinder/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "stecfinder"
description: Serotype STEC samples from paired-end reads or assemblies
keywords:
- serotype
- Escherichia coli
- fastq
- fasta
tools:
- "stecfinder":
description: "Cluster informed Shigatoxin producing E. coli (STEC) serotyping tool from Illumina reads and assemblies"
homepage: "https://github.com/LanLab/STECFinder"
documentation: "https://github.com/LanLab/STECFinder"
tool_dev_url: "https://github.com/LanLab/STECFinder"
doi: "10.3389/fcimb.2021.772574"
licence: "['GPL v3']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- seqs:
type: file
description: Illumina paired-end reads or an assembly
pattern: "*.{fastq.gz,fasta.gz,fna.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 report of results
pattern: "*.tsv"

authors:
- "@rpetit3"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3732,6 +3732,10 @@ star/starsolo:
- modules/nf-core/star/starsolo/**
- tests/modules/nf-core/star/starsolo/**

stecfinder:
- modules/nf-core/stecfinder/**
- tests/modules/nf-core/stecfinder/**

stitch:
- modules/nf-core/stitch/**
- tests/modules/nf-core/stitch/**
Expand Down
27 changes: 27 additions & 0 deletions tests/modules/nf-core/stecfinder/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { STECFINDER } from '../../../../modules/nf-core/stecfinder/main.nf'
include { STECFINDER as STECFINDER_READS } from '../../../../modules/nf-core/stecfinder/main.nf'

workflow test_stecfinder_fasta {

input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]

STECFINDER ( input )
}

workflow test_stecfinder_reads {

input = [
[ id:'test', single_end: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) ],
]

STECFINDER_READS ( input )
}
9 changes: 9 additions & 0 deletions tests/modules/nf-core/stecfinder/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
process {

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

withName: STECFINDER_READS {
ext.args = '-r'
}

}
17 changes: 17 additions & 0 deletions tests/modules/nf-core/stecfinder/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- name: stecfinder test_stecfinder_fasta
command: nextflow run ./tests/modules/nf-core/stecfinder -entry test_stecfinder_fasta -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/stecfinder/nextflow.config
tags:
- stecfinder
files:
- path: output/stecfinder/test.tsv
md5sum: c17e1e69728b48c06c47a7d10086f1da
- path: output/stecfinder/versions.yml

- name: stecfinder test_stecfinder_reads
command: nextflow run ./tests/modules/nf-core/stecfinder -entry test_stecfinder_reads -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/stecfinder/nextflow.config
tags:
- stecfinder
files:
- path: output/stecfinder/test.tsv
md5sum: f0a5c4e3509bc8bd03f09aa21c31c526
- path: output/stecfinder/versions.yml

0 comments on commit 1abd72c

Please sign in to comment.