annotate scripts/number_of_not_uniq_mapped_reads.sh @ 7:90098d9cb691 default tip

workflows updated
author biomonika <biomonika@psu.edu>
date Fri, 20 Feb 2015 18:34:34 -0500
parents 05c27700e5ca
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
1 #!/bin/bash
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
2 #sort_into_categories $contig
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
3 #family member with the biggest number of not uniquely mapped reads reported
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
4
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
5 dir=$1;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
6 contig=$2;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
7
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
8 all_unmapped1=`grep $contig statistics/stat_mother | cut -f 3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
9 high_qual_unmapped1=`grep $contig statistics/stat_mother_high | cut -f 3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
10 diff_mother1=`expr $all_unmapped1 - $high_qual_unmapped1`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
11 percentage1=`echo "scale=3; $diff_mother1/$all_unmapped1*100" | bc`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
12
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
13 all_unmapped2=`grep $contig statistics/stat_father | cut -f 3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
14 high_qual_unmapped2=`grep $contig statistics/stat_father_high | cut -f 3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
15 diff_mother2=`expr $all_unmapped2 - $high_qual_unmapped2`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
16 percentage2=`echo "scale=3; $diff_mother2/$all_unmapped2*100" | bc`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
17
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
18 all_unmapped3=`grep $contig statistics/stat_daughter | cut -f 3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
19 high_qual_unmapped3=`grep $contig statistics/stat_daughter_high | cut -f 3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
20 diff_mother3=`expr $all_unmapped3 - $high_qual_unmapped3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
21 percentage3=`echo "scale=3; $diff_mother3/$all_unmapped3*100" | bc`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
22
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
23 all_unmapped4=`grep $contig statistics/stat_son | cut -f 3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
24 high_qual_unmapped4=`grep $contig statistics/stat_son_high | cut -f 3`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
25 diff_mother4=`expr $all_unmapped4 - $high_qual_unmapped4`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
26 percentage4=`echo "scale=3; $diff_mother4/$all_unmapped4*100" | bc`;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
27
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
28 #searching for maximum - family member that has the biggest number of NOT uniquely mapped reads
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
29 if (( $(echo "$percentage1 > $percentage2"|bc -l) ));
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
30 then
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
31 max1="$percentage1";
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
32 else
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
33 max1="$percentage2";
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
34 fi
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
35
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
36 if (( $(echo "$percentage3 > $percentage4"|bc -l) ));
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
37 then
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
38 max2="$percentage3";
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
39 else
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
40 max2="$percentage4";
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
41 fi
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
42
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
43
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
44 if (( $(echo "$max1 > $max2"|bc -l) ));
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
45 then
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
46 percentage="$max1";
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
47 else
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
48 percentage="$max2";
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
49 fi
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
50
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
51 echo $percentage;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
52
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
53