summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FAQ.md28
-rw-r--r--test/service-test.rb41
2 files changed, 64 insertions, 5 deletions
diff --git a/FAQ.md b/FAQ.md
index 00e4f5f..63c2746 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -1,6 +1,23 @@
## *lazar* Frequently Asked Questions
-#### 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. How can I consider a prediction as presenting high or low confidence?
+### 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?
+
+Multiple entries for the same structure originate from different biological
+experiments. `lazar` can use the information from multiple experiments to
+improve predictions, by considering each measurement as a separate example.
+This has the effect, that the impact of a neighbor on the prediction is
+increased, if repeated measurements give the same (classification) or very
+similar (regression) values, and decreased if the measurements differ a lot.
+
+### I get different values, if I repeat a prediction for the same compound and endpoint. Why?
+
+This may happen for regression predictions only. `lazar` uses the random forest
+algorithm from R's Caret package to build local QSAR models. This algorithm
+uses *random* internal training set splits for parameter optimisations. This
+randomness can lead to models with slightly different parameters (and thus
+predictions) for the same set of neighbors.
+
+### 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.
In the past many users had problems to interpret the confidence level,
for this reason we provide now the probabilities that the prediction
@@ -17,7 +34,8 @@ Probabilities are calculated from the activities and similarities of
neighbors, please make sure to inspect the neighbors list for any
inconsistencies that might affect the prediction.
-#### How can I use *lazar* locally on my computer
+### How can I use *lazar* locally on my computer
+
If you are familiar with docker, you can use one of our docker images to run lazar locally:
[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
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:
-[lazar gui source code](https://github.com/opentox/lazar-gui)
+[lazar gui source code](https://git.in-silico.ch/lazar-gui)
-[nano-lazar gui source code](https://github.com/opentox/nano-lazar)
+[nano-lazar gui source code](https://git.in-silico.ch/nano-lazar)
You can also use just the libraries from the command line:
-[lazar|nano-lazar lib](https://github.com/opentox/lazar)
+[lazar|nano-lazar lib](https://git.in-silico.ch/lazar)
Documentation is available at:
diff --git a/test/service-test.rb b/test/service-test.rb
new file mode 100644
index 0000000..de2cc0f
--- /dev/null
+++ b/test/service-test.rb
@@ -0,0 +1,41 @@
+require 'minitest/autorun'
+require 'rest-client'
+require 'nokogiri'
+require '~/lazar/lib/lazar.rb'
+$models = OpenTox::Model::Validation.all
+$r_model = $models.select{|m| m if m.model.name == "LOAEL (training_log10)"}[0].id.to_s
+$c_model = $models.select{|m| m if m.model.name == "Mutagenicity (kazius)"}[0].id.to_s
+
+class WebServiceTests < Minitest::Test
+
+ def test_prediction
+
+ # regression
+ response = RestClient.post "http://localhost:8088/predict", {identifier: "O=[N+]([O-])c1ccccc1", selection: {$r_model=>""}}
+ xml = Nokogiri::HTML.parse(response.body)
+ value = xml.css('td')[1].css('p')[2].text.split[1].to_f
+ assert value.between?(0.06,0.09)
+
+ # classification
+ response = RestClient.post "http://localhost:8088/predict", {identifier: "O=[N+]([O-])c1ccccc1", selection: {$c_model=>""}}
+ xml = Nokogiri::HTML.parse(response.body)
+ value = xml.css('td')[1].css('p')[4].text.split.last
+ assert_equal "mutagenic", value
+ end
+
+ def test_validation
+
+ # regression
+ response = RestClient.get "http://localhost:8088/predict/modeldetails/#{$r_model}"
+ xml = Nokogiri::HTML.parse(response.body)
+ links = xml.css('a')
+ assert_equal "Algorithm::Caret.rf", links[3].children.text.strip
+
+ # classification
+ response = RestClient.get "http://localhost:8088/predict/modeldetails/#{$c_model}"
+ xml = Nokogiri::HTML.parse(response.body)
+ links = xml.css('a')
+ assert_equal "Algorithm::Classification.weighted_majority_vote", links[3].children.text.strip
+ end
+
+end