-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcenterSelect.sh
More file actions
executable file
·157 lines (103 loc) · 2.96 KB
/
Copy pathcenterSelect.sh
File metadata and controls
executable file
·157 lines (103 loc) · 2.96 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/bash
parametersFile="./parameters.txt"
if [ $# -eq 0 ]
then
echo "No arguments supplied ..."
else
parametersFile=$1
fi
echo "reading in parameters from $parametersFile"
echo "found the following parameters..."
echo "paramameter value"
NLS="-----------------------------------------------------------"
echo $NLS
#-----------------------------------------------------------------------------------
IFS=";"
while read parameter value
do
echo "$parameter $value"
if [ "$parameter" == "path2centerSelect" ]; then
path2centerSelect=$value
elif [ "$parameter" == "path2files" ]; then
path2files=$value
elif [ "$parameter" == "boxSize" ]; then
boxSize=$value
elif [ "$parameter" == "depth" ]; then
depth=$value
elif [ "$parameter" == "eps" ]; then
eps=$value
elif [ "$parameter" == "eps" ]; then
eps=$value
elif [ "$parameter" == "onlyDoMissing" ]; then
onlyDoMissing=$value
elif [ "$parameter" == "path2output" ]; then
path2output=$value
elif [ "$parameter" == "SELECTBOX" ]; then
SELECTBOX=$value
else
echo "corrupted format in $parametersfile/parameters.txt"
echo "aborting ..."
exit
fi
done < $parametersFile
echo $NLS
cp $parametersFile $path2files/$parametersFile
#-----------------------------------------------------------------------------------
#path2centerSelect="/home/willy/RedoxChallenges/centerSelect/"
#path2files="/home/willy/RedoxChallenges/centerSelect/Redox_old/Output/"
#boxSize=30
#
## point[3] > center[3] - depth; positive depth means more points
#depth=10
#eps=0.3
function selectCenter {
d=$1
echo $d
echo $filename
filename="${d%/}"
f="$path2output/$filename/$filename"
rm "$f""HeadOff.pqr"
sed '1,1d' "$f.pqr" >> $f."tmp.pqr"
sed '$d' $f."tmp.pqr" >> "$f""HeadOff.pqr"
rm $f."tmp.pqr"
$path2centerSelect/./centerSelecter.R $path2centerSelect $path2output $filename $boxSize $depth $eps $SELECTBOX
}
#missingList=$($path2centerSelect./WhichMissing.sh $path2files)
#while read -r line; do
# echo "... $line ..."
#done <<< "$missingList"
#exit
if [ $path2output != "false" ]; then
echo "copying files from $path2files to $path2output ..."
cp -r $path2files $path2output
else
echo "using original files in $path2files ..."
path2output=$path2files
fi
cd $path2output
#for d in */ ; do
echo "onlyDoMissing == $onlyDoMissing ..."
if [ $onlyDoMissing == true ]; then
echo "... performing only for missing folders"
missingList=$($path2centerSelect./WhichMissing.sh $path2output)
while read -r d; do (
selectCenter $d
) #&
done <<< "$missingList"
#wait
else
echo "... performing for all folders"
for d in */ ; do (
selectCenter $d
) #&
done
#wait
fi
echo $NLS
#-----------------------------------------------------------------------------------
echo $path2output
echo "still missing active centers of ..."
missing=$($path2centerSelect./WhichMissing.sh $path2output)
echo $missing
cd $path2centerSelect
echo "$missing" > "missing.txt"