OSDN Git Service

Initial commit.
[crnpred/crnpred.git] / bin / run_crn.sh
1 #!/bin/sh
2
3 DB=uniref100
4 method=crnpred
5
6 Usage () {
7 echo "Usage: $0 [-m method] [-d DB] input_seq"
8 echo "  input_seq: protein sequence in the FASTA format."
9 echo "  method: 'crnpred2k', 'crnpred5k' or 'linear' (default: crnpred2k)"
10 echo "  DB: BLAST sequence database (default: uniref100)"
11 exit 2
12 }
13
14 #Usage
15 args=`getopt m:d:h $*`
16 set -- $args
17
18 for i in $*; do
19   case "$i" in
20     -m) method=$2; shift 2;;
21     -d) DB=$2; shift 2;;
22     -h) Usage ;;
23     --) shift; break;;
24   esac
25 done
26 inseq=${1}
27
28 if [ "hoge${inseq}" = "hoge" ]; then
29   Usage
30 fi
31
32 prof=`basename ${inseq}`.d.prof
33 fout=`basename ${inseq}`.d.out
34
35 blastpgp -d $DB -h 0.0005 -j 3 -i $inseq -Q $prof > /dev/null 2>&1 
36
37 echo "# Input sequence" > $fout
38 cat $inseq >> $fout
39 echo '' >> $fout
40 echo '' >> $fout
41
42 echo "*** SS, CN, RWCO predictions..."
43 if [ "$method" = "crnpred2k" ]; then
44   echo "   prediction by CRN2000 (takes some time...)"
45   ${CRNPRED_DIR}/bin/xpredm2000 $prof >> $fout
46 elif [ "$method" = "crnpred5k" ]; then
47   echo "   prediction by CRN5000 (takes some time...)"
48   ${CRNPRED_DIR}/bin/xpredm5000 $prof >> $fout
49 else
50   echo "   prediction by linear method"
51   ${CRNPRED_DIR}/bin/lpredm $prof >> $fout
52 fi