diff --git a/CHANGELOG.md b/CHANGELOG.md index 12ee4d2..2c02036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/configs/nextflow.base.config b/configs/nextflow.base.config index 47934a6..8df7d8e 100644 --- a/configs/nextflow.base.config +++ b/configs/nextflow.base.config @@ -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 @@ -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 diff --git a/configs/nextflow.ci.config b/configs/nextflow.ci.config index f5722c5..3a955ba 100644 --- a/configs/nextflow.ci.config +++ b/configs/nextflow.ci.config @@ -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 @@ -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 diff --git a/configs/nextflow.dev.config b/configs/nextflow.dev.config index 375a9ec..dde3725 100644 --- a/configs/nextflow.dev.config +++ b/configs/nextflow.dev.config @@ -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 diff --git a/configs/nextflow.hopper.config b/configs/nextflow.hopper.config index bdf8525..698198e 100644 --- a/configs/nextflow.hopper.config +++ b/configs/nextflow.hopper.config @@ -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 diff --git a/configs/nextflow.ngp.config b/configs/nextflow.ngp.config index a566ceb..69e39d9 100644 --- a/configs/nextflow.ngp.config +++ b/configs/nextflow.ngp.config @@ -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 @@ -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 { @@ -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 diff --git a/container/Makefile b/container/Makefile index 904c0ac..b0b0936 100644 --- a/container/Makefile +++ b/container/Makefile @@ -34,6 +34,7 @@ remote_containers := ncbi-amrfinderplus.sif \ samtools.sif \ serotypefinder.sif \ shigapass.sif \ + ska2.sif \ skesa.sif \ snippy.sif \ sourmash.sif \ @@ -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 diff --git a/nextflow-modules/modules/ska/main.nf b/nextflow-modules/modules/ska/main.nf new file mode 100644 index 0000000..276df3e --- /dev/null +++ b/nextflow-modules/modules/ska/main.nf @@ -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 + """ +} diff --git a/workflows/bacterial_base.nf b/workflows/bacterial_base.nf index 2c8e778..40ac299 100644 --- a/workflows/bacterial_base.nf +++ b/workflows/bacterial_base.nf @@ -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' @@ -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) @@ -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 ]