File: test-bigchroms.sh

package info (click to toggle)
bedtools 2.30.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 56,588 kB
  • sloc: ansic: 38,500; cpp: 29,738; sh: 7,955; makefile: 661; python: 235; javascript: 16
file content (66 lines) | stat: -rw-r--r-- 1,310 bytes parent folder | download | duplicates (3)
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
set -e;

BT=${BT-../../bin/bedtools}

FAILURES=0;

check()
{
	if diff $1 $2; then
    	echo ok
	else
    	FAILURES=$(expr $FAILURES + 1);
		echo fail
	fi
}

###########################################################
#  Test a basic self intersection
############################################################
echo -e "    bigchroms.t01...\c"
$BT intersect -sorted -a abig.bed -b abig.bed > obs
check obs abig.bed
rm obs

echo -e "    bigchroms.t02...\c"
$BT intersect -a abig.bed -b abig.bed > obs
check obs abig.bed
rm obs

if [[ "$BT_NO_BIG_FILES" != "" ]]; then
python3 make-big-chrom.py

echo -e "    bigchroms.t03...big get fasta \c"
$BT getfasta -fi bigx.fasta -bed bigx.bed | tail -1 > obs
echo "ACTGACCCCGAGACGTTTGCATCCTGCACAGCTAGAGATCCTTTATTAAAAGCACACTGT" > exp
check obs exp
rm obs exp

rm bigx.fasta*

else

echo -e "    bigchroms.t03... skip \c"
echo " set env var 'BT_NO_BIG_FILES' to run this test"
fi

echo -e "    bigchroms.t04... merge \c"

echo "chr1	1	9000000000" > exp
$BT merge -i big4.bed > obs
check obs exp
rm obs exp


echo -e "    bigchroms.t05... closest \c"
$BT closest -a big4c.bed -b big4.bed  > obs

echo "chr1	1	10	chr1	1	10
chr1	1	10	chr1	9	8000000000
chr1	8900000000	9000000000	chr1	8000000000	9000000000" > exp
check obs exp
rm obs exp

[[ $FAILURES -eq 0 ]] || exit 1;