Skip to content

Commit

Permalink
375 add spa type analysis to nanopore track (#395)
Browse files Browse the repository at this point in the history
* add spa module to Makefile

* add spatyper to S.aureus workflow

* add spatyper to all configs

* edit changelog

* add spatyper module

* inlude meatdata as input to spatyper

* Add computational resources to spatyper

* join input channels for spatyper

* remove platform dependancy and add species dependancy

---------

Co-authored-by: ryanjameskennedy <[email protected]>
Co-authored-by: Ryan James Kennedy <[email protected]>
  • Loading branch information
3 people authored Feb 19, 2025
1 parent 22b1de0 commit 922fe79
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added additional arguments for Resfinder when analysing Nanopore data
- Added downloading of hostile index to `Makefile`
- Added sw docs for `kpneumonia`, `spyogenes`, & `streptococcus`
- Added module `spatyper` for typing of Spa gene in Staphylococcus aureus

### Fixed

Expand Down
7 changes: 7 additions & 0 deletions configs/nextflow.base.config
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@ 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 ]
ext.when = { params.species == "staphylococcus aureus" }
}
withName: tbprofiler_mergedb {
cpus = 16
memory = '12.GB'
Expand Down
7 changes: 7 additions & 0 deletions configs/nextflow.ci.config
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@ 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 ]
ext.when = { params.species == "staphylococcus aureus" }
}
withName: tbprofiler_mergedb {
cpus = 4
memory = '12.GB'
Expand Down
7 changes: 7 additions & 0 deletions configs/nextflow.cmd.config
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,13 @@ 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 ]
ext.when = { params.species == "staphylococcus aureus" }
}
withName: tbprofiler_mergedb {
cpus = 16
memory = '12.GB'
Expand Down
7 changes: 7 additions & 0 deletions configs/nextflow.ngp.config
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,13 @@ 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 ]
ext.when = { params.species == "staphylococcus aureus" }
}
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
41 changes: 41 additions & 0 deletions nextflow-modules/modules/spatyper/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
process spatyper {
tag "${sample_id}"
scratch params.scratch

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

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

when:
task.ext.when

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_assembly.join(ch_seqplat_meta))

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

0 comments on commit 922fe79

Please sign in to comment.