-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtest.sh
executable file
·59 lines (41 loc) · 1.66 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# doctests
python cpv/stouffer_liptak.py
python cpv/_common.py
##################################################################
python cpv/peaks.py --dist 50 --seed 0.02 data/close_peaks.bed > t
d=$(wc -l t | awk '{ print $1}')
test $d -ne 1 && echo "ERROR" $d
##################################################################
python cpv/peaks.py --dist 1 --seed 0.02 data/close_peaks.bed > t
python cpv/pipeline.py
d=$(wc -l t | awk '{ print $1}')
test $d -ne 2 && echo "ERROR" $d
##########################################################################
for dist in 1 1000 10000000; do
python cpv/peaks.py --dist $dist --seed 0.05 data/overlapping_peaks.bed > t
d=$(wc -l t | awk '{ print $1}')
test $d -ne 1 && echo "ERROR" $d
done
./cpv/comb-p hist -c 5 cpv/tests/data/pvals.bed > t
# unittests.
python cpv/tests/test.py
# the sum of the partials should add up the the final number in
# the non-partial
psum=$(python cpv/acf.py cpv/tests/data/pvals.bed -c 5 -d 1:500:50 \
| awk '(NR > 1){ s += $4; }END{ print s}')
npsum=$(python cpv/acf.py cpv/tests/data/pvals.bed -c 5 -d 1:500:50 --full \
| awk '(NR > 1){ s=$4 }END{ print s }')
test $psum -ne $npsum && echo "ERROR in ACF"
# test the acf output is as expected.
md=$(python cpv/acf.py -d 1:240:60 cpv/tests/data/pvals.bed -c 5 | md5sum \
| awk '{ print $1 }')
md_expected=$(md5sum cpv/tests/data/expected_acf.txt | awk '{ print $1 }')
if [ $md != $md_expected ]; then
echo "ACF OUTPUT different"
echo $md
echo $md_expected
fi
rm t
set -ex
python ./cpv/comb-p pipeline -c pvalue -p out --seed 0.05 --dist 1000 --region-filter-p 0.1 --region-filter-n 4 examples/file.bed