Skip to content

Commit

Permalink
STAR can align without GTF
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacozzuto committed Aug 2, 2019
1 parent 9a9d2d6 commit 4ac26c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
2 changes: 1 addition & 1 deletion INSTALL.sh
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
36 changes: 11 additions & 25 deletions lib/NGSaligner.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@
case "blast":
this.indexWithBlast()
break
case "bwa":
this.indexWithBWA()
break
default:
break
}
Expand Down Expand Up @@ -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
"""
Expand All @@ -143,6 +144,7 @@
STAR --genomeDir ${this.index} \
--readFilesIn ${this.reads} \
\$gzipped \
--outSAMunmapped None \
--outSAMtype BAM SortedByCoordinate \
--runThreadN ${this.cpus} \
--quantMode GeneCounts \
Expand Down Expand Up @@ -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
********************************************************************/
Expand Down Expand Up @@ -270,8 +257,7 @@
blastn -out ${this.output} -db ${this.index} -query ${this.reads} -num_threads ${this.cpus} ${this.extrapars}
"""
}



/*******************************************************************
* OTHER
********************************************************************/
Expand Down

0 comments on commit 4ac26c0

Please sign in to comment.