lazar-gui 1.4.0 → 1.4.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.
- checksums.yaml +4 -4
- data/FAQ.md +23 -5
- data/VERSION +1 -1
- data/application.rb +7 -2
- data/bin/lazar-start.sh +4 -3
- data/config.ru +1 -1
- data/docker/Dockerfile +13 -6
- data/docker/start.sh +1 -1
- data/test/service-test.rb +41 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0ca50134ea890caa141bbe3d1e24c1c0df610a34164157640a50912c2897806
|
4
|
+
data.tar.gz: 624a704eabec8c163847bdc2bda698f1554c7764572c28aec9ed43d7728e4a05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ec258039ef43e623613e13398ce20d1c8899a112f9f3dc54576f2b934c5234c17dea91fdf285685a46833dfff9db76c1752d248be09eca8aac7839b9572e0d2
|
7
|
+
data.tar.gz: e0f152007ba1a716425b9e17b034ab26998a95a914fa03f8a991c6ca203f026050731b184a1da1fbb1700370cc353de3e52e3c3e1c560f30a272086d94d6aba1
|
data/FAQ.md
CHANGED
@@ -1,6 +1,23 @@
|
|
1
1
|
## *lazar* Frequently Asked Questions
|
2
2
|
|
3
|
-
|
3
|
+
### I find multiple entries with different values for the same compound in the list of neighbors. Where do they come from and what is their impact on the prediction?
|
4
|
+
|
5
|
+
Multiple entries for the same structure originate from different biological
|
6
|
+
experiments. `lazar` can use the information from multiple experiments to
|
7
|
+
improve predictions, by considering each measurement as a separate example.
|
8
|
+
This has the effect, that the impact of a neighbor on the prediction is
|
9
|
+
increased, if repeated measurements give the same (classification) or very
|
10
|
+
similar (regression) values, and decreased if the measurements differ a lot.
|
11
|
+
|
12
|
+
### I get different values, if I repeat a prediction for the same compound and endpoint. Why?
|
13
|
+
|
14
|
+
This may happen for regression predictions only. `lazar` uses the random forest
|
15
|
+
algorithm from R's Caret package to build local QSAR models. This algorithm
|
16
|
+
uses *random* internal training set splits for parameter optimisations. This
|
17
|
+
randomness can lead to models with slightly different parameters (and thus
|
18
|
+
predictions) for the same set of neighbors.
|
19
|
+
|
20
|
+
### The *lazar* program's interface has changed, and I am not sure how to use the information given with regard to its confidence. In the former version I would consider a confidence value higher than 0.025 as reliable, but now there is no such parameter in the prediction results.
|
4
21
|
|
5
22
|
In the past many users had problems to interpret the confidence level,
|
6
23
|
for this reason we provide now the probabilities that the prediction
|
@@ -17,7 +34,8 @@ Probabilities are calculated from the activities and similarities of
|
|
17
34
|
neighbors, please make sure to inspect the neighbors list for any
|
18
35
|
inconsistencies that might affect the prediction.
|
19
36
|
|
20
|
-
|
37
|
+
### How can I use *lazar* locally on my computer
|
38
|
+
|
21
39
|
If you are familiar with docker, you can use one of our docker images to run lazar locally:
|
22
40
|
|
23
41
|
[lazar docker image](https://hub.docker.com/r/insilicotox/lazar)
|
@@ -26,13 +44,13 @@ If you are familiar with docker, you can use one of our docker images to run laz
|
|
26
44
|
|
27
45
|
If you want to install lazar/nano-lazar without docker you should know how to use UNIX/Linux and the Ruby programming language. Source code and brief installation instructions for the GUIs is available at:
|
28
46
|
|
29
|
-
[lazar gui source code](https://
|
47
|
+
[lazar gui source code](https://git.in-silico.ch/lazar-gui)
|
30
48
|
|
31
|
-
[nano-lazar gui source code](https://
|
49
|
+
[nano-lazar gui source code](https://git.in-silico.ch/nano-lazar)
|
32
50
|
|
33
51
|
You can also use just the libraries from the command line:
|
34
52
|
|
35
|
-
[lazar|nano-lazar lib](https://
|
53
|
+
[lazar|nano-lazar lib](https://git.in-silico.ch/lazar)
|
36
54
|
|
37
55
|
Documentation is available at:
|
38
56
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.1
|
data/application.rb
CHANGED
@@ -18,10 +18,15 @@ PUBCHEM_CID_URI = PUBCHEM_URI.split("/")[0..-3].join("/")+"/compound/"
|
|
18
18
|
"validation.rb"
|
19
19
|
].each{ |f| require_relative "./lib/#{f}" }
|
20
20
|
|
21
|
-
configure :production
|
21
|
+
configure :production do
|
22
22
|
STDOUT.sync = true
|
23
23
|
$logger = Logger.new(STDOUT)
|
24
|
-
|
24
|
+
end
|
25
|
+
|
26
|
+
configure :development do
|
27
|
+
STDOUT.sync = true
|
28
|
+
$logger = Logger.new(STDOUT)
|
29
|
+
$logger.level = Logger::DEBUG
|
25
30
|
end
|
26
31
|
|
27
32
|
before do
|
data/bin/lazar-start.sh
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
sudo mongod &
|
3
3
|
R CMD Rserve --vanilla &
|
4
|
-
LAZARPATH=$(gem path lazar-gui)
|
5
|
-
cd $LAZARPATH
|
6
|
-
cd $(gem which "lazar-gui"|sed 's#/lib/lazar-gui.rb/##')
|
4
|
+
#LAZARPATH=$(gem path lazar-gui)
|
5
|
+
#cd $LAZARPATH
|
6
|
+
#cd $(gem which "lazar-gui"|sed 's#/lib/lazar-gui.rb/##')
|
7
|
+
cd `ls -d $(gem environment gemdir)/gems/lazar-gui-*`
|
7
8
|
unicorn -c unicorn.rb -E production
|
8
9
|
|
9
10
|
exit 0
|
data/config.ru
CHANGED
data/docker/Dockerfile
CHANGED
@@ -24,9 +24,7 @@ RUN pacman -Scc --noconfirm
|
|
24
24
|
RUN R -e "install.packages('Rserve', repos='http://rforge.net/')"
|
25
25
|
RUN pip install xlsx2csv
|
26
26
|
|
27
|
-
# install lazar-gui gem
|
28
27
|
RUN echo 'gem: --no-document' > /etc/gemrc
|
29
|
-
RUN gem install lazar-gui
|
30
28
|
|
31
29
|
RUN useradd -ms /bin/bash ist
|
32
30
|
|
@@ -53,11 +51,20 @@ COPY start.sh /home/ist/start.sh
|
|
53
51
|
USER root
|
54
52
|
RUN pacman -U --noconfirm /home/ist/src/mongodb-bin/mongodb-bin*.pkg.tar.xz
|
55
53
|
|
56
|
-
#
|
57
|
-
|
58
|
-
RUN
|
59
|
-
|
54
|
+
# install lazar-gui gem
|
55
|
+
# lazar gem (required from lazar-gui) needs mongodb
|
56
|
+
RUN gem install lazar-gui
|
57
|
+
|
58
|
+
# change owners (temporary workaround)
|
59
|
+
RUN chown ist `ls -d $(gem environment gemdir)/gems/lazar-gui-*`/public
|
60
|
+
RUN chown ist `ls -d $(gem environment gemdir)/gems/lazar-gui-*`/tmp
|
61
|
+
RUN chown ist `ls -d $(gem environment gemdir)/gems/lazar-gui-*`/api/api.json
|
60
62
|
|
61
63
|
USER ist
|
62
64
|
RUN rm -r /home/ist/src
|
65
|
+
# swagger links
|
66
|
+
RUN ln -s /home/ist/swagger-ui/dist/swagger-ui-bundle.js `ls -d $(gem environment gemdir)/gems/lazar-gui-*`/public/swagger-ui-bundle.js
|
67
|
+
RUN ln -s /home/ist/swagger-ui/dist/swagger-ui-standalone-preset.js `ls -d $(gem environment gemdir)/gems/lazar-gui-*`/public/swagger-ui-standalone-preset.js
|
68
|
+
RUN ln -s /home/ist/swagger-ui/dist/swagger-ui.css `ls -d $(gem environment gemdir)/gems/lazar-gui-*`/public/swagger-ui.css
|
69
|
+
|
63
70
|
ENTRYPOINT ["/home/ist/start.sh"]
|
data/docker/start.sh
CHANGED
@@ -8,5 +8,5 @@ R CMD Rserve --vanilla &
|
|
8
8
|
ruby -e "require 'lazar'; include OpenTox; Import.public_data if Model::Validation.all.empty?"
|
9
9
|
|
10
10
|
# start lazar service
|
11
|
-
cd $(gem
|
11
|
+
cd `ls -d $(gem environment gemdir)/gems/lazar-gui-*`
|
12
12
|
unicorn -p 8088 -E production
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'rest-client'
|
3
|
+
require 'nokogiri'
|
4
|
+
require '~/lazar/lib/lazar.rb'
|
5
|
+
$models = OpenTox::Model::Validation.all
|
6
|
+
$r_model = $models.select{|m| m if m.model.name == "LOAEL (training_log10)"}[0].id.to_s
|
7
|
+
$c_model = $models.select{|m| m if m.model.name == "Mutagenicity (kazius)"}[0].id.to_s
|
8
|
+
|
9
|
+
class WebServiceTests < Minitest::Test
|
10
|
+
|
11
|
+
def test_prediction
|
12
|
+
|
13
|
+
# regression
|
14
|
+
response = RestClient.post "http://localhost:8088/predict", {identifier: "O=[N+]([O-])c1ccccc1", selection: {$r_model=>""}}
|
15
|
+
xml = Nokogiri::HTML.parse(response.body)
|
16
|
+
value = xml.css('td')[1].css('p')[2].text.split[1].to_f
|
17
|
+
assert value.between?(0.06,0.09)
|
18
|
+
|
19
|
+
# classification
|
20
|
+
response = RestClient.post "http://localhost:8088/predict", {identifier: "O=[N+]([O-])c1ccccc1", selection: {$c_model=>""}}
|
21
|
+
xml = Nokogiri::HTML.parse(response.body)
|
22
|
+
value = xml.css('td')[1].css('p')[4].text.split.last
|
23
|
+
assert_equal "mutagenic", value
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_validation
|
27
|
+
|
28
|
+
# regression
|
29
|
+
response = RestClient.get "http://localhost:8088/predict/modeldetails/#{$r_model}"
|
30
|
+
xml = Nokogiri::HTML.parse(response.body)
|
31
|
+
links = xml.css('a')
|
32
|
+
assert_equal "Algorithm::Caret.rf", links[3].children.text.strip
|
33
|
+
|
34
|
+
# classification
|
35
|
+
response = RestClient.get "http://localhost:8088/predict/modeldetails/#{$c_model}"
|
36
|
+
xml = Nokogiri::HTML.parse(response.body)
|
37
|
+
links = xml.css('a')
|
38
|
+
assert_equal "Algorithm::Classification.weighted_majority_vote", links[3].children.text.strip
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazar-gui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christoph Helma
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-09-
|
12
|
+
date: 2019-09-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: lazar
|
@@ -360,6 +360,7 @@ files:
|
|
360
360
|
- public/stylesheets/pagination.css
|
361
361
|
- qmrf_report.rb
|
362
362
|
- task.rb
|
363
|
+
- test/service-test.rb
|
363
364
|
- tmp/.gitignore
|
364
365
|
- unicorn.rb
|
365
366
|
- views/batch.haml
|