Debian Codegraph @

test/fisher/test-fisher.sh

raw symbols SCIP
1 set -e;
2 BT=${BT-../../bin/bedtools}
3
4 FAILURES=0;
5
6 checkscip-shell shell bedtools 2.31.1+dfsg-3 check().()
7 {
8 if diffscip-shell system . . diff. $1 $2; then
9 echoscip-shell system . . echo. ok
10
11 else
12 FAILURES=$(exprscip-shell system . . expr. $FAILURES + 1);
13 echoscip-shell system . . echo. fail
14
15 fi
16 }
17
18 echoscip-shell system . . echo. -e " fisher.t1...\c"
19 echoscip-shell system . . echo. \
20 "# Number of query intervals: 3
21 # Number of db intervals: 2
22 # Number of overlaps: 2
23 # Number of possible intervals (estimated): 34
24 # phyper(2 - 1, 3, 34 - 3, 2, lower.tail=F)
25 # Contingency Table Of Counts
26 #_________________________________________
27 # | in -b | not in -b |
28 # in -a | 2 | 1 |
29 # not in -a | 0 | 31 |
30 #_________________________________________
31 # p-values for fisher's exact test
32 left right two-tail ratio
33 1 0.0053476 0.0053476 inf" > exp
34 $BT fisher -a a.bed -b b.bed -g t.500.genome > obs
35 checkscip-shell shell bedtools 2.31.1+dfsg-3 check(). obs exp
36 rmscip-shell system . . rm. obs exp
37
38
39 echoscip-shell system . . echo. -e " fisher.t2...\c"
40 echoscip-shell system . . echo. \
41 "# Number of query intervals: 3
42 # Number of db intervals: 2
43 # Number of overlaps: 2
44 # Number of possible intervals (estimated): 4
45 # phyper(2 - 1, 3, 4 - 3, 2, lower.tail=F)
46 # Contingency Table Of Counts
47 #_________________________________________
48 # | in -b | not in -b |
49 # in -a | 2 | 1 |
50 # not in -a | 0 | 1 |
51 #_________________________________________
52 # p-values for fisher's exact test
53 left right two-tail ratio
54 1 0.5 1 inf" > exp
55 $BT fisher -a a.bed -b b.bed -g t.60.genome > obs
56 checkscip-shell shell bedtools 2.31.1+dfsg-3 check(). obs exp
57 rmscip-shell system . . rm. obs exp
58
59
60 echoscip-shell system . . echo. -e " fisher.t3...\c"
61 echoscip-shell system . . echo. \
62 "# Number of query intervals: 4
63 # Number of db intervals: 2
64 # Number of overlaps: 3
65 # Number of possible intervals (estimated): 4
66 # phyper(3 - 1, 4, 4 - 4, 2, lower.tail=F)
67 # Contingency Table Of Counts
68 #_________________________________________
69 # | in -b | not in -b |
70 # in -a | 3 | 1 |
71 # not in -a | 0 | 0 |
72 #_________________________________________
73 # p-values for fisher's exact test
74 left right two-tail ratio
75 1 1 1 -nan" > exp
76 $BT fisher -a a_merge.bed -b b.bed -g t.60.genome > obs
77 checkscip-shell shell bedtools 2.31.1+dfsg-3 check(). obs exp
78 rmscip-shell system . . rm. obs exp
79
80
81 echoscip-shell system . . echo. -e " fisher.t4...\c"
82 echoscip-shell system . . echo. \
83 "# Number of query intervals: 3
84 # Number of db intervals: 2
85 # Number of overlaps: 2
86 # Number of possible intervals (estimated): 4
87 # phyper(2 - 1, 3, 4 - 3, 2, lower.tail=F)
88 # Contingency Table Of Counts
89 #_________________________________________
90 # | in -b | not in -b |
91 # in -a | 2 | 1 |
92 # not in -a | 0 | 1 |
93 #_________________________________________
94 # p-values for fisher's exact test
95 left right two-tail ratio
96 1 0.5 1 inf" > exp
97 $BT fisher -a a_merge.bed -b b.bed -g t.60.genome -m > obs
98 checkscip-shell shell bedtools 2.31.1+dfsg-3 check(). obs exp
99 rmscip-shell system . . rm. obs exp
100 [[ $FAILURES -eq 0 ]] || exit 1;
101
102 echoscip-shell system . . echo. -e " fisher.t5...\c"
103 $BT fisher -b test.bed -a tumor.gff -g dm6.fai > exp
104 DIR="${TMPDIR:-/tmp}/Users/mvandenb/src/genomic_features_bardin_lab/build/modencode/dm6/bed/"
105 LONG_PATH="$DIR/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaS-\(phospho-S2\)_.bed"
106 mkdirscip-shell system . . mkdir. -p "$DIR"
107 cpscip-shell system . . cp. test.bed "$LONG_PATH"
108 $BT fisher -b "$LONG_PATH" -a tumor.gff -g dm6.fai > obs
109 checkscip-shell shell bedtools 2.31.1+dfsg-3 check(). obs exp
110 rmscip-shell system . . rm. obs exp
111 [[ $FAILURES -eq 0 ]] || exit 1;
112
113
114 # Regression test for issue 954
115 echoscip-shell system . . echo. -e " fisher.t6...\c"
116 echoscip-shell system . . echo. \
117 "# Number of query intervals: 5
118 # Number of db intervals: 9
119 # Number of overlaps: 2
120 # Number of possible intervals (estimated): 74
121 # phyper(2 - 1, 5, 74 - 5, 9, lower.tail=F)
122 # Contingency Table Of Counts
123 #_________________________________________
124 # | in -b | not in -b |
125 # in -a | 2 | 3 |
126 # not in -a | 7 | 62 |
127 #_________________________________________
128 # p-values for fisher's exact test
129 left right two-tail ratio
130 0.98864 0.10898 0.10898 5.905" > exp
131 $BT fisher -a issue954_a.bed -b issue954_b.bed -g issue954.genome > obs
132 checkscip-shell shell bedtools 2.31.1+dfsg-3 check(). obs exp
133 rmscip-shell system . . rm. obs exp
134 [[ $FAILURES -eq 0 ]] || exit 1;