This repository has been archived by the owner on Jun 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
tests.sh
57 lines (45 loc) · 1.58 KB
/
tests.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
A=`python -c "from pyfasta import Fasta; f = Fasta('tests/data/three_chrs.fasta', flatten_inplace=False); print f['chr1'][:3]"`
B=`python -c "from pyfasta import Fasta; f = Fasta('tests/data/three_chrs.fasta', flatten_inplace=True); print f['chr1'][:3]"`
if [ "$A" != "$B" ]
then
echo "$A=$B"
fi
F=`cat tests/data/three_chrs.fasta.flat`
if [ "$F" != "@flattened@" ]
then
echo "$F=@flattened@"
fi
rm -f tests/data/three_chrs.fasta.{flat,gdx}
C=`python -c "from pyfasta import Fasta; f = Fasta('tests/data/three_chrs.fasta', flatten_inplace=True); print f['chr1'][:3]"`
D=`python -c "from pyfasta import Fasta; f = Fasta('tests/data/three_chrs.fasta', flatten_inplace=False); print f['chr1'][:3]"`
if [ "$C" != "$D" ]
then
echo "$C=$D"
fi
F=`cat tests/data/three_chrs.fasta.flat`
if [ "$F" != "@flattened@" ]
then
echo "$F=@flattened@"
fi
rm -f tests/data/three_chrs.fasta.{flat,gdx}
I=`python pyfasta/__init__.py info tests/data/three_chrs.fasta`
rm -f tests/data/three_chrs.fasta.{flat,gdx}
# now make sure it works with inplace, and doesnt update.flat
C=`python -c "from pyfasta import Fasta; f = Fasta('tests/data/three_chrs.fasta', flatten_inplace=True); print f['chr1'][:3]"`
J=`python pyfasta/__init__.py info tests/data/three_chrs.fasta`
if [ "$I" != "$J" ]
then
echo "BADDD"
fi
F=`cat tests/data/three_chrs.fasta.flat`
if [ "$F" != "@flattened@" ]
then
echo "BADD"
fi
rm -f tests/data/three_chrs.fasta.{flat,gdx}
C=$(python pyfasta/__init__.py extract --fasta tests/data/key.fasta "a extra")
if [ $C != "a" ]
then
echo "BADD"
fi
rm -f tests/data/key.fasta.{flat,gdx}