#!/bin/bash
PATH=/data/results/tools/samtools/samtools-0.1.19:/data/results/tools/align/bowtie2-2.2.8:/data/results/tools/align/tophat-2.1.1.Linux_x86_64:/data/results/tools/bedtools/bedtools2/bin:/data/results/tools/bedtools/bedtools2/bin:/data/results/tools/bedtools/bedtools2/bin:/data/results/tools/bedtools/bedtools2/bin:/data/results/tools/bedtools/bedtools2/bin:/data/results/tools/bedtools/bedtools2/bin:/data/results/tools/bedtools/bedtools2/bin:/data/results/tools/align/blast/ncbi-blast-2.2.29+/bin:/home/reczko/a/tools/rna/structural-motifs/CMfinder_0.2/bin:/home/reczko/a/tools/libs/www/firefox:/home/reczko/a/tools/libs/boost/bin:/data/results/tools/ml/torch/torch/install/bin:/data/results/tools/chipseq/ngsplot/bin:/data/results/tools/bedtools/BEDTools-Version-2.14.3/bin:/data/results/tools/samtools/mysamtools-0.1.19:/data/results/tools/denovo/gene-finding/snap:/data/results/tools/denovo/gene-finding/exonerate-2.2.0-x86_64/bin:/data/results/tools/denovo/gene-finding/augustus-3.0.3/bin:/data/results/tools/denovo/gene-finding/augustus-3.0.3/scripts:/data/results/tools/align/blast/ncbi-blast-2.2.29+/bin:/data/results/tools/denovo/repeats/RepeatMasker:/data/results/tools/protein/tmhmm-2.0c/bin:/data/results/tools/align/rsem/rsem-1.2.15:/data/results/tools/chipseq/ngsplot/bin:/home/reczko/a/tools/libs/java/jdk1.8.0_66/bin:/home/reczko/a/tools/ml/tensorflow/bazel/output:/usr/lib/jvm/java-7-openjdk-amd64/jre/bin:/usr/java/jre1.8.0_45/bin:/data/results/tools/samtools/samtools-1.0:/data/results/tools/align/bowtie-1.1.0:/data/results/tools/r/R-3.0.1/bin:/data/results/tools/ml/torch/torch/install/bin:/home/reczko/bin:/data/results/tools/align/blast/ncbi-blast-2.2.29+/bin:/home/reczko/a/tools/rna/structural-motifs/CMfinder_0.2/bin:/home/reczko/a/tools/libs/www/firefox:/home/reczko/a/tools/libs/boost/bin:/data/results/tools/ml/torch/torch/install/bin:/data/results/tools/chipseq/ngsplot/bin:/data/results/tools/bedtools/BEDTools-Version-2.14.3/bin:/data/results/tools/samtools/mysamtools-0.1.19:/data/results/tools/denovo/gene-finding/snap:/data/results/tools/denovo/gene-finding/exonerate-2.2.0-x86_64/bin:/data/results/tools/denovo/gene-finding/augustus-3.0.3/bin:/data/results/tools/denovo/gene-finding/augustus-3.0.3/scripts:/data/results/tools/align/blast/ncbi-blast-2.2.29+/bin:/data/results/tools/denovo/repeats/RepeatMasker:/data/results/tools/protein/tmhmm-2.0c/bin:/data/results/tools/align/rsem/rsem-1.2.15:/data/results/tools/chipseq/ngsplot/bin:/home/reczko/a/tools/libs/java/jdk1.8.0_66/bin:/home/reczko/a/tools/ml/tensorflow/bazel/output:/usr/lib/jvm/java-7-openjdk-amd64/jre/bin:/usr/java/jre1.8.0_45/bin:/data/results/tools/samtools/samtools-1.0:/data/results/tools/align/bowtie-1.1.0:/data/results/tools/r/R-3.0.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/data/results/tools/rna/protein-coding-potential/lncRScan-SVM_v1.0.1/executable/script:/data/results/tools/rna/protein-coding-potential/lncRScan-SVM_v1.0.1/executable/util:/data/results/tools/rna/protein-coding-potential/lncRScan-SVM_v1.0.1/executable/bin/x86_64:/data/results/tools/rna/protein-coding-potential/lncRScan-SVM_v1.0.1/executable/script:/data/results/tools/rna/protein-coding-potential/lncRScan-SVM_v1.0.1/executable/util:/data/results/tools/rna/protein-coding-potential/lncRScan-SVM_v1.0.1/executable/bin/x86_64; export PATH
echo "Using tophat2 installation at"
which tophat2
tophat --version
echo "Using bowtie installation at"
which bowtie2
bowtie2 --version
/data/results/tools/align/tophat-2.1.1.Linux_x86_64/tophat2 -p 10 --read-mismatches 3 --read-gap-length 3 --read-edit-dist 3    --no-novel-juncs --output-dir tophat_014a --keep-fasta-order --transcriptome-index=/data/results/reference/mmu/mm10/mRNA/transcripts /data/results/reference/mmu/mm10/Mus_musculus/UCSC/mm10/Sequence/Bowtie2Index/genome R_2015_05_21_11_36_50_user_ION-186-DrStathopoulos_150521_NKRNAseq_GSR2-7.GSR7-BELA2.IonXpressRNA_014.fastq &> 014a.tophat-mm10.log
cd tophat_014a;/data/results/tools/formats/bam2fastq-1.1.0/bam2fastq -o unmapped.fastq -q unmapped.bam;  bowtie2 --local --very-sensitive-local -p 10 --mm -x /data/results/reference/mmu/mm10/Mus_musculus/UCSC/mm10/Sequence/Bowtie2Index/genome -U unmapped.fastq  | /data/results/tools/samtools/samtools-0.1.19/samtools view -uhS -F4 - | /data/results/tools/samtools/samtools-0.1.19/samtools sort - unmapped_remap; rm unmapped.fastq; samtools merge merged.bam  accepted_hits.bam unmapped_remap.bam; /data/results/tools/samtools/mysamtools-0.1.19/samtools sort  -@ 10 -n merged.bam sort; rm merged.bam; rm unmapped_remap.bam; samtools view sort.bam   | awk -f /data/results/tools/formats/sam-remove-read-multimaps-to-same-location2.awk | samtools view -bt  /data/results/reference/mmu/mm10/Mus_musculus/UCSC/mm10/Sequence/WholeGenomeFasta/genome.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
