From 8de95b793905e0b7a7b798f6b84bcfd316335896 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 22 Dec 2023 14:10:33 +0000 Subject: [PATCH] Provide interface to pseudoaligner kmer length --- conf/modules.config | 7 +++++-- nextflow.config | 1 + nextflow_schema.json | 9 ++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index efef36974..d1576e1e3 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -75,7 +75,10 @@ process { } withName: 'SALMON_INDEX' { - ext.args = params.gencode ? '--gencode' : '' + ext.args = { [ + params.gencode ? '--gencode' : '', + params.pseudo_kmer_size ? "-k ${params.pseudo_kmer_size}": '' + ].join(' ').trim() } publishDir = [ path: { "${params.outdir}/genome/index" }, mode: params.publish_dir_mode, @@ -84,7 +87,7 @@ process { } withName: 'KALLISTO_INDEX' { - ext.args = { params.gencode ? '--gencode' : '' } + ext.args = params.kmer_size ? "-k ${params.pseudo_kmer_size}" : '' publishDir = [ path: { "${params.outdir}/genome/index" }, mode: params.publish_dir_mode, diff --git a/nextflow.config b/nextflow.config index d15d4435c..366a82a74 100644 --- a/nextflow.config +++ b/nextflow.config @@ -59,6 +59,7 @@ params { // Alignment aligner = 'star_salmon' pseudo_aligner = null + pseudo_aligner_kmer_size = 31 seq_center = null bam_csi_index = false star_ignore_sjdbgtf = false diff --git a/nextflow_schema.json b/nextflow_schema.json index 60e6585cf..f696c76c9 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -361,6 +361,13 @@ "fa_icon": "fas fa-hamburger", "enum": ["salmon", "kallisto"] }, + "pseudo_aligner_kmer_size": { + "type": "integer", + "default": 31, + "description": "Kmer length passed to indexing step of pseudoaligners", + "help_text": "Failure to set a good kmer size could cause issues with quantification with Kallisto or Salmon. This is mostly an issue for short reads (<50bp), where the default kmer size of 31 is an problem.", + "fa_icon": "fas fa-ruler-horizontal" + }, "bam_csi_index": { "type": "boolean", "description": "Create a CSI index for BAM files instead of the traditional BAI index. This will be required for genomes with larger chromosome sizes.", @@ -397,7 +404,7 @@ }, "min_mapped_reads": { "type": "number", - "default": 5.0, + "default": 5, "fa_icon": "fas fa-percentage", "description": "Minimum percentage of uniquely mapped reads below which samples are removed from further processing.", "help_text": "Some downstream steps in the pipeline will fail if this threshold is too low."