annotate scripts/test.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 #example usage: ./test.sh comp100628_c0_seq1 5 A/contig_pos_ref_alt_father mother.bam
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
3
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
4 contig_to_check=$1
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
5 percentage=$2
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
6 forbidden=$3
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
7 bam=$4
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
8 dir=$5;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
9
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
10 hits=0;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
11
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
12 grep $contig_to_check $forbidden | (while read line; do
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
13
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
14 #tresholds described in table 1C
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
15 result=`bash ${LINKYX_PATH}/scripts/contains_these_variants.sh $percentage $bam ${line}`
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
16
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
17 echo "result: " $result >>kontrola;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
18 hits=$(($hits + $result))
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
19 echo "hits: " $hits >>kontrola;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
20 done;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
21
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
22 echo $hits;
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
23 )
05c27700e5ca initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
24