Skip to content

Commit

Permalink
[skip ci] rewire for updated kallisto modules
Browse files Browse the repository at this point in the history
  • Loading branch information
pinin4fjords committed Nov 2, 2023
1 parent c081697 commit 7eb755b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
13 changes: 10 additions & 3 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions subworkflows/local/prepare_genome/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand All @@ -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 ]
}
8 changes: 4 additions & 4 deletions subworkflows/local/quantify_kallisto/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
Expand Down Expand Up @@ -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 ]
Expand Down

0 comments on commit 7eb755b

Please sign in to comment.