Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

375 add spa type analysis to nanopore track #395

Merged
merged 12 commits into from
Feb 19, 2025
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added module `sccmec` for typing of SCCmec cassettes in assemblies of Staphylococcus species
- Added `when` operators to all modules that aren't in `bacterial_base.nf`
- Added additional arguments for Resfinder when analysing Nanopore data
- Added module `spatyper` for typing of Spa gene in Staphylococcus aureus

### Fixed

Expand Down
6 changes: 6 additions & 0 deletions configs/nextflow.base.config
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/spades_iontorrent", mode: 'copy', overwrite: true ]
ext.args = "--iontorrent --careful --sc"
}
withName: spatyper {
cpus = 2
memory = '2.GB'
container = "${params.containerDir}/spatyper.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/spatyper", mode: 'copy', overwrite: true ]
}
withName: tbprofiler_mergedb {
cpus = 16
memory = '12.GB'
Expand Down
6 changes: 6 additions & 0 deletions configs/nextflow.ci.config
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,12 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/spades_iontorrent", mode: 'copy', overwrite: true ]
ext.args = "--iontorrent --careful --sc"
}
withName: spatyper {
cpus = 2
memory = '2.GB'
container = "${params.containerDir}/spatyper.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/spatyper", mode: 'copy', overwrite: true ]
}
withName: tbprofiler_mergedb {
cpus = 4
memory = '12.GB'
Expand Down
6 changes: 6 additions & 0 deletions configs/nextflow.cmd.config
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/spades_iontorrent", mode: 'copy', overwrite: true ]
ext.args = "--iontorrent --careful --sc"
}
withName: spatyper {
cpus = 2
memory = '2.GB'
container = "https://depot.galaxyproject.org/singularity/spatyper:0.3.3--pyhdfd78af_3"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/spatyper", mode: 'copy', overwrite: true ]
}
withName: tbprofiler_mergedb {
cpus = 16
memory = '12.GB'
Expand Down
6 changes: 6 additions & 0 deletions configs/nextflow.ngp.config
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,12 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/spades_iontorrent", mode: 'copy', overwrite: true ]
ext.args = "--iontorrent --careful --sc"
}
withName: spatyper {
cpus = 2
memory = '2.GB'
container = "${params.containerDir}/spatyper.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/spatyper", mode: 'copy', overwrite: true ]
}
withName: tbprofiler_mergedb {
cpus = params.cpus_large
memory = params.mem_medium
Expand Down
2 changes: 2 additions & 0 deletions container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ remote_containers := ncbi-amrfinderplus.sif \
snippy.sif \
sourmash.sif \
spades.sif \
spatyper.sif \
tb-profiler.sif \
virulencefinder.sif

Expand Down Expand Up @@ -82,6 +83,7 @@ URL_skesa := https://depot.galaxyproject.org/singularity/skesa:2.5.1--hdcf5f25_0
URL_snippy := https://depot.galaxyproject.org/singularity/snippy:4.6.0--hdfd78af_2
URL_sourmash := https://depot.galaxyproject.org/singularity/sourmash:4.8.2--hdfd78af_0
URL_spades := https://depot.galaxyproject.org/singularity/spades:3.15.5--h95f258a_1
URL_spatyper := https://depot.galaxyproject.org/singularity/spatyper:0.3.3--pyhdfd78af_3
URL_tb-profiler := https://depot.galaxyproject.org/singularity/tb-profiler:6.3.0--pyhdfd78af_0
URL_virulencefinder := https://depot.galaxyproject.org/singularity/virulencefinder:2.0.4--hdfd78af_1

Expand Down
42 changes: 42 additions & 0 deletions nextflow-modules/modules/spatyper/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
process spatyper {
tag "${sample_id}"
scratch params.scratch

input:
tuple val(sample_id), path(reads), val(platform)
tuple val(sample_id), path(assembly)

output:
tuple val(sample_id), path(output), emit: tsv
path "*versions.yml" , emit: versions

when:
platform == "nanopore"

script:
def args = task.ext.args ?: ''
output = "${sample_id}_spatyper.tsv"
"""
spaTyper -f ${assembly} --output ${output} ${args}

cat <<-END_VERSIONS > ${sample_id}_${task.process}_versions.yml
${task.process}:
spatyper:
version: \$(echo \$(spaTyper --version 2>&1) | sed 's/spaTyper //p')
container: ${task.container}
END_VERSIONS
"""

stub:
output = "${sample_id}_spatyper.tsv"
"""
touch ${output}

cat <<-END_VERSIONS > ${sample_id}_${task.process}_versions.yml
${task.process}:
spatyper:
version: \$(echo \$(spatyper --version 2>&1) | sed 's/spaTyper //p')
container: ${task.container}
END_VERSIONS
"""
}
3 changes: 3 additions & 0 deletions workflows/staphylococcus_aureus.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ include { mlst } from '../nextflow-modules/
include { resfinder } from '../nextflow-modules/modules/resfinder/main.nf'
include { samtools_index as samtools_index_assembly } from '../nextflow-modules/modules/samtools/main.nf'
include { sccmec } from '../nextflow-modules/modules/sccmec/main.nf'
include { spatyper } from '../nextflow-modules/modules/spatyper/main.nf'
include { virulencefinder } from '../nextflow-modules/modules/virulencefinder/main.nf'
include { CALL_BACTERIAL_BASE } from '../workflows/bacterial_base.nf'

Expand Down Expand Up @@ -93,6 +94,7 @@ workflow CALL_STAPHYLOCOCCUS_AUREUS {
// TYPING
mlst(ch_assembly, params.mlstScheme, pubMlstDb, mlstBlastDb)
sccmec(ch_assembly)
spatyper(ch_input_meta, ch_assembly)

mask_polymorph_assembly.out.fasta
.multiMap { sampleID, filePath ->
Expand Down Expand Up @@ -173,6 +175,7 @@ workflow CALL_STAPHYLOCOCCUS_AUREUS {
ch_versions = ch_versions.mix(resfinder.out.versions)
ch_versions = ch_versions.mix(samtools_index_assembly.out.versions)
ch_versions = ch_versions.mix(sccmec.out.versions)
ch_versions = ch_versions.mix(spatyper.out.versions)
ch_versions = ch_versions.mix(virulencefinder.out.versions)

emit:
Expand Down
Loading