Skip to content

Commit

Permalink
reintegrated shigeifinder
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheww95 committed Oct 20, 2023
1 parent 7747dbb commit bdef066
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 62 deletions.
67 changes: 33 additions & 34 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,16 @@ process {
]
}

withName: SHIGATYPER {
ext.containers = params.shigatyper
//container = params.shigatyper.container
stageInMode = params.stage_in_mode
// scratch = false
publishDir = [
path: { "${params.outdir}/subtyping/shigatyper" },
mode: params.publish_dir_mode,
]

}
//withName: SHIGATYPER {
// ext.containers = params.shigatyper
// //container = params.shigatyper.container
// stageInMode = params.stage_in_mode
// // scratch = false
// publishDir = [
// path: { "${params.outdir}/subtyping/shigatyper" },
// mode: params.publish_dir_mode,
// ]
//}

//withName: FASTQSCAN {
// container = params.fastqscan.container
Expand Down Expand Up @@ -175,20 +174,20 @@ process {
]
}

withName: SEQTK_FASTA_FASTQ {
ext.args = ""
ext.containers = params.seqtk
//container = params.seqtk.container
stageInMode = params.stage_in_mode
// scratch = false
publishDir = [
[
path: "${params.outdir}/subtyping/shigatyper",
mode: params.publish_dir_mode,
pattern: "*${params.seqtk.assembly_fastq}"
]
]
}
//withName: SEQTK_FASTA_FASTQ {
// ext.args = ""
// ext.containers = params.seqtk
// //container = params.seqtk.container
// stageInMode = params.stage_in_mode
// // scratch = false
// publishDir = [
// [
// path: "${params.outdir}/subtyping/shigatyper",
// mode: params.publish_dir_mode,
// pattern: "*${params.seqtk.assembly_fastq}"
// ]
// ]
//}

withName: QUAST {
//ext.args = params.quast.args
Expand Down Expand Up @@ -810,15 +809,15 @@ process {
]
}

//withName: SHIGEIFINDER {
// container = params.shigeifinder.container
// stageInMode = params.stage_in_mode
// scratch = false
// publishDir = [
// path: { "${params.outdir}/subtyping/shigeifinder" },
// mode: params.publish_dir_mode,
// ]
//}
withName: SHIGEIFINDER {
ext.containers = params.shigeifinder
stageInMode = params.stage_in_mode
scratch = false
publishDir = [
path: { "${params.outdir}/subtyping/shigeifinder" },
mode: params.publish_dir_mode,
]
}


withName: CUSTOM_DUMPSOFTWAREVERSIONS {
Expand Down
15 changes: 12 additions & 3 deletions docs/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,19 @@ Performa typing of *Staphylococcus* species.
- header_p: Denotes if the output table of Lissero contains a header. Do not alter this field unless doing pipeline development.

### Shigeifinder
Shigeifinder was added then removed. The code still remains but it will removed at a later date.
*in-silico Shigella* typing. **NOTE:** It is unlikely this subtyper will be triggered as GTDB has merged *E.coli* and *Shigella* and updated sketch and updated ECTyper will be released soon to address the shortfalls of this sketch. If you are relying on *Shigella* detection add `--run_kraken true` to your command line or update the value in the `.nextflow.config` as Kraken2 (while slower) can still detect *Shigella*.

### Shigatyper
*in-silico Shigella* typing. **NOTE:** It is unlikely this subtyper will be triggered as GTDB has merged *E.coli* and *Shigella* and updated sketch and updated ECTyper will be released soon to address the shortfalls of this sketch.
- shigeifinder
- singularity: The Singularity container containing Shigeifinder.
- docker: The path to the Docker container containing Shigeifinder.
- container_version: The version number **to be updated with the containers** as Shigeifinder does not currently have a version number tracked in the command.
- tsv_ext: Extension of output report.
- report_tag: The name of the output report for shigeifinder.
- header_p: Denotes that the output from Shigeifinder includes header values.


### Shigatyper (Replaced with Shigeifinder)
Code still reamins but it will likely be removed later on.

- shigatyper
- singularity: The Singularity container containing Shigatyper.
Expand Down
5 changes: 3 additions & 2 deletions modules/local/shigatyper.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ process SHIGATYPER{
tuple val(meta), path(reads) // in mkkondo it will only work with assemblies

output:
tuple val(meta), path("${prefix}${params.tsv_ext}"), emit: tsv
tuple val(meta), path("${prefix}-hits${params.tsv_ext}"), optional: true, emit: hits
tuple val(meta), path("${prefix}${params.shigatyper.tsv_ext}"), emit: tsv
tuple val(meta), path("${prefix}-hits${params.shigatyper.tsv_ext}"), optional: true, emit: hits
path "versions.yml", emit: versions

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
export TMPDIR=\$PWD # set env temp dir to in the folder
shigatyper $args --SE $reads --name $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
6 changes: 3 additions & 3 deletions modules/local/shigeifinder.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ process SHIGEIFINDER {
tuple val(meta), path(seqs)

output:
tuple val(meta), path("*${params.shigeifinder}"), emit: tsv
path "versions.yml" , emit: versions
tuple val(meta), path("*${params.shigeifinder.tsv_ext}"), emit: tsv
path "versions.yml", emit: versions

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
tmp_file = "${prefix}.fa"
def VERSION = '1.3.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def VERSION = params.shigeifinder.container_version // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
gunzip -c $seqs > $tmp_file
shigeifinder $args --output ${prefix}.tsv -t $task.cpus -i $tmp_file
Expand Down
20 changes: 10 additions & 10 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -588,23 +588,23 @@ params {
}

shigeifinder {
container_version = '1.3.2' // update version info with containers as it is not included in shigeifinder
singularity = 'https://depot.galaxyproject.org/singularity/shigeifinder:1.3.2--pyhdfd78af_0'
docker = 'quay.io/biocontainers/shigeifinder:1.3.2--pyhdfd78af_0'
tsv_ext = ".tsv"
//shigeifinder_search = "Shigella"
//report_tag = params.subtyping_report.report_tag
//report_tag = "ShigeiFinder"
report_tag = "Shigeifinder${params.subtyping_report.report_tag}"
header_p = true
}

shigatyper {
singularity = 'https://depot.galaxyproject.org/singularity/shigatyper%3A2.0.1--pyhdfd78af_0'
docker = 'quay.io/biocontainers/shigatyper:2.0.1--pyhdfd78af_0'
tsv_ext = ".tsv"
report_tag = "ShigaTyper${params.subtyping_report.report_tag}"
//report_tag = params.subtyping_report.report_tag
header_p = true
}
//shigatyper {
// singularity = 'https://depot.galaxyproject.org/singularity/shigatyper%3A2.0.1--pyhdfd78af_0'
// docker = 'quay.io/biocontainers/shigatyper:2.0.1--pyhdfd78af_0'
// tsv_ext = ".tsv"
// report_tag = "ShigaTyper${params.subtyping_report.report_tag}"
// //report_tag = params.subtyping_report.report_tag
// header_p = true
//}

kraken_bin {
// Python only
Expand Down
25 changes: 15 additions & 10 deletions subworkflows/local/subtype_genome.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This creates an output similar to the kraken report
include { ECTYPER } from "../../modules/local/ectyper.nf"
include { SISTR } from "../../modules/local/sistr.nf"
include { LISSERO } from "../../modules/local/lissero.nf"
//include { SHIGEIFINDER } from "../../modules/local/shigeifinder.nf"
include { SHIGATYPER } from "../../modules/local/shigatyper.nf"
include { SEQTK_FASTA_FASTQ } from "../../modules/local/seqtk_fasta_fastq.nf"
include { SHIGEIFINDER } from "../../modules/local/shigeifinder.nf"
//include { SHIGATYPER } from "../../modules/local/shigatyper.nf"
//include { SEQTK_FASTA_FASTQ } from "../../modules/local/seqtk_fasta_fastq.nf"
include { KLEBORATE } from "../../modules/local/kleborate.nf"
include { SPATYPER } from "../../modules/local/spatyper.nf"

Expand Down Expand Up @@ -60,11 +60,16 @@ workflow SUBTYPE_GENOME{
meta, result, contigs -> tuple(meta, contigs)
})

//shigatyper requries reads only
fastq_reads = SEQTK_FASTA_FASTQ(isolates.shigella.map{

shigeifinder_results = SHIGEIFINDER(isolates.shigella.map{
meta, result, contigs -> tuple(meta, contigs)
})
shigatyper_results = SHIGATYPER(fastq_reads.fastq_reads)

//shigatyper requries reads onl
//fastq_reads = SEQTK_FASTA_FASTQ(isolates.shigella.map{
// meta, result, contigs -> tuple(meta, contigs)
//})
//shigatyper_results = SHIGATYPER(fastq_reads.fastq_reads)

kleborate_results = KLEBORATE(isolates.klebsiella.map{
meta, result, contigs -> tuple(meta, contigs)
Expand All @@ -84,8 +89,8 @@ workflow SUBTYPE_GENOME{
ECTYPER.out.versions,
SISTR.out.versions,
LISSERO.out.versions,
//SHIGEIFINDER.out.versions)
SHIGATYPER.out.versions)
SHIGEIFINDER.out.versions)
//SHIGATYPER.out.versions)

isolates.fallthrough.subscribe{
log.info "Sample ${it[0].id} could not be serotyped, sample identified as: ${it[1]}"
Expand All @@ -97,8 +102,8 @@ workflow SUBTYPE_GENOME{
add_report_tag(ec_typer_results.tsv, params.ectyper),
add_report_tag(sistr_results.tsv, params.sistr),
add_report_tag(lissero_results.tsv, params.lissero),
//add_report_tag(shigeifinder_results.tsv, params.shigeifinder))
add_report_tag(shigatyper_results.tsv, params.shigeifinder))
add_report_tag(shigeifinder_results.tsv, params.shigeifinder))
//add_report_tag(shigatyper_results.tsv, params.shigeifinder))

emit:
reports = reports
Expand Down

0 comments on commit bdef066

Please sign in to comment.