1 | #!/bin/bash |
---|
2 | source tests/test_helper.sh |
---|
3 | |
---|
4 | TEST_ARB=$TEST_ARGS |
---|
5 | maketmpdir T |
---|
6 | |
---|
7 | cp $TEST_ARB $T/ref.arb |
---|
8 | |
---|
9 | SINA="./src/sina" |
---|
10 | |
---|
11 | begin_test "PREP" |
---|
12 | capture_stdouterr "$SINA -i $T/ref.arb -o $T/extracted.fasta --select-step 1000 --prealigned" |
---|
13 | assert_exit_success |
---|
14 | assert_output_contains "align 12 sequences" |
---|
15 | capture_stdouterr "$SINA -i $T/ref.arb -o $T/extracted.arb --select-step 1000 --prealigned" |
---|
16 | assert_exit_success |
---|
17 | assert_output_contains "align 12 sequences" |
---|
18 | end_test |
---|
19 | |
---|
20 | begin_test "Align from FASTA->FASTA" |
---|
21 | capture_stdouterr "$SINA -i $T/extracted.fasta -o $T/aligned.fasta --preserve-order --realign --db $T/extracted.arb" |
---|
22 | assert_output_contains "align 12 sequences" |
---|
23 | assert_exit_success |
---|
24 | end_test |
---|
25 | |
---|
26 | begin_test "Align from FASTA->FASTA(stdout)" |
---|
27 | capture_stdouterr "$SINA -i $T/extracted.fasta --preserve-order --realign --db $T/extracted.arb >$T/aligned.2.fasta" |
---|
28 | assert_output_contains "align 12 sequences" |
---|
29 | assert_exit_success |
---|
30 | capture_stdouterr "cmp $T/aligned.fasta $T/aligned.2.fasta" |
---|
31 | assert_exit_success |
---|
32 | end_test |
---|
33 | |
---|
34 | begin_test "Align from FASTA->ARB" |
---|
35 | capture_stdouterr "$SINA -i $T/extracted.fasta -o $T/aligned.arb --realign --db $T/extracted.arb" |
---|
36 | assert_output_contains "align 12 sequences" |
---|
37 | assert_exit_success |
---|
38 | end_test |
---|
39 | |
---|
40 | begin_test "Align from ARB->ARB" |
---|
41 | capture_stdouterr "$SINA -i $T/extracted.arb -o $T/aligned.arb --realign --db $T/extracted.arb" |
---|
42 | assert_output_contains "align 12 sequences" |
---|
43 | assert_exit_success |
---|
44 | end_test |
---|
45 | |
---|
46 | begin_test "Add relatives FASTA->FASTA" |
---|
47 | capture_stdouterr "$SINA -i $T/extracted.fasta -o $T/aligned.fasta --add-relatives 2 --db $T/ref.arb -v" |
---|
48 | assert_output_contains "align 12 sequences" |
---|
49 | assert_output_contains "wrote 36 sequences (0 excluded, 24 relatives)" |
---|
50 | end_test |
---|
51 | |
---|
52 | begin_test "Add relatives FASTA->ARB" |
---|
53 | capture_stdouterr "$SINA -i $T/extracted.fasta -o $T/aligned.arb --add-relatives 2 --db $T/ref.arb -v" |
---|
54 | assert_output_contains "align 12 sequences" |
---|
55 | assert_output_contains "wrote 36 sequences (0 excluded, 24 relatives)" |
---|
56 | end_test |
---|
57 | |
---|