export baseDir=<<PATH_TO_BASEDIR>>
export project=<<PROJECTNAME>>

screen -R $project

########################################################################################################################
### Setup

## change if you want to use customized copy
DGE_HOME=/projects/bioinfo/holger/bioinfo_templates/dge_workflow


source <(curl https://dl.dropboxusercontent.com/u/113630701/datautils/bash/lsf_utils.sh 2>&1 2>/dev/null)
source <(curl https://dl.dropboxusercontent.com/u/113630701/datautils/R/utils/spinr.sh 2>&1 2>/dev/null)
source $DGE_HOME/lsf_rna_seq.sh


export PATH=/projects/bioinfo/holger/bin/bowtie2-2.2.2:$PATH
export PATH=/projects/bioinfo/holger/bin/tophat-2.0.13.Linux_x86_64:$PATH
export PATH=/home/brandl/bin/cufflinks-2.2.1.Linux_x86_64:$PATH
# which tophat;  which bowtie2; which cuffdiff


########################################################################################################################
#### QC


#fastqFiles=$(ls /projects/bioinfo/holger/projects/helin/all_trep_pooled/dog_*)
fastqFiles=<<TBD>>
#ll $fastqFiles

## do some qc for the reads
dge_fastqc -o $baseDir/fastqc $fastqFiles &

## create a fastqc report
spinr $DGE_HOME

mailme "$project: fastqc done"


########################################################################################################################
### Map the data and do cuffdiff

mcdir $baseDir/mapped

#igenome=/projects/bioinfo/igenomes/Canis_familiaris/Ensembl/CanFam3.1
igenome=<<TBD>>


dge_tophat_se -i $igenome $fastqFiles 2>&1 | tee mapped.log

mailme "$project: mapping done"


########################################################################################################################
### Do the differential expression analysis

mcdir $baseDir/cuffdiff

gtfFile=$igenome/Annotation/Genes/genes.gtf

## define labels to split bam files into replicate groups
#labels="big_cyst,small_cyst"
labels=<<TBD>>

dge_cuffdiff $gtfFile $baseDir/mapped $labels
MakeCuffDB $gtfFile "NAN"

mailme "$project: cuffdiff done"