annotate [APliBio]Nebula tools suite/Nebula/AnnotateGenes/annotateGenes_wrapper.sh @ 0:2ec3ba0e9e70 draft

Uploaded
author alermine
date Thu, 25 Oct 2012 08:18:25 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
1 #:::::::::::::::::::::::::g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@j::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
2 #::::::::::::::::::::::;g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E:::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
3 #:ttt:::::::::::::::::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@p@;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
4 #:t:::::::::::::::::g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
5 #:t::::::::::::::;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
6 #:::::::::::::z;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
7 #::::::::::::i@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
8 #::::::::::::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
9 #:::::::::::3@@@@@@@@@@@@@@@@@@@@@@@@@B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
10 #::::::::::3@@@@@@@@@@@@@@@@@@@@@BEEESSE5EEEEBBM@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
11 #::::::::::3@@@@@@@@@@@@@@@@@@@@BEEEEEE35EE55E2355E5SBMB@@@@@@@@@@@@@@@@@$
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
12 #::::::::::@@@@@@@@@@@@@@@@@@@EEEE55533t3tttt::::::!!!!7755E755SBBMMM@@@MM
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
13 #::::::::::3@@@@@@@@@@@@@@@@@@EEEE2t3ttttt:::::::::::::::::::::::!7?5225EE
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
14 #::::::::::3@@@@@@@@@@@@@@@@@@EEEEE31t::::::::::::::::::::::::::::::::3E5@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
15 #::::::::::3@@@@@@@@@@@@@@@@@@EEEEEEtt:::::::::::::::::::::::::::::::::353
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
16 #::::::::::3@@@@@@@@@@@@@@@@@@EEEEEE1ttz::::::::::::::::::::::::::::::::35
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
17 #:::::::::::@@@@@@@@@@@@@@@@@@EEEEEEEtz1::::::::::::::::::::::::::::::::t:
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
18 #:::::::::!3@@@@@@@@@@@@@@@@@@@EEEEEttt::::::::::::::::::::::::::::::::;zz
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
19 #::::::::::@@@@@@@@@@@@@@@@@@@@EEEEEttt:::::z;z:::::::::::::::::::::::::13
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
20 #::::::::::3B@@@@@@@@@@@@@@@@@@EEEEEEE3tt:czzztti;:::::::::::::::::::::::3
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
21 #::::ttt::::3@@@@@@@@@@@@@@@@EEEEE5EE25Ezt1EEEz5Etzzz;;;;:::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
22 #:::::::::::I9@@@@@@@@@@@@@@@@@@@@@@@@@@EEEEEE@@@@@@@@@@@@@@Ez;:::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
23 #:::::::::::::E@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Ez::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
24 #::::::::::::::E@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BE5EBB@@@@@@@@@@@@@@@EEE:::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
25 #:::::::::::::::@@@@@@@@@@@@@@@@@@@@@@@@@@@@E1::35@@@@@@@@@@ME3MMME2::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
26 #:::::::::::::::?@@@@@@@@@@@@@@@@@@M@@@@@@@EE:::::3SB@@BBESEEt::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
27 #::::::::::::::::J$@@@@@@@B@@@@@@@@@@@@@@@@EE:::::::!35E33t:::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
28 #:::::::::::::::::3@E@@@EE5EESE5EESE@@@@@@@Et::::::::::::tz:::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
29 #:::::::::::::::::J@E$@EEE5133555SE@@@@@@@@Et:::::::::::::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
30 #::::::::::::::::::E@E@EEEEtt3523EEE@@@@@@@E::::::::::::::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
31 #:t::::::::::::::::JEE3@@@EEEEEEEEEE@@@@@@@E:::::::::t;:::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
32 #:t:::::::::::::::::!5ES@EEEEEEEEES@@@@@@@@@E;:::;;;:3Ez::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
33 #:t::::::::::::::::::::JE@@EEEEEEE@@@@@@@@@@@@@@@@ME!:::;:::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
34 #:tz::::::::::::::::::::JE@@@EEEE@@@@@@@@@@@@@@EE!:::::::t::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
35 #:t::::::::::::::::::::::3@@@@@@@@@@@@@@@@@@ESBE::::::::::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
36 #:::::::::::::::::::::::::Q@@@@@@@@@@@@@@@@EE3EE;:::::zzzz::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
37 #:::::::::::::::::::::::::3@@@@@@@@@@@@@@@@@@@@@@NN@@@@@@Ez:::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
38 #:zt:::::::::::::::::::::::3@@@@EE@@@@@@@@@@EEEEt::;z113E5t:::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
39 #::tt:::::::::::::::::::::::3@@@E@@@@@@@@@@@@@@@@BEt::::::::::::::::t:::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
40 #:tt:t:::::::::::::::::::::::?S@@@@@@@@@@@BBEEE51!::::::::::::::zzzEt:::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
41 #::::::::::::::::::::::::::::::3Q@@@@@@@BEEEEEt:::::::::::::;zz@@@EE::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
42 #::::::::::::::::::::::::::::::::75B@@@@@EEEtt;:::::::::;zz@@@@BEEEtz:::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
43 #::::::::::::::::::::::::::::::::::::?9@@@@@@@@@@@E2Ezg@@@@@B@@@EEEE1t::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
44 #:::::::::::::::::::::::::::::::::::::::3@@@@@@@@@@@@@@@@@@@E@EEEEEEEzzz::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
45 #::::::::::::::::::::::::::::::::::::;@@@@@@@@@@@@@@@@@@@@@@@EEEEEEE5ttttt
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
46 #:::::::::::::::::::::::::::::::;g@@@@@@@@@@@@@@@@@@@@@@@@@@EEEEEEEEEEEtzt
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
47 #::::::::::::::::::::::::::::;@@@@@@@@@@@@@@@@@@@@@@@@@@E@@EEEEEEEEEEEE@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
48 #::::::::::::::::::::::::::g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@EEEE3EEEE@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
49 #:::::::::::::::::::::;;g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@EEEt33@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
50 #:::::::::::::::::;g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@@@EEEtg@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
51 #::::::::::::::;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@EEEE@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
52 #:::::::::::::@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
53 #::::::::::;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
54 #
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
55 # Copyleft ↄ⃝ 2012 Institut Curie
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
56 # Author(s): Valentina Boeva, Alban Lermine (Institut Curie) 2012
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
57 # Contact: valentina.boeva@curie.fr, alban.lermine@curie.fr
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
58 # This software is distributed under the terms of the GNU General
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
59 # Public License, either Version 2, June 1991 or Version 3, June 2007.
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
60
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
61 #!/bin/bash
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
62
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
63 REG="NA"
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
64 CONTROLFILE="NA"
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
65 BOOTSTRAP=1
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
66
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
67 while getopts "f:c:l:o:r:u:v:e:h:d:x:y:p:b:" optionName; do
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
68 case "$optionName" in
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
69
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
70 f) CHIPFILE="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
71 c) CONTROLFILE="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
72 l) LEFTPROM="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
73 r) RIGHTPROM="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
74 o) OUTPUT="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
75 u) OUTSTAT="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
76 v) GENOME="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
77 e) REG="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
78 h) ENH="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
79 d) DOWNGENE="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
80 x) CONTROLSTAT="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
81 y) LOG="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
82 p) PDF="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
83 b) BOOTSTRAP="$OPTARG";;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
84 esac
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
85 done
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
86
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
87 LOCAL_DIR=`( cd -P $(dirname $0); pwd)`
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
88
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
89 echo "ChIP:" >$LOG
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
90
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
91 if [ -r $REG ]; then
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
92 perl $LOCAL_DIR/geneAnnotation.pl -g $LOCAL_DIR/$GENOME.noIdenticalTransc.txt -tf $CHIPFILE -selG $REG -o $OUTSTAT -lp $LEFTPROM -rightp $RIGHTPROM -enh $ENH -dg $DOWNGENE >>$LOG 2>>/dev/null
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
93 else
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
94 perl $LOCAL_DIR/geneAnnotation.pl -g $LOCAL_DIR/$GENOME.noIdenticalTransc.txt -tf $CHIPFILE -o $OUTSTAT -lp $LEFTPROM -rightp $RIGHTPROM -enh $ENH -dg $DOWNGENE >>$LOG 2>>/dev/null
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
95 fi
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
96
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
97
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
98
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
99 if [ -r $CONTROLFILE ]; then
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
100 echo "" >>$LOG
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
101 echo "Control:" >>$LOG
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
102 #create a subset of control peaks (highest peaks, the same number as in the sample)
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
103 perl $LOCAL_DIR/createControlPeakSubSet.pl -f $CHIPFILE -c $CONTROLFILE -o $CONTROLFILE.tmp -n $BOOTSTRAP >>$LOGTMP 2>>$LOGTMP
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
104 if [ -r $REG ]; then
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
105 perl $LOCAL_DIR/geneAnnotation.pl -g $LOCAL_DIR/$GENOME.noIdenticalTransc.txt -tf $CONTROLFILE.tmp -selG $REG -o $CONTROLSTAT -lp $LEFTPROM -rightp $RIGHTPROM -enh $ENH -dg $DOWNGENE >>$LOG 2>>/dev/null
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
106 for (( i=2; i<=$BOOTSTRAP; i++ ))
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
107 do
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
108 perl $LOCAL_DIR/geneAnnotation.pl -g $LOCAL_DIR/$GENOME.noIdenticalTransc.txt -tf $CONTROLFILE.tmp$i -selG $REG -o $CONTROLSTAT$i -lp $LEFTPROM -rightp $RIGHTPROM -enh $ENH -dg $DOWNGENE >>$LOG 2>>/dev/null
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
109 done
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
110 else
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
111 perl $LOCAL_DIR/geneAnnotation.pl -g $LOCAL_DIR/$GENOME.noIdenticalTransc.txt -tf $CONTROLFILE.tmp -o $CONTROLSTAT -lp $LEFTPROM -rightp $RIGHTPROM -enh $ENH -dg $DOWNGENE >>$LOG 2>>/dev/null
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
112 for (( i=2; i<=$BOOTSTRAP; i++ ))
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
113 do
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
114 perl $LOCAL_DIR/geneAnnotation.pl -g $LOCAL_DIR/$GENOME.noIdenticalTransc.txt -tf $CONTROLFILE.tmp$i -o $CONTROLSTAT$i -lp $LEFTPROM -rightp $RIGHTPROM -enh $ENH -dg $DOWNGENE >>$LOG 2>>/dev/null
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
115 done
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
116
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
117 fi
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
118 cat $LOCAL_DIR/geneDist.R | R --slave --args $OUTSTAT $OUTPUT $LOG $CONTROLSTAT $PDF $BOOTSTRAP 2>>/dev/null >>/dev/null
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
119 else
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
120 cat $LOCAL_DIR/geneDist.R | R --slave --args $OUTSTAT $OUTPUT $LOG $PDF 2>>/dev/null >>/dev/null
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
121 fi
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
122
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
123 if [ -r $OUTPUT.annotated ]; then
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
124 rm $OUTPUT.annotated*
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
125 fi
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
126
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
127
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
128 if [ -r $CONTROLFILE.tmp ]; then
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
129 rm $CONTROLFILE.tmp*
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
130 fi
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
131