File: fastaexpode.test.sh

package info (click to toggle)
exonerate 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,532 kB
  • ctags: 3,892
  • sloc: ansic: 40,966; sh: 3,257; makefile: 811
file content (53 lines) | stat: -rwxr-xr-x 1,108 bytes parent folder | download | duplicates (6)
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
#!/bin/sh
# test for fastaexpode utility

FASTAEXPLODE="../../src/util/fastaexplode"
INPUTDIR="../data/protein"
INPUTFILE="fastaexplode.test.fasta"
OUTPUTDIR="fastaexplode.out_dir.test.fasta"

clean_exit(){
    rm -f $INPUTFILE
    rm -rf $OUTPUTDIR
    exit $1
    }

cat ${INPUTDIR}/*.fasta > $INPUTFILE
if [ $? -eq 0 ]
then
    echo Made input file for fastaexplode
else
    echo Problem making input file for fastaexplode
    clean_exit 1
fi

mkdir $OUTPUTDIR
if [ $? -eq 0 ]
then
    echo Make output directory for fastaexplode
else
    echo Problem making output directory for fastaexplode
    clean_exit 1
fi

$FASTAEXPLODE $INPUTFILE --directory $OUTPUTDIR
if [ $? -eq 0 ]
then
    echo Successfully ran fastaexplode on: $INPUTFILE
else
    echo Problem running fastaexplode on: $INPUTFILE
    clean_exit 1
fi

TOTALINPUT=`grep -c '^>' $INPUTFILE`
TOTALOUTPUT=`ls -1 ${OUTPUTDIR}/*.fa | wc -l`
if [ $TOTALINPUT -eq $TOTALOUTPUT ]
then
    echo Expected number of seqs in output: $TOTALINPUT
else
    echo Mismathed number of seqs in output $TOTALINPUT,$TOTALOUTPUT
    clean_exit 1
fi

clean_exit 0