opentox-ruby 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ = opentox-ruby-api-wrapper
2
+
3
+ Ruby wrapper for the OpenTox REST API (http://www.opentox.org)
4
+
5
+ == Installation
6
+
7
+ Run the following if you haven't already:
8
+
9
+ gem sources -a http://gems.github.com
10
+
11
+ Install the gem:
12
+
13
+ sudo gem install helma-opentox-ruby-api-wrapper
14
+
15
+ == Usage
16
+
17
+ - adjust the settings in $HOME/.opentox/config
18
+ - require 'opentox-ruby-api-wrapper' in your ruby application
19
+ - consult the rdoc API documentation for details
20
+
21
+ == Copyright
22
+
23
+ Copyright (c) 2009 Christoph Helma. See LICENSE for details.
@@ -0,0 +1,87 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "opentox-ruby-api-wrapper"
8
+ gem.summary = %Q{Ruby wrapper for the OpenTox REST API}
9
+ gem.description = %Q{Ruby wrapper for the OpenTox REST API (http://www.opentox.org)}
10
+ gem.email = "helma@in-silico.ch"
11
+ gem.homepage = "http://github.com/helma/opentox-ruby-api-wrapper"
12
+ gem.authors = ["Christoph Helma, Martin Guetlein"]
13
+ # dependencies
14
+ [ "sinatra",
15
+ "emk-sinatra-url-for",
16
+ "sinatra-respond_to",
17
+ "sinatra-static-assets",
18
+ "rest-client",
19
+ "rack",
20
+ "rack-contrib",
21
+ "rack-flash",
22
+ "nokogiri",
23
+ "rubyzip",
24
+ "builder",
25
+ "roo",
26
+ "spreadsheet",
27
+ "google-spreadsheet-ruby",
28
+ "tmail",
29
+ "rinruby",
30
+ "rjb"
31
+ ].each { |dep| gem.add_dependency dep }
32
+ [ "dm-core",
33
+ 'dm-serializer',
34
+ 'dm-timestamps',
35
+ 'dm-types',
36
+ 'dm-migrations',
37
+ "dm-mysql-adapter",
38
+ "dm-validations",
39
+ ].each {|dep| gem.add_dependency dep, ">= 1" }
40
+ gem.add_dependency "haml", ">=3"
41
+ ['cucumber','jeweler'].each { |dep| gem.add_development_dependency dep }
42
+ gem.files = FileList["[A-Z]*", "{bin,generators,lib,test}/**/*", 'lib/jeweler/templates/.gitignore']
43
+ 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/*)
44
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
45
+ end
46
+ Jeweler::GemcutterTasks.new
47
+ rescue LoadError
48
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
49
+ end
50
+
51
+ require 'rake/testtask'
52
+ Rake::TestTask.new(:test) do |test|
53
+ test.libs << 'lib' << 'test'
54
+ test.pattern = 'test/**/*_test.rb'
55
+ test.verbose = true
56
+ end
57
+
58
+ begin
59
+ require 'rcov/rcovtask'
60
+ Rcov::RcovTask.new do |test|
61
+ test.libs << 'test'
62
+ test.pattern = 'test/**/*_test.rb'
63
+ test.verbose = true
64
+ end
65
+ rescue LoadError
66
+ task :rcov do
67
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
68
+ end
69
+ end
70
+
71
+ task :test => :check_dependencies
72
+
73
+ task :default => :test
74
+
75
+ require 'rake/rdoctask'
76
+ Rake::RDocTask.new do |rdoc|
77
+ if File.exist?('VERSION')
78
+ version = File.read('VERSION')
79
+ else
80
+ version = ""
81
+ end
82
+
83
+ rdoc.rdoc_dir = 'rdoc'
84
+ rdoc.title = "opentox-ruby-api-wrapper #{version}"
85
+ rdoc.rdoc_files.include('README*')
86
+ rdoc.rdoc_files.include('lib/**/*.rb')
87
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.6.5
@@ -0,0 +1,105 @@
1
+ #!/bin/bash
2
+ #Installation is tested on Debian Lenny Ubuntu 9.04
3
+ #Update the system
4
+
5
+ ERRLOG='install_err.log'
6
+ INSTALLLOG='install_log.log'
7
+ DATE=$(date +%Y/%m/%d\ %H:%M:%S)
8
+
9
+ echo "================================================="
10
+ echo "Please enshure that the sudo package is installed"
11
+ echo "on your system. "
12
+ echo "On Ubuntu Linux sudo is installed by default."
13
+ echo "If you are unshure check with it 'sudo ls'"
14
+ echo "and installed it with 'apt-get install sudo'"
15
+ echo "and add your username with visudo."
16
+ echo "================================================="
17
+ echo -n "To continue installation press y: "
18
+ read answer
19
+ if [ "$answer" != "y" ]
20
+ then
21
+ echo "exiting the script..."
22
+ exit 1
23
+ fi
24
+
25
+ echo "opentox webservice install log - " $DATE > $INSTALLLOG
26
+ echo "Installing: build-essential"
27
+ sudo apt-get install build-essential >> $INSTALLLOG 2>>$ERRLOG
28
+ echo "Installing: ruby 1.8 with its dev files"
29
+ sudo apt-get install ruby ruby1.8-dev >> $INSTALLLOG 2>>$ERRLOG
30
+ echo "Installing: gems rdoc rubygems and rake"
31
+ sudo apt-get install gems rdoc rubygems rake >> $INSTALLLOG 2>>$ERRLOG
32
+
33
+ echo "Installing rubygems from source. This may take some time"
34
+ wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz >> $INSTALLLOG 2>>$ERRLOG
35
+ tar xzfv rubygems-1.3.5.tgz 2>>$ERRLOG
36
+ cd rubygems-1.3.5 >> $INSTALLLOG 2>>$ERRLOG
37
+ sudo ruby setup.rb 2>>$ERRLOG
38
+ cd ..
39
+
40
+ echo "Adding http://gems.github.com to ruby gem sources"
41
+ sudo gem sources -a http://gems.github.com >> $INSTALLLOG 2>>$ERRLOG
42
+
43
+ #for debian lenny:
44
+ echo "Installing packages: zlib1g-dev tcl curl perl ssh tcl tk8.5"
45
+ sudo apt-get install zlib1g-dev tcl curl perl ssh tcl tk8.5 >> $INSTALLLOG 2>>$ERRLOG
46
+ echo "Installing git from source"
47
+ wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.2.tar.gz >> $INSTALLLOG 2>>$ERRLOG
48
+ tar xzfv git-1.6.5.2.tar.gz 2>>$ERRLOG
49
+ cd git-1.6.5.2 >> $INSTALLLOG 2>>$ERRLOG
50
+ ./configure 2>>$ERRLOG
51
+ make 2>>$ERRLOG
52
+ make install 2>>$ERRLOG
53
+
54
+ echo "Installing the opentox webservices"
55
+ mkdir webservices >> $INSTALLLOG 2>>$ERRLOG
56
+ cd webservices >> $INSTALLLOG 2>>$ERRLOG
57
+
58
+ git clone git://github.com/helma/opentox-compound.git >> $INSTALLLOG 2>>$ERRLOG
59
+ git clone git://github.com/helma/opentox-feature.git >> $INSTALLLOG 2>>$ERRLOG
60
+ git clone git://github.com/helma/opentox-dataset.git >> $INSTALLLOG 2>>$ERRLOG
61
+ git clone git://github.com/helma/opentox-algorithm.git >> $INSTALLLOG 2>>$ERRLOG
62
+ git clone git://github.com/helma/opentox-model.git >> $INSTALLLOG 2>>$ERRLOG
63
+ git clone git://github.com/helma/opentox-test.git >> $INSTALLLOG 2>>$ERRLOG
64
+
65
+ cd opentox-compound >> $INSTALLLOG 2>>$ERRLOG
66
+ git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
67
+ cd ../opentox-feature >> $INSTALLLOG 2>>$ERRLOG
68
+ git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
69
+ cd ../opentox-dataset >> $INSTALLLOG 2>>$ERRLOG
70
+ git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
71
+ cd ../opentox-algorithm >> $INSTALLLOG 2>>$ERRLOG
72
+ git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
73
+ cd ../opentox-model >> $INSTALLLOG 2>>$ERRLOG
74
+ git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
75
+ cd .. >> $INSTALLLOG 2>>$ERRLOG
76
+ git clone git://github.com/helma/opentox-ruby-api-wrapper.git >> $INSTALLLOG 2>>$ERRLOG
77
+ cd opentox-ruby-api-wrapper >> $INSTALLLOG 2>>$ERRLOG
78
+ git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
79
+ rake install >> $INSTALLLOG 2>>$ERRLOG
80
+
81
+
82
+ cd ../opentox-compound >> $INSTALLLOG 2>>$ERRLOG
83
+ echo "Installing libopenssl-ruby"
84
+ sudo apt-get install libopenssl-ruby >> $INSTALLLOG 2>>$ERRLOG
85
+ echo "Installing dtach"
86
+ rake dtach:install >> $INSTALLLOG 2>>$ERRLOG
87
+ echo "Installing openbabel"
88
+ rake openbabel:install >> $INSTALLLOG 2>>$ERRLOG
89
+
90
+ #debian lenny missed liblink:
91
+ ln -s /usr/local/lib/libopenbabel.so.3 /usr/lib/libopenbabel.so.3 >> $INSTALLLOG 2>>$ERRLOG
92
+
93
+ rake redis:download >> $INSTALLLOG 2>>$ERRLOG
94
+ rake redis:install >> $INSTALLLOG 2>>$ERRLOG
95
+ #edit /home/[username]/.opentox/config/test.yaml set :base_dir: /home/[username]/webservices
96
+ sudo apt-get install libgsl0-dev >> $INSTALLLOG 2>>$ERRLOG
97
+ sudo apt-get install swig >> $INSTALLLOG 2>>$ERRLOG
98
+ sudo apt-get install curl >> $INSTALLLOG 2>>$ERRLOG
99
+ cd ../opentox-algorithm >> $INSTALLLOG 2>>$ERRLOG
100
+ echo "Installing fminer"
101
+ rake fminer:install >> $INSTALLLOG 2>>$ERRLOG
102
+ sudo apt-get install libsqlite3-dev >> $INSTALLLOG 2>>$ERRLOG
103
+
104
+
105
+ mkdir ../opentox-model/db >> $INSTALLLOG 2>>$ERRLOG
@@ -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 sinatra-respond_to | 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