From 7eb755bcca9be5ea15eb1ce8ec73bb220d2b0c42 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Thu, 2 Nov 2023 12:01:53 +0000 Subject: [PATCH] [skip ci] rewire for updated kallisto modules --- conf/modules.config | 13 ++++++++++--- subworkflows/local/prepare_genome/main.nf | 8 ++++---- subworkflows/local/quantify_kallisto/main.nf | 8 ++++---- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 52cd65bdf..bcbcbbb5e 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -1132,9 +1132,16 @@ if (!params.skip_multiqc) { if (!params.skip_pseudo_alignment && params.pseudo_aligner == 'kallisto') { process { withName: '.*:QUANTIFY_KALLISTO:KALLISTO_QUANT' { - ext.fragment_len = { meta.fragment_len ?: params.kallisto_default_fraglen } - ext.sd = { meta.fragment_len ?: params.kallisto_default_fraglen_se } - ext.args = params.extra_kallisto_quant_args ?: '' + ext.args = { + [ + meta.single_end ? + "--single " + + "--fragment-length ${meta.fragment_len ?: params.kallisto_default_fraglen} " + + "--sd ${meta.fraglen_se ?: params.kallisto_default_fraglen_se}" : '', + params.extra_kallisto_quant_args ?: '' + ].findAll().join(' ').trim() + } + publishDir = [ path: { "${params.outdir}/${params.pseudo_aligner}" }, mode: params.publish_dir_mode, diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index f249ac56c..ca598a199 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -267,14 +267,14 @@ workflow PREPARE_GENOME { ch_kallisto_index = Channel.empty() if (kallisto_index) { if (kallisto_index.endsWith('.tar.gz')) { - ch_kallisto_index = UNTAR_KALLISTO_INDEX ( [ [:], kallisto_index ] ).untar.map { it[1] } + ch_kallisto_index = UNTAR_KALLISTO_INDEX ( [ [:], kallisto_index ] ).untar ch_versions = ch_versions.mix(UNTAR_KALLISTO_INDEX.out.versions) } else { - ch_kallisto_index = Channel.value(file(kallisto_index)) + ch_kallisto_index = Channel.value([[:], file(kallisto_index)]) } } else { if ('kallisto' in prepare_tool_indices) { - ch_kallisto_index = KALLISTO_INDEX ( ch_transcript_fasta.map{[ [:], it]} ).index.map { it[1] } + ch_kallisto_index = KALLISTO_INDEX ( ch_transcript_fasta.map{[ [:], it]} ).index ch_versions = ch_versions.mix(KALLISTO_INDEX.out.versions) } } @@ -292,7 +292,7 @@ workflow PREPARE_GENOME { rsem_index = ch_rsem_index // channel: path(rsem/index/) hisat2_index = ch_hisat2_index // channel: path(hisat2/index/) salmon_index = ch_salmon_index // channel: path(salmon/index/) - kallisto_index = ch_kallisto_index // channel: path(kallisto/index/) + kallisto_index = ch_kallisto_index // channel: [ meta, path(kallisto/index/) ] versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] } diff --git a/subworkflows/local/quantify_kallisto/main.nf b/subworkflows/local/quantify_kallisto/main.nf index 93ef56f9d..843d769fc 100644 --- a/subworkflows/local/quantify_kallisto/main.nf +++ b/subworkflows/local/quantify_kallisto/main.nf @@ -14,7 +14,7 @@ include { SALMON_SUMMARIZEDEXPERIMENT as SALMON_SE_TRANSCRIPT } from '.. workflow QUANTIFY_KALLISTO { take: reads // channel: [ val(meta), [ reads ] ] - index // channel: /path/to/kallisto/index/ + index // channel: [ val(meta2), /path/to/kallisto/index/ ] transcript_fasta // channel: /path/to/transcript.fasta gtf // channel: /path/to/genome.gtf alignment_mode // bool: Run Salmon in alignment mode @@ -31,10 +31,10 @@ workflow QUANTIFY_KALLISTO { KALLISTO_QUANT ( reads, index, gtf, []) ch_versions = ch_versions.mix(KALLISTO_QUANT.out.versions.first()) - SALMON_TX2GENE ( KALLISTO_QUANT.out.abundance_hdf5.collect{it[1]}, gtf ) + SALMON_TX2GENE ( KALLISTO_QUANT.out.results.collect{it[1]}, gtf ) ch_versions = ch_versions.mix(SALMON_TX2GENE.out.versions) - SALMON_TXIMPORT ( KALLISTO_QUANT.out.abundance_hdf5.collect{it[1]}, SALMON_TX2GENE.out.tsv.collect() ) + SALMON_TXIMPORT ( KALLISTO_QUANT.out.results.collect{it[1]}, SALMON_TX2GENE.out.tsv.collect() ) ch_versions = ch_versions.mix(SALMON_TXIMPORT.out.versions) SALMON_SE_GENE ( @@ -63,7 +63,7 @@ workflow QUANTIFY_KALLISTO { ) emit: - results = KALLISTO_QUANT.out.abundance_hdf5 // channel: [ val(meta), abundances ] + results = KALLISTO_QUANT.out.results // channel: [ val(meta), abundances ] tpm_gene = SALMON_TXIMPORT.out.tpm_gene // channel: [ val(meta), counts ] counts_gene = SALMON_TXIMPORT.out.counts_gene // channel: [ val(meta), counts ]