/usr/share/bedtools/test/groupBy/test-groupby.sh is in bedtools 2.17.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | lines_a=$(../../bin/groupBy -g 3-1 -o collapse -c 4 -i ../map/values3.bed | wc -l)
lines_b=$(../../bin/groupBy -g 1-3 -o collapse -c 4 -i ../map/values3.bed | wc -l)
lines_c=$(../../bin/groupBy -g 1,2,3 -o collapse -c 4 -i ../map/values3.bed | wc -l)
lines_d=$(../../bin/groupBy -g 1-2,3 -o collapse -c 4 -i ../map/values3.bed | wc -l)
check(){
if [ "$1" != "$2" ]; then
echo "fail groupby" $1 $2
fi
}
check $lines_a $lines_b
check $lines_a $lines_c
check $lines_a $lines_d
H=$(head -n 1 values3.header.bed)
A=$(../../bin/bedtools groupby -i values3.header.bed -g 1,2,3 -c 4 -o concat -inheader | head -n 1)
if [ "$A" != $'chr1\t0\t10\ta1' ]; then
echo "fail groupby"
fi
B=$(../../bin/bedtools groupby -i values3.header.bed -g 1,2,3 -c 4 -o concat -header | head -n 1)
if [ "$B" != $'#chrom\tstart\tend\tconcat(A)' ]; then
echo "fail groupby"
fi
|