echo"***! Error! The number of reads in the fastqs (${wctotal}) is not the same as the number of alignable reads reported in the stats (${check4}) plus unmapped/ambiguous (${unmapamb}), likely due to a failure during alignment. Run relaunch_prep.sh"
echo"Reads don't add up. Check ${outputdir} for results"
if[$total-eq$total2];then rm aligned/merged_sort.txt;rm-r splits;else echo"Problem: The sum of merged_nodups and the dups files is not the same size as merged_sort.txt";fi
#bzip2 fastq/*.fastq
if[$total-eq$total2]
then
rm aligned/merged_sort.txt
rm-r splits
for i in fastq/*.fastq
do
gzip$i
done
gzip aligned/merged_nodups.txt
gzip aligned/dups.txt
gzip aligned/opt_dups.txt
gzip aligned/abnormal.sam
gzip aligned/collisions.txt
gzip aligned/unmapped.sam
else
echo"Problem: The sum of merged_nodups and the dups files is not the same size as merged_sort.txt"