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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
BT=${BT-../../bin/bedtools}
check()
{
if diff $1 $2; then
echo ok
return 1
else
echo fail
return 0
fi
}
# cat a.bed
# chr1 100 200 a1 1 +
# chr1 100 200 a2 2 -
###########################################################
# test shifting forward via -s
###########################################################
echo " shift.t1...\c"
echo \
"chr1 105 205 a1 1 +
chr1 105 205 a2 2 -" > exp
$BT shift -i a.bed -s 5 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test shifting backward via -s
###########################################################
echo " shift.t2...\c"
echo \
"chr1 95 195 a1 1 +
chr1 95 195 a2 2 -" > exp
$BT shift -i a.bed -s -5 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test shifting forward via -m and -p
###########################################################
echo " shift.t3...\c"
echo \
"chr1 105 205 a1 1 +
chr1 105 205 a2 2 -" > exp
$BT shift -i a.bed -p 5 -m 5 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test shifting backward via -m and -p
###########################################################
echo " shift.t3...\c"
echo \
"chr1 95 195 a1 1 +
chr1 95 195 a2 2 -" > exp
$BT shift -i a.bed -p -5 -m -5 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test just a -m shift (-p == 0)
###########################################################
echo " shift.t4...\c"
echo \
"chr1 100 200 a1 1 +
chr1 95 195 a2 2 -" > exp
$BT shift -i a.bed -m -5 -p 0 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test just a -p shift (-m == 0)
###########################################################
echo " shift.t5...\c"
echo \
"chr1 105 205 a1 1 +
chr1 100 200 a2 2 -" > exp
$BT shift -i a.bed -m 0 -p 5 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test going beyond the start of the chrom
###########################################################
echo " shift.t6...\c"
echo \
"chr1 0 1 a1 1 +
chr1 0 1 a2 2 -" > exp
$BT shift -i a.bed -s -200 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test going beyond the end of the chrom
###########################################################
echo " shift.t7...\c"
echo \
"chr1 999 1000 a1 1 +
chr1 999 1000 a2 2 -" > exp
$BT shift -i a.bed -s 1000 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test shift being larger than a signed int
###########################################################
echo " shift.t8...\c"
echo \
"chr1 999 1000 a1 1 +
chr1 999 1000 a2 2 -" > exp
$BT shift -i a.bed -s 3000000000 -g tiny.genome > obs
check obs exp
rm obs exp
###########################################################
# test shift huge genome
###########################################################
echo " shift.t9...\c"
echo \
"chr1 67000638 67217822 NM_032291 0 +
chr1 92146899 92352836 NR_036634 0 -" > exp
$BT shift -i b.bed -s 1000 -g huge.genome > obs
check obs exp
rm obs exp
|