Skip to content

Commit

Permalink
Merge pull request #350 from genomic-medicine-sweden/340-add-ska-to-base
Browse files Browse the repository at this point in the history
Add ska to base
  • Loading branch information
ryanjameskennedy authored Sep 26, 2024
2 parents 16620d8 + 7ee2df2 commit a955da8
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added ska2 module processes (`ska_build` & `ska_align`)
- Added ska2 to `bacterial_base.nf`

### Fixed

- Fixed tbprofiler related installation rules in `Makefile`
Expand Down
11 changes: 9 additions & 2 deletions configs/nextflow.base.config
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ process {
withName: samtools_index_assembly {
cpus = 16
memory = '2 GB'
container = "https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0"
container = "${params.containerDir}/samtools.sif"
}
withName: samtools_index_ref {
cpus = 16
Expand All @@ -254,9 +254,16 @@ process {
}
withName: shigapass {
cpus = 2
container = "https://depot.galaxyproject.org/singularity/shigapass:1.5.0--hdfd78af_0"
container = "${params.containerDir}/shigapass.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/shigapass", mode: 'copy', overwrite: true ]
}
withName: ska_build {
container = "${params.containerDir}/ska2.sif"
cpus = 2
memory = '10 GB'
publishDir = [ path: "${params.outdir}/${params.speciesDir}/ska", mode: 'copy', overwrite: true ]
ext.args = "-k 31 --threads 1"
}
withName: skesa {
container = "${params.containerDir}/skesa.sif"
cpus = 16
Expand Down
11 changes: 9 additions & 2 deletions configs/nextflow.ci.config
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ process {
withName: samtools_index_assembly {
cpus = 4
memory = '2 GB'
container = "https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0"
container = "${params.containerDir}/samtools.sif"
}
withName: samtools_index_ref {
cpus = 4
Expand All @@ -226,9 +226,16 @@ process {
}
withName: shigapass {
cpus = 2
container = "https://depot.galaxyproject.org/singularity/shigapass:1.5.0--hdfd78af_0"
container = "${params.containerDir}/shigapass.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/shigapass", mode: 'copy', overwrite: true ]
}
withName: ska_build {
container = "${params.containerDir}/ska2.sif"
cpus = 2
memory = '10 GB'
publishDir = [ path: "${params.outdir}/${params.speciesDir}/ska", mode: 'copy', overwrite: true ]
ext.args = "-k 31 --threads 1"
}
withName: skesa {
container = "${params.containerDir}/skesa.sif"
cpus = 4
Expand Down
7 changes: 7 additions & 0 deletions configs/nextflow.dev.config
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,13 @@ process {
container = "https://depot.galaxyproject.org/singularity/shigapass:1.5.0--hdfd78af_0"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/shigapass", mode: 'copy', overwrite: true ]
}
withName: ska_build {
container = "https://depot.galaxyproject.org/singularity/ska2:0.3.10--h4349ce8_0"
cpus = 2
memory = '10 GB'
publishDir = [ path: "${params.outdir}/${params.speciesDir}/ska", mode: 'copy', overwrite: true ]
ext.args = "-k 31 --threads 1"
}
withName: skesa {
container = "https://depot.galaxyproject.org/singularity/skesa:2.4.0--he1c1bb9_0"
cpus = 16
Expand Down
7 changes: 7 additions & 0 deletions configs/nextflow.hopper.config
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ process {
container = "https://depot.galaxyproject.org/singularity/shigapass:1.5.0--hdfd78af_0"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/shigapass", mode: 'copy', overwrite: true ]
}
withName: ska_build {
container = "https://depot.galaxyproject.org/singularity/ska2:0.3.10--h4349ce8_0"
cpus = 2
memory = '10 GB'
publishDir = [ path: "${params.outdir}/${params.speciesDir}/ska", mode: 'copy', overwrite: true ]
ext.args = "-k 31 --threads 1"
}
withName: skesa {
container = "https://depot.galaxyproject.org/singularity/skesa:2.4.0--he1c1bb9_0"
cpus = 16
Expand Down
15 changes: 11 additions & 4 deletions configs/nextflow.ngp.config
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ process {
withName: samtools_index_assembly {
cpus = params.cpus_large
memory = params.mem_large
container = "https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0"
container = "${params.containerDir}/samtools.sif"
}
withName: samtools_index_ref {
cpus = params.cpus_large
Expand All @@ -246,7 +246,7 @@ process {
withName: samtools_sort_ref {
cpus = params.cpus_large
memory = params.mem_small
container = "https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0"
container = "${params.containerDir}/samtools.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/${params.bamDir}", mode: 'copy', overwrite: true ]
}
withName: save_analysis_metadata {
Expand All @@ -259,10 +259,17 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/serotypefinder", mode: 'copy', overwrite: true ]
}
withName: shigapass {
cpus = 2
container = "https://depot.galaxyproject.org/singularity/shigapass:1.5.0--hdfd78af_0"
cpus = params.cpus_small
container = "${params.containerDir}/shigapass.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/shigapass", mode: 'copy', overwrite: true ]
}
withName: ska_build {
container = "${params.containerDir}/ska2.sif"
cpus = params.cpus_small
memory = params.mem_small
publishDir = [ path: "${params.outdir}/${params.speciesDir}/ska", mode: 'copy', overwrite: true ]
ext.args = "-k 31 --threads 1"
}
withName: skesa {
container = "${params.containerDir}/skesa.sif"
cpus = params.cpus_large
Expand Down
2 changes: 2 additions & 0 deletions container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ remote_containers := ncbi-amrfinderplus.sif \
samtools.sif \
serotypefinder.sif \
shigapass.sif \
ska2.sif \
skesa.sif \
snippy.sif \
sourmash.sif \
Expand Down Expand Up @@ -62,6 +63,7 @@ URL_resfinder := https://depot.galaxyproject.org/singularity/resfinder:4.4.2--py
URL_samtools := https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0
URL_serotypefinder := https://depot.galaxyproject.org/singularity/serotypefinder:2.0.2--py312hdfd78af_1
URL_shigapass := https://depot.galaxyproject.org/singularity/shigapass:1.5.0--hdfd78af_0
URL_ska2 := https://depot.galaxyproject.org/singularity/ska2:0.3.10--h4349ce8_0
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
Expand Down
42 changes: 42 additions & 0 deletions nextflow-modules/modules/ska/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
process ska_build {
tag "${sampleID}"
scratch params.scratch

input:
tuple val(sampleID), path(reads)

output:
tuple val(sampleID), path(output), emit: skf
path "*versions.yml" , emit: versions

script:
def args = task.ext.args ?: ''
def inputData = reads.size() == 2 ? "${sampleID}\t${reads[0]}\t${reads[1]}" : "${sampleID}\t${reads[0]}"
output_basename = "${sampleID}_ska_index"
output = "${output_basename}.skf"
"""
echo ${inputData} > ${sampleID}_input.txt
ska build $args -o ${output_basename} -f ${sampleID}_input.txt
cat <<-END_VERSIONS > ${sampleID}_${task.process}_versions.yml
${task.process}:
ska2:
version: \$(echo \$(ska --version 2>&1) | sed 's/^.*ska // ; s/ .*//')
container: ${task.container}
END_VERSIONS
"""

stub:
output = "${sampleID}_ska_index.skf"
"""
mkdir ${sampleID}
touch $output
cat <<-END_VERSIONS > ${sampleID}_${task.process}_versions.yml
${task.process}:
ska2:
version: \$(echo \$(ska --version 2>&1) | sed 's/^.*ska // ; s/ .*//')
container: ${task.container}
END_VERSIONS
"""
}
5 changes: 5 additions & 0 deletions workflows/bacterial_base.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ include { post_align_qc } from '../nextflow-modules/modu
include { quast } from '../nextflow-modules/modules/quast/main.nf'
include { samtools_index as samtools_index_ref } from '../nextflow-modules/modules/samtools/main.nf'
include { save_analysis_metadata } from '../nextflow-modules/modules/meta/main.nf'
include { ska_build } from '../nextflow-modules/modules/ska/main.nf'
include { skesa } from '../nextflow-modules/modules/skesa/main.nf'
include { sourmash } from '../nextflow-modules/modules/sourmash/main.nf'
include { spades_illumina } from '../nextflow-modules/modules/spades/main.nf'
Expand Down Expand Up @@ -64,12 +65,15 @@ workflow CALL_BACTERIAL_BASE {

sourmash(ch_assembly)

ska_build(ch_reads)

ch_versions = ch_versions.mix(bwa_mem_ref.out.versions)
ch_versions = ch_versions.mix(flye.out.versions)
ch_versions = ch_versions.mix(medaka.out.versions)
ch_versions = ch_versions.mix(quast.out.versions)
ch_versions = ch_versions.mix(samtools_index_ref.out.versions)
ch_versions = ch_versions.mix(skesa.out.versions)
ch_versions = ch_versions.mix(ska_build.out.versions)
ch_versions = ch_versions.mix(sourmash.out.versions)
ch_versions = ch_versions.mix(spades_illumina.out.versions)
ch_versions = ch_versions.mix(spades_iontorrent.out.versions)
Expand All @@ -83,6 +87,7 @@ workflow CALL_BACTERIAL_BASE {
qc = post_align_qc.out.qc // channel: [ val(meta), path(fasta)]
quast = quast.out.qc // channel: [ val(meta), path(qc)]
reads = ch_reads // channel: [ val(meta), path(json)]
ska_build = ska_build.out.skf // channel: [ val(meta), path(skf)]
seqrun_meta = ch_seqrun_meta // channel: [ val(meta), val(json), val(json)]
sourmash = sourmash.out.signature // channel: [ val(meta), path(signature)]
versions = ch_versions // channel: [ versions.yml ]
Expand Down

0 comments on commit a955da8

Please sign in to comment.