ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/trunk/modelit/scripts/runall.sh
Revision: 1299
Committed: Tue Jan 11 17:38:33 2011 UTC (8 years, 8 months ago) by hstehr
File size: 5567 byte(s)
Log Message:
adding Model-It server files to repository
Line File contents
1 #!/bin/sh
2 # Script to run the whole CASP prediction pipeline
3 # Cluster ready: to submit it with qsub, just make sure you use absolute paths
4
5
6 ## CONSTANTS
7 bindir=/project/StruPPi/CASP8/scripts
8 tmpdir=/tmp
9
10 DEFAULT_PDBBLASTDB=seqs_pdbase_20080903.fix.reps.fa
11 DEFAULT_MAX_HITS=20
12 DEFAULT_PSIBLAST_ITER=5
13
14 paulSpeed=slow
15
16 cts="Ca,Cg"
17 dists="8.0,8.0"
18 numDistgeomModels=40
19 DEFAULT_CCT="0.4"
20
21 DEFAULT_GTG_DIR="/project/StruPPi/CASP8/gtg"
22
23 CASP_AUTHOR="3757_3251_6331"
24
25 CASP_METHOD_FILE="/project/StruPPi/CASP8/scripts/method.txt"
26
27 ## OPTIONS
28
29 targetseqfile=""
30 outdir=""
31 pdbblastdb="$DEFAULT_PDBBLASTDB"
32 psiblastopt=""
33 psiblastIter="$DEFAULT_PSIBLAST_ITER"
34 templatefile=""
35 skiptinkeropt=""
36 CCT="$DEFAULT_CCT"
37 selectTemplates=""
38 gtgDir=$DEFAULT_GTG_DIR
39 maxHits=$DEFAULT_MAX_HITS
40 noPhiPsi=""
41 noTransOmega=""
42
43 while getopts i:o:Kj:DP:G:t:s:l:x:FO opt
44 do
45 case "$opt" in
46 i) targetseqfile="$OPTARG";;
47 o) outdir="$OPTARG";;
48 K) psiblastopt="-K";;
49 j) psiblastIter="$OPTARG";;
50 D) skiptinkeropt="-D";;
51 P) pdbblastdb="$OPTARG";;
52 G) gtgDir="$OPTARG";;
53 t) templatefile="$OPTARG";;
54 s) CCT="$OPTARG";;
55 l) selectTemplates="$OPTARG";;
56 x) maxHits="$OPTARG";;
57 F) noPhiPsi="-F";;
58 O) noTransOmega="-O";;
59 esac
60 done
61
62
63 if [ -z "$targetseqfile" ] || [ -z "$outdir" ]
64 then
65 echo "Usage: $0 "
66 echo " -i <file> : the target sequence file"
67 echo " -o <dir> : the output directory"
68 echo " [-K] : no psiblast, just blast"
69 echo " [-j <number>] : number of psiblast iterations, default: $DEFAULT_PSIBLAST_ITER"
70 echo " [-D] : no Tinker reconstruction, just output average graph"
71 echo " [-P <blast db>] : PDB blast db, default: $DEFAULT_PDBBLASTDB"
72 echo " [-G <dir>] : directory containing GTG output, default: $DEFAULT_GTG_DIR"
73 echo " [-t <file>] : specifying a templates list file, no template selection step is performed (skip STEP 1)"
74 echo " [-s <number>] : CCT (contact conservation threshold) for the graph averaging step, default: $DEFAULT_CCT"
75 echo " [-l <B, P or G>]: forces selection of (B)LAST template list, (P)SIBLAST template list or (G)TG template list (even if they are empty!)"
76 echo " [-x <number>] : a hard maximum for the number of hits to be taken in the template selection step, default: $DEFAULT_MAX_HITS"
77 echo " [-F] : don't use phi/psi constraints for reconstruction. Default: phi/psi constraints used"
78 echo " [-O] : don't enforce trans conformation for omega torsion angle (peptide bond). Default: enforcing"
79 echo ""
80 echo "REMEMBER: always use absolute paths to run this script in the cluster"
81 echo ""
82 exit 1
83
84 fi
85
86
87
88
89
90 ## file definitions
91 basename=`basename $targetseqfile .fa`
92 templatesAlnFile=$outdir/$basename.templates_aln.fasta
93 target2templAlnFile=$outdir/$basename.target2templ.fasta
94 tcoffeelog=$outdir/$basename.tcoffee.log
95 ssCompareFile=$outdir/$basename.ss.compare
96 psipredFile=$outdir/$basename.horiz #input file!
97
98 ### STEP 1: template selection
99 if [ -z "$templatefile" ]
100 then
101 echo "################################################"
102 echo "# STEP 1: TEMPLATE SELECTION"
103 echo "################################################"
104
105 templatefile=$outdir/$basename.templates
106
107 selectTemplatesOpt=""
108 if [ -n "$selectTemplates" ]
109 then
110 selectTemplatesOpt="-l $selectTemplates"
111 fi
112 $bindir/templateSelection -i $targetseqfile -o $outdir -P $pdbblastdb -b $basename -G $gtgDir $psiblastopt $selectTemplatesOpt -x $maxHits -j $psiblastIter
113
114 numTemps=`cat $templatefile | wc -l`
115 if [ "$numTemps" -eq "0" ]
116 then
117 echo "NO TEMPLATES FOUND, CAN'T MODEL!"
118 exit 1
119 fi
120 fi
121
122 ### STEP 2: structural alignment of templates
123 echo "################################################"
124 echo "# STEP 2: STRUCTURAL ALIGNMENT OF TEMPLATES"
125 echo "################################################"
126 $bindir/align_paul.sh $templatefile $templatesAlnFile $tmpdir $paulSpeed
127 if [ "$?" -ne "0" ]
128 then
129 echo "ERROR: paul alignment failed. Exiting"
130 exit 1
131 fi
132
133
134 ### STEP 3: target sequence to templates profile alignment
135 echo "################################################"
136 echo "# STEP 3: TARGET TO TEMPLATES ALIGNMENT"
137 echo "################################################"
138 $bindir/align_seq2prof.sh $targetseqfile $templatesAlnFile $target2templAlnFile $tcoffeelog
139 echo "Wrote target to template alignment to $target2templAlnFile"
140 echo "Wrote t-coffee output to $tcoffeelog"
141 # generate secondary structure comparison, needs psipred output file, searching in output dir
142 if [ -e $psipredFile ]
143 then
144 $bindir/displaySSMatching -n -a $target2templAlnFile -s $psipredFile > $ssCompareFile
145 echo "Wrote secondary structure comparison to $ssCompareFile"
146 else
147 echo "Could not find psipred output, please run displaySSMatching manually to view secondary structure comparison."
148 fi
149
150 ### STEP 4: graph average and reconstruction
151 echo "################################################"
152 echo "# STEP 4: GRAPH AVERAGING AND RECONSTRUCTION"
153 echo "################################################"
154
155
156 if [ -z "$skiptinkeropt" ]
157 then
158 $bindir/averageGraph -f $targetseqfile -P $templatefile -t $cts -d $dists -b $basename -o $outdir -a $target2templAlnFile -s $CCT \
159 -r $numDistgeomModels -c $CASP_AUTHOR -m $CASP_METHOD_FILE $noPhiPsi $noTransOmega
160 else
161 $bindir/averageGraph -f $targetseqfile -P $templatefile -t $cts -d $dists -b $basename -o $outdir -a $target2templAlnFile -s $CCT
162 echo "Skipping reconstruction step. No 3D model will be written."
163 fi

Properties

Name Value
svn:executable *