for i in *q
do
echo $i    
#/data/results/tools/align/bowtie2-2.3.2/bowtie2   --no-unal  --local --very-sensitive-local -p 10  -x /data/images/proton2/run342/inserts/inserted-sequences-run342 -U $i -S $i.checkIns;
awk 'BEGIN{FS="\t";}{if ($3=="4a"){a++;}if ($3=="4f"){f++;}}END{print 0+a" "0+f}' $i.checkIns
done
exit


#!/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/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/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/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:/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 tophatCheckIns_001 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.IonXpress_001.fastq &> 001.tophat-checkInserts.log
#exit 1
#cd tophatCheckIns_001;/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/images/proton2/run342/inserts/inserted-sequences-run342 -U /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.IonXpress_001.fastq  | /data/results/tools/samtools/samtools-0.1.19/samtools view -uhS -F4 - | /data/results/tools/samtools/samtools-0.1.19/samtools sort - merged; /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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_034 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R10-5269-4fminus.IonXpress_034.fastq &> 034.tophat-checkInserts.log
cd tophatCheckIns_034;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_035 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R11-Cplus-1plus.IonXpress_035.fastq &> 035.tophat-checkInserts.log
cd tophatCheckIns_035;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_025 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R1-5291-4aplus.IonXpress_025.fastq &> 025.tophat-checkInserts.log
cd tophatCheckIns_025;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_026 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R2-5291-4aplus.IonXpress_026.fastq &> 026.tophat-checkInserts.log
cd tophatCheckIns_026;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_027 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R3-5291-4aplus.IonXpress_027.fastq &> 027.tophat-checkInserts.log
cd tophatCheckIns_027;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_028 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R4-5291-4aminus.IonXpress_028.fastq &> 028.tophat-checkInserts.log
cd tophatCheckIns_028;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_029 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R5-5291-4aminus.IonXpress_029.fastq &> 029.tophat-checkInserts.log
cd tophatCheckIns_029;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_030 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R6-5269-4fplus.IonXpress_030.fastq &> 030.tophat-checkInserts.log
cd tophatCheckIns_030;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_031 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R7-5269-4fplus.IonXpress_031.fastq &> 031.tophat-checkInserts.log
cd tophatCheckIns_031;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_032 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R8-5269-4fplus.IonXpress_032.fastq &> 032.tophat-checkInserts.log
cd tophatCheckIns_032;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
/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 tophatCheckIns_033 --keep-fasta-order  /data/images/proton2/run342/inserts/inserted-sequences-run342 R_2017_03_31_13_20_56_user_IONAS-342-DrKarakas_170330_YK3R1-13.YK3R9-5269-4fminus.IonXpress_033.fastq &> 033.tophat-checkInserts.log
cd tophatCheckIns_033;/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/images/proton2/run342/inserts/inserted-sequences-run342 -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/images/proton2/run342/inserts/inserted-sequences.fa.fai - > sort_uniq.bam; rm sort.bam; cd ..;
