-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConsolv
executable file
·109 lines (96 loc) · 3.08 KB
/
Consolv
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/sh
# syntax: scriptname proteinPDBCode complexPDBCode proteinPDBFile complexPDBFile proteinChain ligandChain
# Mode:
# application
# requires just these paramaters: proteinPDBCode,proteinPDBFile (total 2 parameters)
# test
# requires proteinPDBCode, complexPDBCode, proteinPDBFIle, complexPDBFile, proteinChainID,ligandChainID
# (total 6 parameters)
# env
# requires proteinPDBCode, proteinPDBFile "noscale" (3 parameters)
progname=$0
prefix=`dirname \`which $0 \``
weightfile=$prefix/lib/weight.dat
trainfile=$prefix/lib/train.dat
kvalfile=$prefix/lib/kval.dat
# Check for active-site mode
if [ "$1" = "-a" ] ; then
echo "Tuned for classification of active-site water."
trainfile=$prefix/lib/train_act.dat
weightfile=$prefix/lib/weight_act.dat
kvalfile=$prefix/lib/kval_act.dat
shift
fi
case $# in
2) echo "Running in application mode..."
pPDB=`echo $1|tr "A-Z" "a-z"`
pFile=$2
watsFile="`basename $pFile`.hits"
envFile="$pPDB.env"
sclFile="$pPDB.scl"
$prefix/bin/allwats $pFile $watsFile
$prefix/bin/All.EXE -a $pFile $watsFile $pPDB
# remove non-firstshell waters
awk '$3!=0{print}' $envFile > tmp.$$
$prefix/bin/Scale.EXE -a tmp.$$ $sclFile
/bin/rm tmp.$$
# capture the k-value
if [ ! -r $kvalfile ] ; then
echo "Unable to find default k-value. Not performing predictions."
exit
fi
kval=`cat $kvalfile`
# Do the predictions
echo "Performing predictions on ${pPDB}..."
$prefix/bin/bbknn -v $kval $trainfile $sclFile n $weightfile > ${pPDB}.pred
echo "Done.";;
3) echo "Running in enviro mode..."
pPDB=`echo $1|tr "A-Z" "a-z"`
pFile=$2
watsFile="`basename $pFile`.hits"
if [ $3 -eq "noscale" ]; then
$prefix/bin/allwats $pFile $watsFile
$prefix/bin/All.EXE -a $pFile $watsFile $pPDB
echo "Done."
fi
echo "Done";;
6) echo "Running in test mode..."
pPDB=`echo $1|tr "A-Z" "a-z"`
cPDB=`echo $2|tr "A-Z" "a-z"`
pFile=$3
cFile=$4
pChain=$5
iChain=$6
watsFile="`basename $pFile`.hits"
envFile="$pPDB.env"
sclFile="$pPDB.scl"
$prefix/bin/Nearby.EXE $cFile $pFile $pChain $iChain $cPDB $pPDB
$prefix/bin/Conswat.EXE $pFile $cFile $pPDB
$prefix/bin/allwats $pFile $watsFile
$prefix/bin/All.EXE -t $pFile $watsFile $pPDB
#remove non-firstshell waters
awk '$3!=0{print}' $envFile > tmp.$$
$prefix/bin/Scale.EXE -t tmp.$$ $sclFile
/bin/rm tmp.$$
# capture the k-value
if [ ! -r $kvalfile ] ; then
echo "Unable to find default k-value. Not performing predictions."
exit
fi
kval=`cat $kvalfile`
# Do the predictions
echo "Performing predictions on ${pPDB}..."
$prefix/bin/bbknn -v $kval $trainfile $sclFile y $weightfile > ${pPDB}.pred
echo "Done.";;
*) echo "Usage:"
echo "To run in test mode:"
echo " $0 [-a] protPDBCode cplxPDBCode protPDBFile cplxPDBFile pChainID ligChainID"
echo " "
echo "To run in application mode:"
echo " $0 [-a] protPDBCode protPDBFile"
echo " "
echo "To run in environment mode:"
echo " $0 [-a] protPDBCode protPDBFile noscale"
echo " "
exit
esac