opentox-ruby-api-wrapper 1.2.7 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -3
- data/VERSION +1 -1
- data/bin/opentox-install-ubuntu.sh +375 -0
- data/lib/algorithm.rb +51 -36
- data/lib/authorization.rb +24 -0
- data/lib/compound.rb +2 -1
- data/lib/config/config_ru.rb +1 -0
- data/lib/dataset.rb +28 -6
- data/lib/environment.rb +17 -0
- data/lib/model.rb +14 -4
- data/lib/opentox-ruby-api-wrapper.rb +1 -1
- data/lib/owl.rb +0 -1
- data/lib/task.rb +38 -9
- data/lib/templates/users.yaml +5 -0
- data/lib/validation.rb +21 -0
- metadata +12 -18
- data/lib/config/database.rb +0 -21
data/Rakefile
CHANGED
@@ -10,12 +10,14 @@ begin
|
|
10
10
|
gem.email = "helma@in-silico.ch"
|
11
11
|
gem.homepage = "http://github.com/helma/opentox-ruby-api-wrapper"
|
12
12
|
gem.authors = ["Christoph Helma"]
|
13
|
-
["sinatra", "rest-client", "rack", "rack-contrib", "rack-flash", "
|
13
|
+
["sinatra", "rest-client", "rack", "rack-contrib", "rack-flash", "emk-sinatra-url-for", "cehoffman-sinatra-respond_to", "dm-more", "dm-core", "sinatra-static-assets"].each do |dep|
|
14
14
|
gem.add_dependency dep
|
15
15
|
end
|
16
|
-
|
16
|
+
['cucumber','jeweler', "thin"].each do |dep|
|
17
|
+
gem.add_development_dependency dep
|
18
|
+
end
|
17
19
|
gem.files = FileList["[A-Z]*", "{bin,generators,lib,test}/**/*", 'lib/jeweler/templates/.gitignore']
|
18
|
-
gem.files.include %w(lib/tasks/owl.rb, lib/environment.rb, lib/algorithm.rb, lib/compound.rb, lib/dataset.rb, lib/model.rb, lib/utils.rb, lib/templates/*)
|
20
|
+
gem.files.include %w(lib/tasks/owl.rb, lib/environment.rb, lib/algorithm.rb, lib/compound.rb, lib/dataset.rb, lib/model.rb, lib/utils.rb, lib/validation.rb, lib/templates/*)
|
19
21
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
20
22
|
end
|
21
23
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
@@ -0,0 +1,375 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#Installation is tested on Debian Ubuntu 9.10
|
3
|
+
#Update the system
|
4
|
+
|
5
|
+
FAILED=0
|
6
|
+
STARTPATH=$PWD
|
7
|
+
ERRLOG=$PWD/'install_err.log'
|
8
|
+
INSTALLLOG=$PWD/'install_log.log'
|
9
|
+
DATE=$(date +%Y/%m/%d\ %H:%M:%S)
|
10
|
+
BRANCH=$1
|
11
|
+
GEMVERSION="1.3.5"
|
12
|
+
GITVERSION="1.6.5.2"
|
13
|
+
RAPTORVERSION="1.4.20"
|
14
|
+
RASQALVERSION="0.9.16"
|
15
|
+
RASQALVERSION2="0.9.15"
|
16
|
+
REDLANDVERSION="1.0.7"
|
17
|
+
REDBINDVERSION="1.0.7.1"
|
18
|
+
|
19
|
+
if [ "$BRANCH" = '' ]
|
20
|
+
then
|
21
|
+
echo "Please enter: sudo ./[filename] [brunchtpy]"
|
22
|
+
exit 1
|
23
|
+
fi
|
24
|
+
echo "================================================="
|
25
|
+
echo "Selected branch is: $BRANCH"
|
26
|
+
echo "================================================="
|
27
|
+
echo "Please enshure that the sudo package is installed"
|
28
|
+
echo "on your system. "
|
29
|
+
echo "On Ubuntu Linux sudo is installed by default."
|
30
|
+
echo "If you are unsure check with it 'sudo ls'"
|
31
|
+
echo "and installed it with 'apt-get install sudo'"
|
32
|
+
echo "and add your username with visudo."
|
33
|
+
echo "================================================="
|
34
|
+
echo "Some programs and the OpenTox webservices will be installed in the current folder."
|
35
|
+
echo "================================================="
|
36
|
+
echo -n "To continue installation press y: "
|
37
|
+
read answer
|
38
|
+
if [ "$answer" != "y" ]
|
39
|
+
then
|
40
|
+
echo "exiting the script..."
|
41
|
+
exit 1
|
42
|
+
fi
|
43
|
+
|
44
|
+
echo "opentox webservice install log - " $DATE > $INSTALLLOG
|
45
|
+
echo "opentox webservice install err log - " $DATE > $ERRLOG
|
46
|
+
echo "Installing: build-essential"
|
47
|
+
sudo apt-get install build-essential | tee -a $INSTALLLOG
|
48
|
+
|
49
|
+
echo "Installing: ruby 1.8 with its dev files"
|
50
|
+
sudo apt-get install ruby ruby1.8-dev | tee -a $INSTALLLOG
|
51
|
+
|
52
|
+
echo "Installing: gems rdoc rubygems libxml-parser-ruby1.8 libxml++2.6-dev libyaml-ruby libzlib-ruby sqlite3 libsqlite3-dev libsqlite3-ruby1.8 and rake"
|
53
|
+
sudo apt-get install gems rdoc rubygems libxml-parser-ruby1.8 libxml++2.6-dev libyaml-ruby libzlib-ruby rake sqlite3 libsqlite3-dev libsqlite3-ruby1.8 | tee -a $INSTALLLOG
|
54
|
+
|
55
|
+
#RUBYGEMS
|
56
|
+
echo "Installing rubygems from source. This may take some time"
|
57
|
+
if [ ! -d $STARTPATH/rubygems-$GEMVERSION ];
|
58
|
+
then
|
59
|
+
wget http://rubyforge.org/frs/download.php/60718/rubygems-$GEMVERSION.tgz >>$INSTALLLOG 2>>$ERRLOG
|
60
|
+
tar xzfv rubygems-$GEMVERSION.tgz >>$INSTALLLOG 2>>$ERRLOG
|
61
|
+
cd rubygems-$GEMVERSION
|
62
|
+
sudo ruby setup.rb >>$INSTALLLOG 2>>$ERRLOG
|
63
|
+
cd ..
|
64
|
+
sudo rm rubygems-$GEMVERSION.tgz
|
65
|
+
CHECKGEM=`gem -v`
|
66
|
+
if [ "$CHECKGEM" == "$GEMVERSION" ]
|
67
|
+
then
|
68
|
+
echo "Adding http://gems.github.com to ruby gem sources"
|
69
|
+
sudo gem sources -a http://gems.github.com >>$INSTALLLOG 2>>$ERRLOG
|
70
|
+
|
71
|
+
echo "================================================="
|
72
|
+
echo "Rubygems version $GEMVERSION successfully installed."
|
73
|
+
echo "================================================="
|
74
|
+
else
|
75
|
+
echo "Rubygems version $GEMVERSION installation failed."
|
76
|
+
FAILED=1
|
77
|
+
exit $FAILED
|
78
|
+
fi
|
79
|
+
else
|
80
|
+
echo "rubygems-$GEMVERSION folder already exist. "
|
81
|
+
fi
|
82
|
+
|
83
|
+
echo "Installing packages: zlib1g-dev tcl curl perl ssh tcl tk8.5 libopenssl-ruby libgsl0-dev swig r-base rinruby"
|
84
|
+
sudo apt-get install zlib1g-dev tcl curl perl libopenssl-ruby libgsl0-dev r-base | tee -a $INSTALLLOG
|
85
|
+
sudo apt-get install ssh tcl tk8.5 | tee -a $INSTALLLOG
|
86
|
+
sudo apt-get install swig | tee -a $INSTALLLOG
|
87
|
+
sudo apt-get install postgresql-server-dev-8.4 | tee -a $INSTALLLOG
|
88
|
+
|
89
|
+
|
90
|
+
#echo "Installing gems jeweler sinatra emk-sinatra-url-for dm-core cehoffman-sinatra-respond_to rest-client rack-contrib thin cucumber datamapper data_objects do_sqlite3 rinruby"
|
91
|
+
sudo gem install jeweler | tee -a $INSTALLLOG
|
92
|
+
sudo gem install sinatra | tee -a $INSTALLLOG
|
93
|
+
sudo gem install emk-sinatra-url-for -s http://gems.github.com | tee -a $INSTALLLOG
|
94
|
+
sudo gem install dm-core | tee -a $INSTALLLOG
|
95
|
+
sudo gem install cehoffman-sinatra-respond_to -s http://gems.github.com | tee -a $INSTALLLOG
|
96
|
+
sudo gem install rest-client | tee -a $INSTALLLOG
|
97
|
+
sudo gem install rack-contrib | tee -a $INSTALLLOG
|
98
|
+
sudo gem install thin | tee -a $INSTALLLOG
|
99
|
+
sudo gem install cucumber | tee -a $INSTALLLOG
|
100
|
+
sudo gem install datamapper | tee -a $INSTALLLOG
|
101
|
+
sudo gem install data_objects | tee -a $INSTALLLOG
|
102
|
+
sudo gem install do_sqlite3 | tee -a $INSTALLLOG
|
103
|
+
sudo gem install rinruby | tee -a $INSTALLLOG
|
104
|
+
sudo gem cleanup | tee -a $INSTALLLOG
|
105
|
+
|
106
|
+
echo "Installing LibRDF-ruby"
|
107
|
+
sudo apt-get install librdf0 librdf-ruby | tee -a $INSTALLLOG
|
108
|
+
|
109
|
+
#GIT
|
110
|
+
echo "Installing git from source"
|
111
|
+
echo "This could take a while..."
|
112
|
+
if [ ! -d $STARTPATH/git-$GITVERSION ];
|
113
|
+
then
|
114
|
+
wget http://www.kernel.org/pub/software/scm/git/git-$GITVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
115
|
+
tar xzfv git-$GITVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
116
|
+
cd git-$GITVERSION
|
117
|
+
./configure >>$INSTALLLOG 2>>$ERRLOG
|
118
|
+
make >>$INSTALLLOG 2>>$ERRLOG
|
119
|
+
sudo make install >>$INSTALLLOG 2>>$ERRLOG
|
120
|
+
cd ..
|
121
|
+
sudo rm git-$GITVERSION.tar.gz
|
122
|
+
CHECKGIT=`git --version`
|
123
|
+
if [ "$CHECKGIT" == "git version $GITVERSION" ]
|
124
|
+
then
|
125
|
+
echo "================================================="
|
126
|
+
echo "Git version $GITVERSION successfully installed."
|
127
|
+
echo "================================================="
|
128
|
+
else
|
129
|
+
echo "Git version $GITVERSION installation failed."
|
130
|
+
FAILED=1
|
131
|
+
exit $FAILED
|
132
|
+
fi
|
133
|
+
else
|
134
|
+
echo "git-$GITVERSION folder exists."
|
135
|
+
fi
|
136
|
+
|
137
|
+
#REDLAND
|
138
|
+
if [ ! -d $STARTPATH/redland ];
|
139
|
+
then
|
140
|
+
echo "Making Redland folder."
|
141
|
+
mkdir redland >>$INSTALLLOG 2>>$ERRLOG
|
142
|
+
cd redland
|
143
|
+
echo "Installing Redland raptor"
|
144
|
+
if [ ! -d $STARTPATH/redland/raptor-$RAPTORVERSION ];
|
145
|
+
then
|
146
|
+
wget wget http://download.librdf.org/source/raptor-$RAPTORVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
147
|
+
tar xzfv raptor-$RAPTORVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
148
|
+
cd raptor-$RAPTORVERSION
|
149
|
+
./configure >>$INSTALLLOG 2>>$ERRLOG
|
150
|
+
sudo make >>$INSTALLLOG 2>>$ERRLOG
|
151
|
+
sudo make install >>$INSTALLLOG 2>>$ERRLOG
|
152
|
+
cd ..
|
153
|
+
sudo rm raptor-$RAPTORVERSION.tar.gz
|
154
|
+
CHECKRAPTOR=`raptor-config --version`
|
155
|
+
if [ "$CHECKRAPTOR" == "$RAPTORVERSION" ]
|
156
|
+
then
|
157
|
+
echo "================================================="
|
158
|
+
echo "Raptor version $RAPTORVERSION successfully installed."
|
159
|
+
echo "================================================="
|
160
|
+
else
|
161
|
+
echo "Raptor version $RAPTORVERSION installation failed."
|
162
|
+
FAILED=1
|
163
|
+
exit $FAILED
|
164
|
+
fi
|
165
|
+
else
|
166
|
+
echo "raptor-$RAPTORVERSION folder exists."
|
167
|
+
fi
|
168
|
+
|
169
|
+
echo "Installing Redland rasqal"
|
170
|
+
wget wget http://download.librdf.org/source/rasqal-$RASQALVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
171
|
+
tar xzfv rasqal-$RASQALVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
172
|
+
cd rasqal-$RASQALVERSION
|
173
|
+
./configure >>$INSTALLLOG 2>>$ERRLOG
|
174
|
+
sudo make >>$INSTALLLOG 2>>$ERRLOG
|
175
|
+
sudo make install >>$INSTALLLOG 2>>$ERRLOG
|
176
|
+
cd ..
|
177
|
+
sudo rm rasqal-$RASQALVERSION.tar.gz
|
178
|
+
CHECKRASQAL=`rasqal-config --version`
|
179
|
+
if [ "$CHECKRASQAL" == "$RASQALVERSION2" -o "$CHECKRASQAL" == "$RASQALVERSION" ]
|
180
|
+
then
|
181
|
+
echo "================================================="
|
182
|
+
echo "Raptor version $RASQALVERSION2 or higher successfully installed."
|
183
|
+
echo "================================================="
|
184
|
+
else
|
185
|
+
echo "Raptor version $RASQALVERSION2 or higher installation failed."
|
186
|
+
FAILED=1
|
187
|
+
exit $FAILED
|
188
|
+
fi
|
189
|
+
|
190
|
+
echo "Installing Redland redland"
|
191
|
+
wget wget http://download.librdf.org/source/redland-$REDLANDVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
192
|
+
tar xzfv redland-$REDLANDVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
193
|
+
cd redland-$REDLANDVERSION
|
194
|
+
./configure >>$INSTALLLOG 2>>$ERRLOG
|
195
|
+
sudo make >>$INSTALLLOG 2>>$ERRLOG
|
196
|
+
sudo make install >>$INSTALLLOG 2>>$ERRLOG
|
197
|
+
cd ..
|
198
|
+
sudo rm redland-$REDLANDVERSION.tar.gz
|
199
|
+
CHECKREDLAND=`redland-config --version`
|
200
|
+
if [ "$CHECKREDLAND" == "$REDLANDVERSION" ]
|
201
|
+
then
|
202
|
+
echo "================================================="
|
203
|
+
echo "Redland version $REDLANDVERSION successfully installed."
|
204
|
+
echo "================================================="
|
205
|
+
else
|
206
|
+
echo "Redland version $REDLANDVERSION installation failed."
|
207
|
+
FAILED=1
|
208
|
+
exit $FAILED
|
209
|
+
fi
|
210
|
+
|
211
|
+
|
212
|
+
echo "Installing Redland Bindings with ruby"
|
213
|
+
wget http://download.librdf.org/source/redland-bindings-$REDBINDVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
214
|
+
tar xzfv redland-bindings-$REDBINDVERSION.tar.gz >>$INSTALLLOG 2>>$ERRLOG
|
215
|
+
cd redland-bindings-$REDBINDVERSION
|
216
|
+
./configure --with-ruby >>$INSTALLLOG 2>>$ERRLOG
|
217
|
+
sudo make >>$INSTALLLOG 2>>$ERRLOG
|
218
|
+
sudo make install >>$INSTALLLOG 2>>$ERRLOG
|
219
|
+
cd ..
|
220
|
+
sudo rm redland-bindings-$REDBINDVERSION.tar.gz
|
221
|
+
cd ..
|
222
|
+
#CHECKREDBIND=`??? --version`
|
223
|
+
#if [ "$CHECKREDBIND" == "$REDBINDVERSION" ]
|
224
|
+
#then
|
225
|
+
# echo "================================================="
|
226
|
+
# echo "Redland Bindings version $REDBINDVERSION successfully installed."
|
227
|
+
# echo "================================================="
|
228
|
+
#else
|
229
|
+
# echo "Redland Bindings version $REDBINDVERSION installation failed."
|
230
|
+
# FAILED=1
|
231
|
+
# exit $FAILED
|
232
|
+
#fi
|
233
|
+
else
|
234
|
+
echo "Redland folder exists."
|
235
|
+
fi
|
236
|
+
|
237
|
+
echo "Installing the opentox webservices"
|
238
|
+
mkdir webservices
|
239
|
+
cd webservices
|
240
|
+
|
241
|
+
echo "Install the opentox-ruby-api-wrapper"
|
242
|
+
echo "This could take a while..."
|
243
|
+
git clone git://github.com/helma/opentox-ruby-api-wrapper.git >>$INSTALLLOG 2>>$ERRLOG
|
244
|
+
cd opentox-ruby-api-wrapper
|
245
|
+
git checkout -b $BRANCH origin/$BRANCH >>$INSTALLLOG 2>>$ERRLOG
|
246
|
+
OTAPIVERSION=`cat VERSION`
|
247
|
+
sudo rake install | tee -a $INSTALLLOG
|
248
|
+
cd ..
|
249
|
+
CHECKOTAPI=`gem list | grep "opentox-ruby-api-wrapper" | grep "$OTAPIVERSION"`
|
250
|
+
if [ ! "$CHECKOTAPI" = '' ]
|
251
|
+
then
|
252
|
+
echo "================================================="
|
253
|
+
echo "opentox-ruby-api-wrapper ($OTAPIVERSION) successfully installed."
|
254
|
+
echo "================================================="
|
255
|
+
else
|
256
|
+
echo "opentox-ruby-api-wrapper ($OTAPIVERSION) installation failed."
|
257
|
+
FAILED=1
|
258
|
+
exit $FAILED
|
259
|
+
fi
|
260
|
+
|
261
|
+
echo "Installing the webservices: compound, dataset, algorithm, model, task, feature"
|
262
|
+
git clone git://github.com/helma/opentox-compound.git >>$INSTALLLOG 2>>$ERRLOG
|
263
|
+
git clone git://github.com/helma/opentox-dataset.git >>$INSTALLLOG 2>>$ERRLOG
|
264
|
+
git clone git://github.com/helma/opentox-algorithm.git >>$INSTALLLOG 2>>$ERRLOG
|
265
|
+
git clone git://github.com/helma/opentox-model.git >>$INSTALLLOG 2>>$ERRLOG
|
266
|
+
git clone git://github.com/helma/opentox-task.git >>$INSTALLLOG 2>>$ERRLOG
|
267
|
+
git clone git://github.com/helma/opentox-feature.git >>$INSTALLLOG 2>>$ERRLOG
|
268
|
+
|
269
|
+
cd opentox-compound
|
270
|
+
git checkout -b $BRANCH origin/$BRANCH >>$INSTALLLOG 2>>$ERRLOG
|
271
|
+
cd ../opentox-dataset
|
272
|
+
git checkout -b $BRANCH origin/$BRANCH >>$INSTALLLOG 2>>$ERRLOG
|
273
|
+
cd ../opentox-algorithm
|
274
|
+
git checkout -b $BRANCH origin/$BRANCH >>$INSTALLLOG 2>>$ERRLOG
|
275
|
+
cd ../opentox-model
|
276
|
+
git checkout -b $BRANCH origin/$BRANCH >>$INSTALLLOG 2>>$ERRLOG
|
277
|
+
cd ../opentox-task
|
278
|
+
git checkout -b $BRANCH origin/$BRANCH >>$INSTALLLOG 2>>$ERRLOG
|
279
|
+
cd ../opentox-task
|
280
|
+
git checkout -b development origin/development >>$INSTALLLOG 2>>$ERRLOG
|
281
|
+
cd ..
|
282
|
+
|
283
|
+
#edit /home/[username]/.opentox/config/test.yaml set :base_dir: /home/[username]/webservices
|
284
|
+
|
285
|
+
echo "Installing the tests"
|
286
|
+
git clone git://github.com/helma/opentox-test.git >>$INSTALLLOG 2>>$ERRLOG
|
287
|
+
cd opentox-test
|
288
|
+
git checkout -b $BRANCH origin/$BRANCH >>$INSTALLLOG 2>>$ERRLOG
|
289
|
+
|
290
|
+
echo "Installing openbabel"
|
291
|
+
cd ../opentox-compound
|
292
|
+
sudo rake openbabel:install | tee -a $INSTALLLOG
|
293
|
+
sudo ldconfig >>$INSTALLLOG 2>>$ERRLOG
|
294
|
+
|
295
|
+
ln -s /usr/local/lib/libopenbabel.so.3 /usr/lib/libopenbabel.so.3 >> $INSTALLLOG 2>>$ERR
|
296
|
+
#VERSION=` --version`
|
297
|
+
#if [ "$VERSION" == "$RAPTORVERSION" ]
|
298
|
+
#then
|
299
|
+
# echo "================================================="
|
300
|
+
# echo "Raptor version $RAPTORVERSION successfully installed."
|
301
|
+
# echo "================================================="
|
302
|
+
#else
|
303
|
+
# echo "Raptor version $RAPTORVERSION installation failed."
|
304
|
+
# FAILED=1
|
305
|
+
# exit $FAILED
|
306
|
+
#fi
|
307
|
+
|
308
|
+
|
309
|
+
#check /webservices/opentox-algorithm/fminer.rb for 1,0/ture,false bug
|
310
|
+
BUGCHECK1=`grep "@@fminer.AddActivity(true, id)" $STARTPATH/webservices/opentox-algorithm/fminer.rb`
|
311
|
+
BUGCHECK2=`grep "@@fminer.AddActivity(false, id)" $STARTPATH/webservices/opentox-algorithm/fminer.rb`
|
312
|
+
if [ -z "$BUGCHECK1$BUGCHECK2" ]
|
313
|
+
then
|
314
|
+
echo "fminer.rb is correct."
|
315
|
+
else
|
316
|
+
sed -i 's/@@fminer.AddActivity(true, id)/@@fminer.AddActivity(1, id)/g' $STARTPATH/webservices/opentox-algorithm/fminer.rb
|
317
|
+
sed -i 's/@@fminer.AddActivity(false, id)/@@fminer.AddActivity(0, id)/g' $STARTPATH/webservices/opentox-algorithm/fminer.rb
|
318
|
+
echo "fminer.rb updated."
|
319
|
+
fi
|
320
|
+
|
321
|
+
#todo: configure libfminer Makefile (location of ruby.h)
|
322
|
+
#-> fixed by using davor's repository
|
323
|
+
|
324
|
+
|
325
|
+
cd ../opentox-algorithm
|
326
|
+
echo "Installing fminer"
|
327
|
+
echo "This could take a while..."
|
328
|
+
sudo updatedb
|
329
|
+
sudo rake fminer:install | tee -a $INSTALLLOG
|
330
|
+
cd ..
|
331
|
+
FMINERVERSION=`ls $STARTPATH/webservices/opentox-algorithm/libfminer | grep "fminer.so"`
|
332
|
+
if [ "$FMINERVERSION" == "fminer.so" ]
|
333
|
+
then
|
334
|
+
echo "================================================="
|
335
|
+
echo "Fminer successfully installed."
|
336
|
+
echo "================================================="
|
337
|
+
else
|
338
|
+
echo "Fminer installation failed."
|
339
|
+
FAILED=1
|
340
|
+
exit $FAILED
|
341
|
+
fi
|
342
|
+
|
343
|
+
if [ $FAILED == 0 ]
|
344
|
+
then
|
345
|
+
#get username
|
346
|
+
echo "Please enter username:"
|
347
|
+
read USERNAME
|
348
|
+
|
349
|
+
#change rights from root to user
|
350
|
+
sudo chown -R $USERNAME: $STARTPATH/webservices/
|
351
|
+
sudo chown -R $USERNAME: ~/.opentox/
|
352
|
+
fi
|
353
|
+
|
354
|
+
if [ "$FAILED" == "1" ]
|
355
|
+
then
|
356
|
+
echo "================================================="
|
357
|
+
echo "Installation script failed!"
|
358
|
+
echo "================================================="
|
359
|
+
exit 1
|
360
|
+
else
|
361
|
+
echo "================================================="
|
362
|
+
echo "opentox-install-script is completed."
|
363
|
+
echo "================================================="
|
364
|
+
echo "Configuration:"
|
365
|
+
echo "Edit the settings in $HOME/.opentox/config/{development|production|test}.yaml for your environment."
|
366
|
+
echo "================================================="
|
367
|
+
echo "Start the webservices local:"
|
368
|
+
echo "cd webservices/opentox-test/"
|
369
|
+
echo "rake opentox:services:start"
|
370
|
+
echo "================================================="
|
371
|
+
echo "Test local webservices:"
|
372
|
+
echo "rake features"
|
373
|
+
echo "================================================="
|
374
|
+
fi
|
375
|
+
exit 0
|
data/lib/algorithm.rb
CHANGED
@@ -1,27 +1,35 @@
|
|
1
|
+
LOGGER.progname = File.expand_path(__FILE__)
|
2
|
+
|
1
3
|
module OpenTox
|
2
|
-
|
4
|
+
module Algorithm
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
+
class Fminer
|
7
|
+
include Owl
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
def initialize
|
10
|
+
super
|
11
|
+
self.uri = File.join(@@config[:services]["opentox-algorithm"],'fminer')
|
12
|
+
self.title = "fminer"
|
13
|
+
self.source = "http://github.com/amaunz/libfminer"
|
14
|
+
self.parameters = {
|
15
|
+
"Dataset URI" => { :scope => "mandatory", :value => "dataset_uri" },
|
16
|
+
"Feature URI for dependent variable" => { :scope => "mandatory", :value => "feature_uri" }
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.create_feature_dataset(params)
|
21
|
+
LOGGER.debug File.basename(__FILE__) + ": creating feature dataset"
|
22
|
+
resource = RestClient::Resource.new(params[:feature_generation_uri], :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
23
|
+
resource.post :dataset_uri => params[:dataset_uri], :feature_uri => params[:feature_uri]
|
24
|
+
end
|
17
25
|
|
18
|
-
def self.
|
19
|
-
|
26
|
+
def self.uri
|
27
|
+
File.join(@@config[:services]["opentox-algorithm"], "fminer")
|
20
28
|
end
|
21
|
-
|
29
|
+
end
|
22
30
|
|
23
|
-
|
24
|
-
|
31
|
+
class Lazar
|
32
|
+
include Owl
|
25
33
|
|
26
34
|
def initialize
|
27
35
|
super
|
@@ -40,26 +48,33 @@ module OpenTox
|
|
40
48
|
|
41
49
|
def self.create_model(params)
|
42
50
|
LOGGER.debug params
|
43
|
-
|
51
|
+
LOGGER.debug File.basename(__FILE__) + ": creating model"
|
52
|
+
#@uri = RestClient.post File.join(@@config[:services]["opentox-algorithm"], "lazar"), :dataset_uri => params[:dataset_uri], :feature_uri => params[:feature_uri], :feature_generation_uri => File.join(@@config[:services]["opentox-algorithm"], "fminer")
|
53
|
+
resource = RestClient::Resource.new(File.join(@@config[:services]["opentox-algorithm"], "lazar"), :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
54
|
+
@uri = resource.post :dataset_uri => params[:dataset_uri], :feature_uri => params[:feature_uri], :feature_generation_uri => File.join(@@config[:services]["opentox-algorithm"], "fminer")
|
44
55
|
end
|
45
56
|
|
46
|
-
|
47
|
-
|
48
|
-
class Similarity
|
49
|
-
def self.weighted_tanimoto(fp_a,fp_b,p)
|
50
|
-
common_features = fp_a & fp_b
|
51
|
-
all_features = fp_a + fp_b
|
52
|
-
common_p_sum = 0.0
|
53
|
-
if common_features.size > 0
|
54
|
-
common_features.each{|f| common_p_sum += p[f]}
|
55
|
-
all_p_sum = 0.0
|
56
|
-
all_features.each{|f| all_p_sum += p[f]}
|
57
|
-
common_p_sum/all_p_sum
|
58
|
-
else
|
59
|
-
0.0
|
60
|
-
end
|
57
|
+
def self.uri
|
58
|
+
File.join(@@config[:services]["opentox-algorithm"], "lazar")
|
61
59
|
end
|
62
|
-
end
|
63
60
|
|
64
|
-
|
61
|
+
end
|
62
|
+
|
63
|
+
class Similarity
|
64
|
+
def self.weighted_tanimoto(fp_a,fp_b,p)
|
65
|
+
common_features = fp_a & fp_b
|
66
|
+
all_features = fp_a + fp_b
|
67
|
+
common_p_sum = 0.0
|
68
|
+
if common_features.size > 0
|
69
|
+
common_features.each{|f| common_p_sum += p[f]}
|
70
|
+
all_p_sum = 0.0
|
71
|
+
all_features.each{|f| all_p_sum += p[f]}
|
72
|
+
common_p_sum/all_p_sum
|
73
|
+
else
|
74
|
+
0.0
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
65
80
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
helpers do
|
2
|
+
|
3
|
+
def protected!
|
4
|
+
response['WWW-Authenticate'] = %(Basic realm="Opentox Webservice Authentication") and \
|
5
|
+
throw(:halt, [401, "Not authorized\n"]) and \
|
6
|
+
return unless authorized?
|
7
|
+
end
|
8
|
+
|
9
|
+
def authorized?
|
10
|
+
@auth ||= Rack::Auth::Basic::Request.new(request.env)
|
11
|
+
@auth.provided? && @auth.basic? && @auth.credentials && valid_user?
|
12
|
+
end
|
13
|
+
|
14
|
+
def valid_user?
|
15
|
+
users = @@users[:users]
|
16
|
+
return @auth.credentials == [@auth.username, users.fetch(@auth.username)] if users.has_key?(@auth.username)
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
before do
|
23
|
+
#protected! unless env['REQUEST_METHOD'] == "GET"
|
24
|
+
end
|
data/lib/compound.rb
CHANGED
@@ -17,7 +17,8 @@ module OpenTox
|
|
17
17
|
@inchi = sdf2inchi(params[:sdf])
|
18
18
|
@uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi))
|
19
19
|
elsif params[:name]
|
20
|
-
|
20
|
+
# paranoid URI encoding to keep SMILES charges and brackets
|
21
|
+
@inchi = RestClient.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").chomp
|
21
22
|
@uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi))
|
22
23
|
elsif params[:uri]
|
23
24
|
@uri = params[:uri]
|
data/lib/config/config_ru.rb
CHANGED
data/lib/dataset.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
LOGGER.progname = File.expand_path(__FILE__)
|
2
|
+
|
1
3
|
module OpenTox
|
2
4
|
|
3
5
|
class Dataset
|
@@ -14,6 +16,8 @@ module OpenTox
|
|
14
16
|
data_entry = @model.subject OT['compound'], compound
|
15
17
|
if data_entry.nil?
|
16
18
|
data_entry = @model.create_resource
|
19
|
+
dataset = @model.subject(RDF['type'],OT[self.owl_class])
|
20
|
+
@model.add dataset, OT['dataEntry'], data_entry
|
17
21
|
@model.add data_entry, RDF['type'], OT["DataEntry"]
|
18
22
|
@model.add data_entry, OT['compound'], compound
|
19
23
|
end
|
@@ -29,6 +33,8 @@ module OpenTox
|
|
29
33
|
data_entry = @model.subject OT['compound'], compound
|
30
34
|
if data_entry.nil?
|
31
35
|
data_entry = @model.create_resource
|
36
|
+
dataset = @model.subject(RDF['type'],OT[self.owl_class])
|
37
|
+
@model.add dataset, OT['dataEntry'], data_entry
|
32
38
|
@model.add data_entry, RDF['type'], OT["DataEntry"]
|
33
39
|
@model.add data_entry, OT['compound'], compound
|
34
40
|
end
|
@@ -57,7 +63,7 @@ module OpenTox
|
|
57
63
|
def find_or_create_compound(uri)
|
58
64
|
compound = @model.subject(DC["identifier"], uri)
|
59
65
|
if compound.nil?
|
60
|
-
compound = @model.create_resource
|
66
|
+
compound = @model.create_resource(uri)
|
61
67
|
@model.add compound, RDF['type'], OT["Compound"]
|
62
68
|
@model.add compound, DC["identifier"], uri
|
63
69
|
end
|
@@ -68,7 +74,7 @@ module OpenTox
|
|
68
74
|
def find_or_create_feature(uri)
|
69
75
|
feature = @model.subject(DC["identifier"], uri)
|
70
76
|
if feature.nil?
|
71
|
-
feature = @model.create_resource
|
77
|
+
feature = @model.create_resource(uri)
|
72
78
|
@model.add feature, RDF['type'], OT["Feature"]
|
73
79
|
@model.add feature, DC["identifier"], uri
|
74
80
|
@model.add feature, DC["title"], File.basename(uri).split(/#/)[1]
|
@@ -78,7 +84,8 @@ module OpenTox
|
|
78
84
|
end
|
79
85
|
|
80
86
|
def self.create(data, content_type = 'application/rdf+xml')
|
81
|
-
|
87
|
+
resource = RestClient::Resource.new(@@config[:services]["opentox-dataset"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
88
|
+
uri = resource.post data, :content_type => content_type
|
82
89
|
dataset = Dataset.new
|
83
90
|
dataset.read uri.to_s
|
84
91
|
dataset
|
@@ -86,7 +93,9 @@ module OpenTox
|
|
86
93
|
|
87
94
|
def self.find(uri)
|
88
95
|
dataset = Dataset.new
|
96
|
+
LOGGER.debug "Getting data from #{uri}"
|
89
97
|
data = `curl "#{uri}"`
|
98
|
+
#LOGGER.debug data
|
90
99
|
#data = RestClient.get(uri, :accept => 'application/rdf+xml') # unclear why this does not work for complex uris, Dataset.find works from irb
|
91
100
|
dataset.rdf = data
|
92
101
|
dataset
|
@@ -152,11 +161,24 @@ module OpenTox
|
|
152
161
|
|
153
162
|
# Delete a dataset
|
154
163
|
def delete
|
155
|
-
|
156
|
-
|
164
|
+
resource = RestClient::Resource.new(@uri, :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
165
|
+
resource.delete
|
166
|
+
end
|
157
167
|
|
158
168
|
def save
|
159
|
-
|
169
|
+
LOGGER.debug "Saving dataset"
|
170
|
+
#task_uri = RestClient.post(@@config[:services]["opentox-dataset"], self.rdf, :content_type => "application/rdf+xml").to_s
|
171
|
+
task_uri = RestClient::Resource.new(@@config[:services]["opentox-dataset"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]).post(self.rdf, :content_type => "application/rdf+xml").to_s
|
172
|
+
task = OpenTox::Task.find(task_uri)
|
173
|
+
LOGGER.debug "Waiting for task #{task_uri}"
|
174
|
+
task.wait_for_completion
|
175
|
+
LOGGER.debug "Dataset task #{task_uri} completed"
|
176
|
+
if task.failed?
|
177
|
+
LOGGER.error "Saving dataset failed"
|
178
|
+
task.failed
|
179
|
+
exit
|
180
|
+
end
|
181
|
+
task.resource
|
160
182
|
end
|
161
183
|
|
162
184
|
def to_yaml
|
data/lib/environment.rb
CHANGED
@@ -6,6 +6,7 @@ ENV['RACK_ENV'] = 'test' unless ENV['RACK_ENV']
|
|
6
6
|
basedir = File.join(ENV['HOME'], ".opentox")
|
7
7
|
config_dir = File.join(basedir, "config")
|
8
8
|
config_file = File.join(config_dir, "#{ENV['RACK_ENV']}.yaml")
|
9
|
+
user_file = File.join(config_dir, "users.yaml")
|
9
10
|
|
10
11
|
TMP_DIR = File.join(basedir, "tmp")
|
11
12
|
LOG_DIR = File.join(basedir, "log")
|
@@ -15,6 +16,7 @@ if File.exist?(config_file)
|
|
15
16
|
else
|
16
17
|
FileUtils.mkdir_p TMP_DIR
|
17
18
|
FileUtils.mkdir_p LOG_DIR
|
19
|
+
FileUtils.mkdir_p config_dir
|
18
20
|
FileUtils.cp(File.join(File.dirname(__FILE__), 'templates/config.yaml'), config_file)
|
19
21
|
puts "Please edit #{config_file} and restart your application."
|
20
22
|
exit
|
@@ -43,6 +45,21 @@ logfile = "#{LOG_DIR}/#{ENV["RACK_ENV"]}.log"
|
|
43
45
|
LOGGER = Logger.new(logfile,'daily') # daily rotation
|
44
46
|
LOGGER.level = Logger::DEBUG
|
45
47
|
|
48
|
+
if File.exist?(user_file)
|
49
|
+
@@users = YAML.load_file(user_file)
|
50
|
+
else
|
51
|
+
FileUtils.cp(File.join(File.dirname(__FILE__), 'templates/users.yaml'), user_file)
|
52
|
+
puts "Please edit #{user_file} and restart your application."
|
53
|
+
exit
|
54
|
+
end
|
55
|
+
|
56
|
+
begin
|
57
|
+
0 < @@users[:users].keys.length
|
58
|
+
rescue
|
59
|
+
puts "Please edit #{user_file} and restart your application. Create at least one user with password."
|
60
|
+
exit
|
61
|
+
end
|
62
|
+
|
46
63
|
# RDF namespaces
|
47
64
|
RDF = Redland::Namespace.new 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
|
48
65
|
OWL = Redland::Namespace.new 'http://www.w3.org/2002/07/owl#'
|
data/lib/model.rb
CHANGED
@@ -24,7 +24,7 @@ module OpenTox
|
|
24
24
|
lazar.algorithm = File.join(@@config[:services]["opentox-algorithm"],"lazar")
|
25
25
|
lazar.trainingDataset = yaml[:activity_dataset]
|
26
26
|
lazar.dependentVariables = yaml[:endpoint]
|
27
|
-
lazar.predictedVariables = yaml[:endpoint]
|
27
|
+
lazar.predictedVariables = yaml[:endpoint] + "_lazar_prediction"
|
28
28
|
lazar
|
29
29
|
end
|
30
30
|
|
@@ -39,15 +39,25 @@ module OpenTox
|
|
39
39
|
|
40
40
|
# Predict a compound
|
41
41
|
def predict(compound)
|
42
|
-
|
42
|
+
# nicht absichern??
|
43
|
+
resource = RestClient::Resource.new(@uri, :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
44
|
+
resource.post(:compound_uri => compound.uri)
|
43
45
|
end
|
44
46
|
|
45
47
|
def self.base_uri
|
46
|
-
@@config[:services]["opentox-model"]
|
48
|
+
File.join @@config[:services]["opentox-model"],'lazar'
|
47
49
|
end
|
48
50
|
|
49
51
|
def self.create(data)
|
50
|
-
|
52
|
+
resource = RestClient::Resource.new(@@config[:services]["opentox-model"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
53
|
+
resource.post(data, :content_type => "application/x-yaml").to_s
|
54
|
+
end
|
55
|
+
|
56
|
+
def delete
|
57
|
+
resource = RestClient::Resource.new(self.uri, :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
58
|
+
resource.delete
|
59
|
+
#RestClient.delete @uri if @uri
|
60
|
+
#RestClient.delete model.task_uri if model.task_uri
|
51
61
|
end
|
52
62
|
|
53
63
|
# def self.create(task)
|
@@ -8,6 +8,6 @@ rescue LoadError
|
|
8
8
|
puts "Please install Openbabel with 'rake openbabel:install' in the compound component"
|
9
9
|
end
|
10
10
|
|
11
|
-
['owl', 'compound','dataset','algorithm','model','task','utils'].each do |lib|
|
11
|
+
['owl', 'compound','dataset','algorithm','model','task','validation','utils','authorization'].each do |lib|
|
12
12
|
require lib
|
13
13
|
end
|
data/lib/owl.rb
CHANGED
@@ -16,7 +16,6 @@ module OpenTox
|
|
16
16
|
# reate an anonymous resource for metadata
|
17
17
|
# this has to be rewritten with an URI as soon as the resource has been saved at an definitive location
|
18
18
|
tmp = @model.create_resource
|
19
|
-
@model.add tmp, RDF['type'], OWL['Ontology']
|
20
19
|
@model.add tmp, RDF['type'], OT[self.owl_class]
|
21
20
|
end
|
22
21
|
|
data/lib/task.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
LOGGER.progname = File.expand_path(__FILE__)
|
2
|
+
|
1
3
|
module OpenTox
|
2
4
|
|
3
5
|
class Task
|
@@ -10,7 +12,10 @@ module OpenTox
|
|
10
12
|
end
|
11
13
|
|
12
14
|
def self.create
|
13
|
-
uri = RestClient.post @@config[:services]["opentox-task"], {}
|
15
|
+
#uri = RestClient.post @@config[:services]["opentox-task"], {}
|
16
|
+
resource = RestClient::Resource.new(@@config[:services]["opentox-task"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
17
|
+
#uri = resource.post(nil)
|
18
|
+
uri = resource.post({})
|
14
19
|
Task.new(uri)
|
15
20
|
end
|
16
21
|
|
@@ -26,7 +31,7 @@ module OpenTox
|
|
26
31
|
task_uris = RestClient.get(@@config[:services]["opentox-task"]).split(/\n/)
|
27
32
|
task_uris.collect{|uri| Task.new(uri)}
|
28
33
|
end
|
29
|
-
|
34
|
+
|
30
35
|
def created_at
|
31
36
|
RestClient.get File.join(@uri, 'created_at')
|
32
37
|
end
|
@@ -42,7 +47,24 @@ module OpenTox
|
|
42
47
|
def resource
|
43
48
|
RestClient.get File.join(@uri, 'resource')
|
44
49
|
end
|
50
|
+
|
51
|
+
def started
|
52
|
+
LOGGER.info File.join(@uri,'started')
|
53
|
+
resource = RestClient::Resource.new(File.join(@uri,'started'), :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
54
|
+
resource.put({})
|
55
|
+
end
|
56
|
+
|
57
|
+
def cancel
|
58
|
+
resource = RestClient::Resource.new(@File.join(@uri,'cancelled'), :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
59
|
+
resource.put({})
|
60
|
+
end
|
61
|
+
|
62
|
+
def completed(uri)
|
63
|
+
resource = RestClient::Resource.new(File.join(@uri,'completed'), :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
64
|
+
resource.put :resource => uri
|
65
|
+
end
|
45
66
|
|
67
|
+
=begin
|
46
68
|
def started
|
47
69
|
RestClient.put File.join(@uri,'started'), {}
|
48
70
|
end
|
@@ -51,20 +73,27 @@ module OpenTox
|
|
51
73
|
RestClient.put File.join(@uri,'cancelled'), {}
|
52
74
|
end
|
53
75
|
|
54
|
-
def
|
55
|
-
RestClient.put File.join(@uri,'
|
76
|
+
def completed(uri)
|
77
|
+
RestClient.put File.join(@uri,'completed'), :resource => uri
|
56
78
|
end
|
57
79
|
|
58
|
-
|
59
|
-
|
80
|
+
=end
|
81
|
+
def failed
|
82
|
+
#RestClient.put File.join(@uri,'failed'), {}
|
83
|
+
resource = RestClient::Resource.new(@File.join(@uri,'failed'), :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
84
|
+
resource.put({})
|
60
85
|
end
|
61
86
|
|
62
|
-
def
|
63
|
-
RestClient.put File.join(@uri,'
|
87
|
+
def parent=(task)
|
88
|
+
#RestClient.put File.join(@uri,'parent'), {:uri => task.uri}
|
89
|
+
resource = RestClient::Resource.new(File.join(@uri,'parent'), :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
90
|
+
LOGGER.debug "task.rb: #{resource}"
|
91
|
+
resource.put :uri => task.uri
|
64
92
|
end
|
65
93
|
|
66
94
|
def pid=(pid)
|
67
|
-
|
95
|
+
resource = RestClient::Resource.new(File.join(@uri,'pid'), :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
96
|
+
resource.put :pid => pid
|
68
97
|
end
|
69
98
|
|
70
99
|
def completed?
|
data/lib/validation.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module OpenTox
|
2
|
+
class Validation
|
3
|
+
|
4
|
+
attr_accessor :uri
|
5
|
+
|
6
|
+
def initialize(params)
|
7
|
+
resource = RestClient::Resource.new(params[:uri], :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
|
8
|
+
@uri = resource.post(params).to_s
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.crossvalidation(params)
|
12
|
+
params[:uri] = File.join(@@config[:services]['opentox-validation'], "crossvalidation")
|
13
|
+
params[:num_folds] = 10 unless params[:num_folds]
|
14
|
+
params[:random_seed] = 2 unless params[:random_seed]
|
15
|
+
params[:stratified] = false unless params[:stratified]
|
16
|
+
OpenTox::Validation.new(params)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentox-ruby-api-wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christoph Helma
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-03-01 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -62,16 +62,6 @@ dependencies:
|
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: "0"
|
64
64
|
version:
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: thin
|
67
|
-
type: :runtime
|
68
|
-
version_requirement:
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - ">="
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: "0"
|
74
|
-
version:
|
75
65
|
- !ruby/object:Gem::Dependency
|
76
66
|
name: emk-sinatra-url-for
|
77
67
|
type: :runtime
|
@@ -123,8 +113,8 @@ dependencies:
|
|
123
113
|
version: "0"
|
124
114
|
version:
|
125
115
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
127
|
-
type: :
|
116
|
+
name: cucumber
|
117
|
+
type: :development
|
128
118
|
version_requirement:
|
129
119
|
version_requirements: !ruby/object:Gem::Requirement
|
130
120
|
requirements:
|
@@ -133,8 +123,8 @@ dependencies:
|
|
133
123
|
version: "0"
|
134
124
|
version:
|
135
125
|
- !ruby/object:Gem::Dependency
|
136
|
-
name:
|
137
|
-
type: :
|
126
|
+
name: jeweler
|
127
|
+
type: :development
|
138
128
|
version_requirement:
|
139
129
|
version_requirements: !ruby/object:Gem::Requirement
|
140
130
|
requirements:
|
@@ -143,7 +133,7 @@ dependencies:
|
|
143
133
|
version: "0"
|
144
134
|
version:
|
145
135
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
136
|
+
name: thin
|
147
137
|
type: :development
|
148
138
|
version_requirement:
|
149
139
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -155,6 +145,7 @@ dependencies:
|
|
155
145
|
description: Ruby wrapper for the OpenTox REST API (http://www.opentox.org)
|
156
146
|
email: helma@in-silico.ch
|
157
147
|
executables:
|
148
|
+
- opentox-install-ubuntu.sh
|
158
149
|
- opentox-install-debian.sh
|
159
150
|
- yaml2owl.rb
|
160
151
|
extensions: []
|
@@ -168,11 +159,12 @@ files:
|
|
168
159
|
- Rakefile
|
169
160
|
- VERSION
|
170
161
|
- bin/opentox-install-debian.sh
|
162
|
+
- bin/opentox-install-ubuntu.sh
|
171
163
|
- bin/yaml2owl.rb
|
172
164
|
- lib/algorithm.rb
|
165
|
+
- lib/authorization.rb
|
173
166
|
- lib/compound.rb
|
174
167
|
- lib/config/config_ru.rb
|
175
|
-
- lib/config/database.rb
|
176
168
|
- lib/dataset.rb
|
177
169
|
- lib/environment.rb
|
178
170
|
- lib/helper.rb
|
@@ -184,7 +176,9 @@ files:
|
|
184
176
|
- lib/task.rb
|
185
177
|
- lib/tasks/opentox.rb
|
186
178
|
- lib/templates/config.yaml
|
179
|
+
- lib/templates/users.yaml
|
187
180
|
- lib/utils.rb
|
181
|
+
- lib/validation.rb
|
188
182
|
has_rdoc: true
|
189
183
|
homepage: http://github.com/helma/opentox-ruby-api-wrapper
|
190
184
|
licenses: []
|
data/lib/config/database.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# database
|
2
|
-
if @@config[:database]
|
3
|
-
require 'dm-core'
|
4
|
-
require 'dm-serializer'
|
5
|
-
require 'dm-timestamps'
|
6
|
-
require 'dm-types'
|
7
|
-
case @@config[:database][:adapter]
|
8
|
-
when /sqlite/i
|
9
|
-
db_dir = File.join(ENV['HOME'], ".opentox", "db")
|
10
|
-
FileUtils.mkdir_p db_dir
|
11
|
-
DataMapper::setup(:default, "sqlite3://#{db_dir}/opentox.sqlite3")
|
12
|
-
else
|
13
|
-
DataMapper.setup(:default, {
|
14
|
-
:adapter => @@config[:database][:adapter],
|
15
|
-
:database => @@config[:database][:database],
|
16
|
-
:username => @@config[:database][:username],
|
17
|
-
:password => @@config[:database][:password],
|
18
|
-
:host => @@config[:database][:host]})
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|