File: test.sh

package info (click to toggle)
grabix 0.1.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,564 kB
  • sloc: ansic: 917; cpp: 320; sh: 124; python: 43; makefile: 18
file content (33 lines) | stat: -rw-r--r-- 637 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
#!/bin/sh
unset GZIP
FQ=test.cnt.gz
rm -f ${FQ}{,.gbi}

lines=500000
python3 tests/make-test-fastq.py $lines | bgzip -c > $FQ
echo "indexing"
time grabix index $FQ
echo "indexed"
python3 tests/test-fastq.py $FQ
a=$(grabix grab test.cnt.gz $(($lines * 4)))
b=$(zless $FQ | tail -1)
if [ "$a" != "$b" ] ; then
	echo FAIL last record
fi
rm -f ${FQ}{,.gbi}

for V in `find . -name *.vcf -type f` ; do
	rm -f ${V}.*
	bgzip -f $V
	grabix index ${V}.gz
	sleep 1
	exp=$(zgrep -cv "#" $V.gz)
	obs=$(grabix size $V.gz)

	if [ "$exp" != "$obs" ] ; then
		echo "FAIL: $V: expected $exp lines found $obs"
	else 
		echo "OK $V"
	fi
	rm -f ${V}.*
done