From 4ac26c0fe9b650700c2bb16785957c5b1ee39a27 Mon Sep 17 00:00:00 2001 From: Luca Cozzuto Date: Fri, 2 Aug 2019 17:20:36 +0200 Subject: [PATCH] STAR can align without GTF --- INSTALL.sh | 2 +- lib/NGSaligner.groovy | 36 +++++++++++------------------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/INSTALL.sh b/INSTALL.sh index e56aa18..7d94f79 100644 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh # Check pipeline dependency -bionext_ver="0.3" +bionext_ver="0.7.2" # Check presence of a lib if [ -d "lib" ]; then { diff --git a/lib/NGSaligner.groovy b/lib/NGSaligner.groovy index 375bf32..e51df58 100644 --- a/lib/NGSaligner.groovy +++ b/lib/NGSaligner.groovy @@ -82,9 +82,6 @@ case "blast": this.indexWithBlast() break - case "bwa": - this.indexWithBWA() - break default: break } @@ -115,18 +112,22 @@ def private indexWithSTAR() { """ + annotation_cmd="" + if [[ `echo ${this.annotation_file}` != "" ]]; then + annotation_cmd="--sjdbOverhang ${this.read_size} --sjdbGTFfile ${this.annotation_file}" + fi mkdir ${this.index} if [ `echo ${this.reference_file} | grep ".gz"` ]; then zcat ${this.reference_file} > `basename ${this.reference_file} .gz` STAR --runMode genomeGenerate --genomeDir ${this.index} --runThreadN ${this.cpus} \ - --genomeFastaFiles `basename ${this.reference_file} .gz` --sjdbGTFfile ${this.annotation_file} \ - --sjdbOverhang ${this.read_size} --outFileNamePrefix ${this.index} \ + --genomeFastaFiles `basename ${this.reference_file} .gz` \$annotation_cmd \ + --outFileNamePrefix ${this.index} \ ${this.extrapars}; rm `basename ${this.reference_file} .gz` else STAR --runMode genomeGenerate --genomeDir ${this.index} --runThreadN ${this.cpus} \ - --genomeFastaFiles ${this.reference_file} --sjdbGTFfile ${this.annotation_file} \ - --sjdbOverhang ${this.read_size} --outFileNamePrefix ${this.index} \ + --genomeFastaFiles ${this.reference_file} \$annotation_cmd \ + --outFileNamePrefix ${this.index} \ ${this.extrapars} fi """ @@ -143,6 +144,7 @@ STAR --genomeDir ${this.index} \ --readFilesIn ${this.reads} \ \$gzipped \ + --outSAMunmapped None \ --outSAMtype BAM SortedByCoordinate \ --runThreadN ${this.cpus} \ --quantMode GeneCounts \ @@ -203,22 +205,7 @@ makeblastdb -in ${this.index} -dbtype ${this.dbtype} ${this.extrapars} """ } - - /* - * Indexing with BWA - */ - - def private indexWithBWA() { - - """ - if [ `echo ${this.reference_file} | grep ".gz"` ]; then - zcat ${this.reference_file} > ${this.index}.fa - bwa index ${this.index}.fa - else ln -s ${this.reference_file} ${this.index}.fa - bwa index ${this.index}.fa - fi - """ - } + /******************************************************************* * MAPPING ********************************************************************/ @@ -270,8 +257,7 @@ blastn -out ${this.output} -db ${this.index} -query ${this.reads} -num_threads ${this.cpus} ${this.extrapars} """ } - - + /******************************************************************* * OTHER ********************************************************************/