From fa9af26b4b6054225d34a566ad45bd73d921b83a Mon Sep 17 00:00:00 2001 From: lkress <35309241+LKress@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:06:13 +0000 Subject: [PATCH] Define the STAR output as bam file --- README.md | 1 + modules/02_star.nf | 4 +++- nextflow.config | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f1851b5..1bc5bed 100755 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ Optional input: * inception: if enabled it uses an inception, only valid for BWA aln, it requires a fast file system such as flash (default: false) * skip_trimming: skips the read trimming step * star_two_pass_mode: activates STAR two-pass mode, increasing sensitivity of novel junction discovery, recommended for RNA variant calling (default: false) + * star_sort_by_coordinate: Sort STAR output BAM file by coordinate (default: false) * additional_args: additional alignment arguments, only effective in BWA mem, BWA mem 2 and STAR (default: none) Output: diff --git a/modules/02_star.nf b/modules/02_star.nf index 2f74fd0..1a6c403 100644 --- a/modules/02_star.nf +++ b/modules/02_star.nf @@ -18,6 +18,7 @@ process STAR { script: two_pass_mode_param = params.star_two_pass_mode ? "--twopassMode Basic" : "" + sort = params.star_sort_by_coordinate ? "SortedByCoordinate" : "" """ STAR --genomeDir ${reference} ${two_pass_mode_param} ${params.additional_args} \ --readFilesCommand "gzip -d -c -f" \ @@ -25,12 +26,13 @@ process STAR { --outSAMmode Full \ --outSAMattributes Standard \ --outSAMunmapped None \ + --outSAMtype BAM ${sort} \ --outReadsUnmapped Fastx \ --outFilterMismatchNoverLmax 0.02 \ --runThreadN ${task.cpus} \ --outFileNamePrefix ${name}. - mv ${name}.Aligned.sortedByCoord.out.bam ${name}.bam + mv ${name}.Aligned*.out.bam ${name}.bam echo ${params.manifest} >> software_versions.STAR.txt STAR --version >> software_versions.STAR.txt diff --git a/nextflow.config b/nextflow.config index 819a5b8..b7a0c27 100644 --- a/nextflow.config +++ b/nextflow.config @@ -17,6 +17,7 @@ params.memory = "32g" params.inception = false params.skip_trimming = false params.star_two_pass_mode = false +params.star_sort_by_coordinate = false params.additional_args = "" params.fastp_args = ""