0
|
1 #!/bin/bash
|
|
2 #sort_into_categories $contig
|
|
3 #family member with the biggest number of not uniquely mapped reads reported
|
|
4
|
|
5 dir=$1;
|
|
6 contig=$2;
|
|
7
|
|
8 all_unmapped1=`grep $contig statistics/stat_mother | cut -f 3`;
|
|
9 high_qual_unmapped1=`grep $contig statistics/stat_mother_high | cut -f 3`;
|
|
10 diff_mother1=`expr $all_unmapped1 - $high_qual_unmapped1`;
|
|
11 percentage1=`echo "scale=3; $diff_mother1/$all_unmapped1*100" | bc`;
|
|
12
|
|
13 all_unmapped2=`grep $contig statistics/stat_father | cut -f 3`;
|
|
14 high_qual_unmapped2=`grep $contig statistics/stat_father_high | cut -f 3`;
|
|
15 diff_mother2=`expr $all_unmapped2 - $high_qual_unmapped2`;
|
|
16 percentage2=`echo "scale=3; $diff_mother2/$all_unmapped2*100" | bc`;
|
|
17
|
|
18 all_unmapped3=`grep $contig statistics/stat_daughter | cut -f 3`;
|
|
19 high_qual_unmapped3=`grep $contig statistics/stat_daughter_high | cut -f 3`;
|
|
20 diff_mother3=`expr $all_unmapped3 - $high_qual_unmapped3`;
|
|
21 percentage3=`echo "scale=3; $diff_mother3/$all_unmapped3*100" | bc`;
|
|
22
|
|
23 all_unmapped4=`grep $contig statistics/stat_son | cut -f 3`;
|
|
24 high_qual_unmapped4=`grep $contig statistics/stat_son_high | cut -f 3`;
|
|
25 diff_mother4=`expr $all_unmapped4 - $high_qual_unmapped4`;
|
|
26 percentage4=`echo "scale=3; $diff_mother4/$all_unmapped4*100" | bc`;
|
|
27
|
|
28 #searching for maximum - family member that has the biggest number of NOT uniquely mapped reads
|
|
29 if (( $(echo "$percentage1 > $percentage2"|bc -l) ));
|
|
30 then
|
|
31 max1="$percentage1";
|
|
32 else
|
|
33 max1="$percentage2";
|
|
34 fi
|
|
35
|
|
36 if (( $(echo "$percentage3 > $percentage4"|bc -l) ));
|
|
37 then
|
|
38 max2="$percentage3";
|
|
39 else
|
|
40 max2="$percentage4";
|
|
41 fi
|
|
42
|
|
43
|
|
44 if (( $(echo "$max1 > $max2"|bc -l) ));
|
|
45 then
|
|
46 percentage="$max1";
|
|
47 else
|
|
48 percentage="$max2";
|
|
49 fi
|
|
50
|
|
51 echo $percentage;
|
|
52
|
|
53
|