diff --git a/software/salmon/quant/main.nf b/software/salmon/quant/main.nf index 4d0ca869..bb0d07d9 100644 --- a/software/salmon/quant/main.nf +++ b/software/salmon/quant/main.nf @@ -18,16 +18,24 @@ process SALMON_QUANT { tuple val(meta), path(reads) path index path gtf + path transcript_fasta + val alignment_mode output: tuple val(meta), path("${prefix}"), emit: results path "*.version.txt" , emit: version script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}" + def software = getSoftwareName(task.process) + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def reference = "--index $index" + def input_reads = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}" + if (alignment_mode) { + reference = "-t $transcript_fasta" + input_reads = "-a $reads" + } + def strandedness = meta.single_end ? 'U' : 'IU' if (meta.strandedness == 'forward') { strandedness = meta.single_end ? 'SF' : 'ISF' @@ -39,8 +47,8 @@ process SALMON_QUANT { --geneMap $gtf \\ --threads $task.cpus \\ --libType=$strandedness \\ - --index $index \\ - $endedness \\ + $reference \\ + $input_reads \\ $options.args \\ -o $prefix