nano-lazar 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +8 -0
- data/LICENSE.md +596 -0
- data/README.md +52 -0
- data/VERSION +1 -0
- data/application.rb +185 -0
- data/bin/nano-lazar-start +8 -0
- data/bin/nano-lazar-start.sh +8 -0
- data/bin/nano-lazar-stop +5 -0
- data/bin/nano-lazar-stop.sh +52 -0
- data/config.ru +13 -0
- data/feature-filter.rb +36 -0
- data/helper.rb +1 -0
- data/nano-lazar.gemspec +31 -0
- data/npo.rb +11 -0
- data/public/css/bootstrap.min.css +6 -0
- data/public/css/images/black-asc.gif +0 -0
- data/public/css/images/black-desc.gif +0 -0
- data/public/css/images/black-unsorted.gif +0 -0
- data/public/css/images/bootstrap-black-unsorted.png +0 -0
- data/public/css/images/bootstrap-white-unsorted.png +0 -0
- data/public/css/images/dragtable-handle.png +0 -0
- data/public/css/images/dragtable-handle.svg +7 -0
- data/public/css/images/dropbox-asc-hovered.png +0 -0
- data/public/css/images/dropbox-asc.png +0 -0
- data/public/css/images/dropbox-desc-hovered.png +0 -0
- data/public/css/images/dropbox-desc.png +0 -0
- data/public/css/images/first.png +0 -0
- data/public/css/images/green-asc.gif +0 -0
- data/public/css/images/green-desc.gif +0 -0
- data/public/css/images/green-header.gif +0 -0
- data/public/css/images/green-unsorted.gif +0 -0
- data/public/css/images/ice-asc.gif +0 -0
- data/public/css/images/ice-desc.gif +0 -0
- data/public/css/images/ice-unsorted.gif +0 -0
- data/public/css/images/last.png +0 -0
- data/public/css/images/loading.gif +0 -0
- data/public/css/images/metro-black-asc.png +0 -0
- data/public/css/images/metro-black-desc.png +0 -0
- data/public/css/images/metro-loading.gif +0 -0
- data/public/css/images/metro-unsorted.png +0 -0
- data/public/css/images/metro-white-asc.png +0 -0
- data/public/css/images/metro-white-desc.png +0 -0
- data/public/css/images/next.png +0 -0
- data/public/css/images/prev.png +0 -0
- data/public/css/images/white-asc.gif +0 -0
- data/public/css/images/white-desc.gif +0 -0
- data/public/css/images/white-unsorted.gif +0 -0
- data/public/css/jquery-ui.css +1225 -0
- data/public/css/jquery-ui.theme.min.css +5 -0
- data/public/css/style.css +16 -0
- data/public/css/theme.bootstrap.min.css +1 -0
- data/public/css/theme.default.min.css +1 -0
- data/public/enm-workshop.html +468 -0
- data/public/enm-workshop.rst +98 -0
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +288 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/public/images/Email.png +0 -0
- data/public/images/Facebook.png +0 -0
- data/public/images/Google+.png +0 -0
- data/public/images/IST_logo_s.png +0 -0
- data/public/images/LinkedIn.png +0 -0
- data/public/images/Twitter.png +0 -0
- data/public/images/enm-sm.jpg +0 -0
- data/public/images/enm_logo.png +0 -0
- data/public/images/favicon.ico +0 -0
- data/public/images/ist_logo.png +0 -0
- data/public/images/wait30trans.gif +0 -0
- data/public/javascripts/bootstrap.min.js +7 -0
- data/public/javascripts/google_analytics.js +7 -0
- data/public/javascripts/jquery-1.11.2.min.js +4 -0
- data/public/javascripts/jquery-ui-1.10.3.custom.min.js +6 -0
- data/public/javascripts/jquery.bpopup.min.js +7 -0
- data/public/javascripts/jquery.doubleScroll.js +126 -0
- data/public/javascripts/jquery.tablesorter.min.js +2 -0
- data/public/javascripts/jquery.tablesorter.staticrow.min.js +1 -0
- data/public/javascripts/jquery.tablesorter.widgets.js +2917 -0
- data/public/javascripts/jquery.tools.min.js +5 -0
- data/public/javascripts/lazar-gui.js +11 -0
- data/public/javascripts/nanolazar.js +11 -0
- data/public/javascripts/widget-scroller.js +921 -0
- data/public/ui/small-white/blank.gif +0 -0
- data/public/ui/small-white/framing.css +24 -0
- data/public/ui/small-white/iepngfix.htc +42 -0
- data/public/ui/small-white/opera.css +8 -0
- data/public/ui/small-white/outline.css +16 -0
- data/public/ui/small-white/pretty.css +114 -0
- data/public/ui/small-white/print.css +24 -0
- data/public/ui/small-white/s5-core.css +11 -0
- data/public/ui/small-white/slides.css +10 -0
- data/public/ui/small-white/slides.js +558 -0
- data/unicorn.rb +2 -0
- data/views/layout.haml +95 -0
- data/views/license.haml +1 -0
- data/views/predict.haml +299 -0
- data/views/prediction.haml +152 -0
- metadata +235 -0
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.1.0
|
data/application.rb
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
require 'qsar-report'
|
2
|
+
require 'rdiscount'
|
3
|
+
require File.join './npo.rb'
|
4
|
+
$ambit_search = "http://data.enanomapper.net/substance?type=name&search="
|
5
|
+
|
6
|
+
include OpenTox
|
7
|
+
|
8
|
+
# collect nanoparticles from training dataset (Au + Ag)
|
9
|
+
dataset = Dataset.find_by(:name=> "Protein Corona Fingerprinting Predicts the Cellular Interaction of Gold and Silver Nanoparticles")
|
10
|
+
$nanoparticles = dataset.nanoparticles
|
11
|
+
$coating_list = $nanoparticles.collect{|n| n if !n.coating[0].smiles.nil?}.compact.uniq
|
12
|
+
|
13
|
+
configure :development do
|
14
|
+
#$logger = Logger.new(STDOUT)
|
15
|
+
end
|
16
|
+
|
17
|
+
before do
|
18
|
+
@version = File.read("VERSION").chomp
|
19
|
+
end
|
20
|
+
|
21
|
+
get '/?' do
|
22
|
+
redirect to('/predict')
|
23
|
+
end
|
24
|
+
#=begin
|
25
|
+
get '/qmrf-report/:id' do
|
26
|
+
prediction_model = OpenTox::Model::Validation.find(params[:id])
|
27
|
+
if prediction_model
|
28
|
+
model = prediction_model.model
|
29
|
+
model_type = "regression"
|
30
|
+
report = QMRFReport.new
|
31
|
+
if File.directory?("#{File.dirname(__FILE__)}/../../lazar")
|
32
|
+
lazar_commit = `cd #{File.dirname(__FILE__)}/../../lazar; git rev-parse HEAD`.strip
|
33
|
+
lazar_commit = "https://github.com/opentox/lazar/tree/#{lazar_commit}"
|
34
|
+
else
|
35
|
+
lazar_commit = "https://github.com/opentox/lazar/releases/tag/v#{Gem.loaded_specs["lazar"].version}"
|
36
|
+
end
|
37
|
+
report.value "QSAR_title", "Model for #{prediction_model.species} #{prediction_model.endpoint}"
|
38
|
+
report.change_catalog :software_catalog, :firstsoftware, {:name => "nano-lazar", :description => "nano-lazar toxicity predictions", :number => "1", :url => "https://nano-lazar.in-silico.ch", :contact => "helma@in-silico.ch"}
|
39
|
+
report.ref_catalog :QSAR_software, :software_catalog, :firstsoftware
|
40
|
+
report.value "qmrf_date", "#{Time.now.strftime('%d %B %Y')}"
|
41
|
+
report.change_catalog :authors_catalog, :firstauthor, {:name => "Christoph Helma", :affiliation => "in silico toxicology gmbh", :contact => "Rastatterstrasse 41, CH-4057 Basel, Switzerland", :email => "helma@in-silico.ch", :number => "1", :url => "http://in-silico.ch"}
|
42
|
+
report.ref_catalog :qmrf_authors, :authors_catalog, :firstauthor
|
43
|
+
report.change_catalog :authors_catalog, :modelauthor, {:name => "Christoph Helma", :affiliation => "in silico toxicology gmbh", :contact => "Rastatterstrasse 41, CH-4057 Basel, Switzerland", :email => "helma@in-silico.ch", :number => "1", :url => "http://in-silico.ch"}
|
44
|
+
report.ref_catalog :model_authors, :authors_catalog, :modelauthor
|
45
|
+
report.value "model_date", "#{Time.parse(model.created_at.to_s).strftime('%Y')}"
|
46
|
+
report.change_catalog :publications_catalog, :publications_catalog_1, {:title => "Helma, Rautenberg and Gebele (2013), Validation of read across predictions for nanoparticle toxicities ", :url => "in preparation"}
|
47
|
+
report.ref_catalog :references, :publications_catalog, :publications_catalog_1
|
48
|
+
report.value "model_species", prediction_model.species
|
49
|
+
report.change_catalog :endpoints_catalog, :endpoints_catalog_1, {:name => prediction_model.endpoint, :group => ""}
|
50
|
+
report.ref_catalog :model_endpoint, :endpoints_catalog, :endpoints_catalog_1
|
51
|
+
report.value "endpoint_units", "#{prediction_model.unit}"
|
52
|
+
report.value "algorithm_type", "#{model.class.to_s.gsub('Model::Lazar','')}"
|
53
|
+
#TODO add updated algorithms
|
54
|
+
#report.change_catalog :algorithms_catalog, :algorithms_catalog_1, {:definition => "see Helma 2016 and lazar.in-silico.ch, submitted version: #{lazar_commit}", :description => "Neighbor algorithm: #{model.neighbor_algorithm.gsub('_',' ').titleize}#{(model.neighbor_algorithm_parameters[:min_sim] ? ' with similarity > ' + model.neighbor_algorithm_parameters[:min_sim].to_s : '')}"}
|
55
|
+
#report.ref_catalog :algorithm_explicit, :algorithms_catalog, :algorithms_catalog_1
|
56
|
+
#report.change_catalog :algorithms_catalog, :algorithms_catalog_3, {:definition => "see Helma 2016 and lazar.in-silico.ch, submitted version: #{lazar_commit}", :description => "modified k-nearest neighbor #{model_type}"}
|
57
|
+
#report.ref_catalog :algorithm_explicit, :algorithms_catalog, :algorithms_catalog_3
|
58
|
+
#if model.prediction_algorithm_parameters
|
59
|
+
# pred_algorithm_params = (model.prediction_algorithm_parameters[:method] == "rf" ? "random forest" : model.prediction_algorithm_parameters[:method])
|
60
|
+
#end
|
61
|
+
#report.change_catalog :algorithms_catalog, :algorithms_catalog_2, {:definition => "see Helma 2016 and lazar.in-silico.ch, submitted version: #{lazar_commit}", :description => "Prediction algorithm: #{model.prediction_algorithm.gsub('Algorithm::','').gsub('_',' ').gsub('.', ' with ')} #{(pred_algorithm_params ? pred_algorithm_params : '')}"}
|
62
|
+
#report.ref_catalog :algorithm_explicit, :algorithms_catalog, :algorithms_catalog_2
|
63
|
+
|
64
|
+
# Descriptors in the model 4.3
|
65
|
+
#if model.neighbor_algorithm_parameters[:type]
|
66
|
+
# report.change_catalog :descriptors_catalog, :descriptors_catalog_1, {:description => "", :name => "#{model.neighbor_algorithm_parameters[:type]}", :publication_ref => "", :units => ""}
|
67
|
+
# report.ref_catalog :algorithms_descriptors, :descriptors_catalog, :descriptors_catalog_1
|
68
|
+
#end
|
69
|
+
|
70
|
+
# Descriptor selection 4.4
|
71
|
+
#report.value "descriptors_selection", "#{model.feature_selection_algorithm.gsub('_',' ')} #{model.feature_selection_algorithm_parameters.collect{|k,v| k.to_s + ': ' + v.to_s}.join(', ')}" if model.feature_selection_algorithm
|
72
|
+
|
73
|
+
response['Content-Type'] = "application/xml"
|
74
|
+
return report.to_xml
|
75
|
+
else
|
76
|
+
bad_request_error "model with id: #{params[:id]} does not exist."
|
77
|
+
end
|
78
|
+
end
|
79
|
+
#=end
|
80
|
+
get '/predict/?' do
|
81
|
+
@prediction_models = []
|
82
|
+
models = OpenTox::Model::Validation.all
|
83
|
+
prediction_models = models.delete_if{|m| m.model.name !~ /\b(Net cell association)\b/}
|
84
|
+
|
85
|
+
# sort and collect prediction models
|
86
|
+
@prediction_models[0] = prediction_models.find{|m| m.model[:algorithms]["descriptors"]["method"] == "fingerprint"}
|
87
|
+
@prediction_models[1] = prediction_models.delete_if{|m| m.model[:algorithms]["descriptors"]["method"] == "fingerprint"}.find{|m| m.model[:algorithms]["descriptors"]["categories"][0] =~ /P-CHEM/}
|
88
|
+
@prediction_models[2] = prediction_models.find{|m| m.model[:algorithms]["descriptors"]["categories"][0] == "Proteomics"}
|
89
|
+
|
90
|
+
# define type (fingerprint,physchem,proteomics)
|
91
|
+
@prediction_models[0]["type"] = "fingerprint"
|
92
|
+
@prediction_models[1]["type"] = "physchem"
|
93
|
+
@prediction_models[2]["type"] = "proteomics"
|
94
|
+
|
95
|
+
# select relevant features for each model
|
96
|
+
@fingerprint_relevant_features = @prediction_models[0].model.substance_ids.collect{|id| Substance.find(id)}
|
97
|
+
fingerprint = $coating_list.sample
|
98
|
+
#fingerprint.properties.delete_if{|id,v| !@fingerprint_relevant_features.include?(Feature.find(id))}
|
99
|
+
@example_fingerprint = fingerprint
|
100
|
+
|
101
|
+
@physchem_relevant_features = @prediction_models[1].model.descriptor_ids.collect{|id, v| Feature.find(id)}
|
102
|
+
physchem = $nanoparticles.sample
|
103
|
+
# only Ag for testing
|
104
|
+
#physchem = $nanoparticles.find{|n| c = Substance.find(n.core_id); c.name == "Ag"}
|
105
|
+
physchem.properties.delete_if{|id,v| !@physchem_relevant_features.include?(Feature.find(id))}
|
106
|
+
@example_physchem = physchem
|
107
|
+
|
108
|
+
@proteomics_relevant_features = @prediction_models[2].model.descriptor_ids.collect{|id, v| Feature.find(id)}
|
109
|
+
proteomics = $nanoparticles.sample
|
110
|
+
proteomics.properties.delete_if{|id,v| !@proteomics_relevant_features.include?(Feature.find(id))}
|
111
|
+
@example_proteomics = proteomics
|
112
|
+
|
113
|
+
|
114
|
+
haml :predict
|
115
|
+
end
|
116
|
+
|
117
|
+
get '/license' do
|
118
|
+
@license = RDiscount.new(File.read("LICENSE.md")).to_html
|
119
|
+
haml :license, :layout => false
|
120
|
+
end
|
121
|
+
|
122
|
+
post '/predict/?' do
|
123
|
+
# select the prediction model
|
124
|
+
prediction_model = OpenTox::Model::Validation.find(params[:prediction_model])
|
125
|
+
size = params[:size].to_i
|
126
|
+
@type = params[:type]
|
127
|
+
|
128
|
+
example_core = params[:example_core]
|
129
|
+
example_coating = params.collect{|k,v| v if k =~ /example_coating_/}.compact
|
130
|
+
|
131
|
+
input_core = params[:input_core]
|
132
|
+
input_coating = params.collect{|k,v| v if k =~ /input_coating_/}.compact
|
133
|
+
|
134
|
+
example_pc = eval(params[:example_pc])
|
135
|
+
input_pc = {}
|
136
|
+
if @type =~ /physchem|proteomics/
|
137
|
+
(1..size).each{|i| input_pc["#{params["input_key_#{i}"]}"] = [params["input_value_#{i}"].to_f] unless params["input_value_#{i}"].blank?}
|
138
|
+
end
|
139
|
+
|
140
|
+
if @type == "fingerprint"
|
141
|
+
# search for database hit
|
142
|
+
dbhit = $coating_list.find{|nano| nano.core.name == input_core && (nano.coating.collect{|co| co.name}) == input_coating }
|
143
|
+
if !dbhit.nil?
|
144
|
+
@match = true
|
145
|
+
nanoparticle = dbhit
|
146
|
+
@nanoparticle = dbhit
|
147
|
+
@name = @nanoparticle.name
|
148
|
+
else
|
149
|
+
# no database hit => create nanoparticle
|
150
|
+
nanoparticle = Nanoparticle.new
|
151
|
+
nanoparticle.core_id = Compound.find_by(:name=>input_core).id.to_s
|
152
|
+
input_coating.each{|ic| nanoparticle.coating_ids << Compound.find_by(:name=>ic).id.to_s}
|
153
|
+
@match = false
|
154
|
+
@nanoparticle = nanoparticle
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
if @type =~ /physchem|proteomics/
|
159
|
+
(@type == "physchem") ? (@physchem_relevant_features = input_pc.collect{|id,v| Feature.find(id)}.compact) : (@physchem_relevant_features = [])
|
160
|
+
(@type == "proteomics") ? (@proteomics_relevant_features = input_pc.collect{|id,v| Feature.find(id)}.compact) : (@proteomics_relevant_features = [])
|
161
|
+
|
162
|
+
if input_pc == example_pc && input_core == example_core #&& input_coating == example_coating
|
163
|
+
# unchanged input = database hit
|
164
|
+
nanoparticle = Nanoparticle.find_by(:id => params[:example_id])
|
165
|
+
nanoparticle.properties = input_pc
|
166
|
+
@match = true
|
167
|
+
@nanoparticle = nanoparticle
|
168
|
+
@name = nanoparticle.name
|
169
|
+
else
|
170
|
+
# changed input = create nanoparticle to predict
|
171
|
+
nanoparticle = Nanoparticle.new
|
172
|
+
nanoparticle.core_id = Compound.find_by(:name=>input_core).id.to_s
|
173
|
+
#nanoparticle.coating_ids = [Compound.find_by(:name=>input_coating).id.to_s] if input_coating
|
174
|
+
nanoparticle.properties = input_pc
|
175
|
+
@match = false
|
176
|
+
@nanoparticle = nanoparticle
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
|
181
|
+
# prediction output
|
182
|
+
@input = input_pc
|
183
|
+
@prediction = prediction_model.model.predict nanoparticle
|
184
|
+
haml :prediction
|
185
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
bin_dir = File.expand_path(File.dirname(__FILE__))
|
3
|
+
shell_script_path = File.join(bin_dir, 'nano-lazar-start.sh')
|
4
|
+
app_dir = File.expand_path('..')
|
5
|
+
unicorn_conf = File.join(app_dir, 'unicorn.rb')
|
6
|
+
|
7
|
+
`#{shell_script_path}`
|
8
|
+
`#{unicorn_conf}`
|
data/bin/nano-lazar-stop
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
grep_nano_lazar=`ps aux | grep -v grep | grep nano-lazar-start`
|
3
|
+
grep_mongo=`ps aux | grep -v grep | grep mongod`
|
4
|
+
grep_rserve=`ps aux | grep -v grep | grep Rserve`
|
5
|
+
grep_unicorn=`ps aux | grep -v grep | grep unicorn`
|
6
|
+
|
7
|
+
# lazar
|
8
|
+
if [ ${#grep_lazar} -gt 0 ]
|
9
|
+
then
|
10
|
+
PID=`ps ax | grep -v grep | grep nano-lazar-start | awk '{ print $1 }'`
|
11
|
+
for i in "${PID}"
|
12
|
+
do
|
13
|
+
`kill $i`
|
14
|
+
done
|
15
|
+
else
|
16
|
+
echo "nano-lazar is stopped."
|
17
|
+
fi
|
18
|
+
|
19
|
+
# mongod
|
20
|
+
if [ ${#grep_mongo} -gt 0 ]
|
21
|
+
then
|
22
|
+
PID=`ps ax | grep -v grep | grep mongod | awk '{ print $1 }'`
|
23
|
+
for i in "${PID}"
|
24
|
+
do
|
25
|
+
`sudo kill $i`
|
26
|
+
done
|
27
|
+
else
|
28
|
+
echo "MongoDB is not running."
|
29
|
+
fi
|
30
|
+
|
31
|
+
# rserve
|
32
|
+
if [ ${#grep_rserve} -gt 0 ]
|
33
|
+
then
|
34
|
+
PID=`ps ax | grep -v grep | grep Rserve | awk '{ print $1 }'`
|
35
|
+
for i in "${PID}"
|
36
|
+
do
|
37
|
+
`kill $i`
|
38
|
+
done
|
39
|
+
else
|
40
|
+
echo "Rserve is not running."
|
41
|
+
fi
|
42
|
+
|
43
|
+
# unicorn
|
44
|
+
if [ ${#grep_unicorn} -gt 0 ]
|
45
|
+
then
|
46
|
+
PID=`ps ax | grep -v grep | grep unicorn | awk '{ print $1 }'`
|
47
|
+
`kill ${PID[0]}`
|
48
|
+
else
|
49
|
+
echo "Unicorn is not running."
|
50
|
+
fi
|
51
|
+
|
52
|
+
exit 0
|
data/config.ru
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
ENV["LAZAR_ENV"] = "development"
|
2
|
+
SERVICE = "nano-lazar-gui"
|
3
|
+
require 'bundler'
|
4
|
+
Bundler.require
|
5
|
+
require File.expand_path './application.rb'
|
6
|
+
require "sinatra/reloader" if development?
|
7
|
+
|
8
|
+
FileUtils.mkdir_p 'log' unless File.exists?('log')
|
9
|
+
log = File.new("log/nano-lazar.log", "a")
|
10
|
+
#$stdout.reopen(log)
|
11
|
+
#$stderr.reopen(log)
|
12
|
+
|
13
|
+
run Sinatra::Application
|
data/feature-filter.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'rserve'
|
2
|
+
require 'json'
|
3
|
+
require 'yaml'
|
4
|
+
require 'csv'
|
5
|
+
|
6
|
+
R = Rserve::Connection.new
|
7
|
+
ENDPOINT = "Cell.association (Net cell association [mL/ug(Mg)])"
|
8
|
+
|
9
|
+
def feature_filter
|
10
|
+
data = JSON.parse(File.read("./data.json"))
|
11
|
+
features = data["G15.AC"]["physchem"].keys
|
12
|
+
R.assign "tox", data.collect{|id,cats| cats["tox"][ENDPOINT]}
|
13
|
+
filtered_features = {}
|
14
|
+
features.each do |feature|
|
15
|
+
R.assign "feature", data.collect{|id,cats| cats["physchem"][feature]}
|
16
|
+
begin
|
17
|
+
#R.eval "cor <- cor.test(-log(tox),-log(feature),use='complete')"
|
18
|
+
R.eval "cor <- cor.test(tox,feature,method = 'pearson',use='complete')"
|
19
|
+
pvalue = R.eval("cor$p.value").to_ruby
|
20
|
+
if pvalue <= 0.05
|
21
|
+
r = R.eval("cor$estimate").to_ruby
|
22
|
+
filtered_features[feature] = {}
|
23
|
+
filtered_features[feature]["pvalue"] = pvalue
|
24
|
+
filtered_features[feature]["r"] = r
|
25
|
+
end
|
26
|
+
rescue
|
27
|
+
f = data.collect{|id,cats| cats["physchem"][feature]}
|
28
|
+
f = R.eval("feature").to_ruby
|
29
|
+
p f.collect{|f| p f; Math.log f}
|
30
|
+
p R.eval("log(feature)").to_ruby
|
31
|
+
end
|
32
|
+
end
|
33
|
+
filtered_features.sort{|a,b| a[1]["pvalue"] <=> b[1]["pvalue"]}.to_h
|
34
|
+
end
|
35
|
+
|
36
|
+
puts feature_filter.to_json
|
data/helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
data/nano-lazar.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "nano-lazar"
|
5
|
+
s.version = File.read("./VERSION")
|
6
|
+
s.authors = ["Christoph Helma","Micha Rautenberg","Denis Gebele"]
|
7
|
+
s.email = ["helma@in-silico.ch","rautenberg@in-silico.ch","gebele@in-silico.ch"]
|
8
|
+
s.homepage = "http://github.com/enanomapper/nano-lazar"
|
9
|
+
s.summary = %q{nano-lazar}
|
10
|
+
s.description = %q{Graphical user interface for nano-lazar toxicology predictions}
|
11
|
+
s.license = 'GPL-3.0'
|
12
|
+
s.executables = ["nano-lazar-start", "nano-lazar-stop"]
|
13
|
+
s.rubyforge_project = "nano-lazar"
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.required_ruby_version = '>= 2.0.0'
|
17
|
+
|
18
|
+
s.add_runtime_dependency "lazar"
|
19
|
+
s.add_runtime_dependency "sinatra"
|
20
|
+
s.add_runtime_dependency "rdiscount"
|
21
|
+
s.add_runtime_dependency "haml"
|
22
|
+
s.add_runtime_dependency "unicorn"
|
23
|
+
s.add_runtime_dependency "gem-path"
|
24
|
+
|
25
|
+
s.post_install_message = %q{
|
26
|
+
How to build nano-lazar prediction models described over here: https://github.com/opentox/lazar-public-data .
|
27
|
+
Service commands:
|
28
|
+
nano-lazar-start
|
29
|
+
nano-lazar-stop
|
30
|
+
}
|
31
|
+
end
|
data/npo.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
$npo = {
|
2
|
+
"Localized Surface Plasmon Resonance (LSPR) index" => "http://bioportal.bioontology.org/ontologies/OBI?p=classes&conceptid=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FOBI_0001136",
|
3
|
+
"ZETA POTENTIAL" => "http://bioportal.bioontology.org/ontologies/ENM?p=classes&conceptid=http%3A%2F%2Fpurl.bioontology.org%2Fontology%2Fnpo%23NPO_1302",
|
4
|
+
"Total protein (BCA assay)" => "http://bioportal.bioontology.org/ontologies/ENM?p=classes&conceptid=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FOAE_0001659",
|
5
|
+
"Core size" => "http://bioportal.bioontology.org/ontologies/ENM?p=classes&conceptid=http%3A%2F%2Fpurl.enanomapper.org%2Fonto%2FENM_8000039",
|
6
|
+
"Z-Average Hydrodynamic Diameter" => "http://bioportal.bioontology.org/ontologies/ENM?p=classes&conceptid=http%3A%2F%2Fpurl.bioontology.org%2Fontology%2Fnpo%23NPO_1915",
|
7
|
+
"Volume Mean Hydrodynamic Diameter" => "http://bioportal.bioontology.org/ontologies/ENM?p=classes&conceptid=http%3A%2F%2Fpurl.bioontology.org%2Fontology%2Fnpo%23NPO_1915",
|
8
|
+
"Intensity Mean Hydrodynamic Diameter" => "http://bioportal.bioontology.org/ontologies/ENM?p=classes&conceptid=http%3A%2F%2Fpurl.bioontology.org%2Fontology%2Fnpo%23NPO_1915",
|
9
|
+
"Autot (ICP-AES)" => "http://bioportal.bioontology.org/ontologies/ERO?p=classes&conceptid=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FERO_0001675",
|
10
|
+
"Polydispersity index" => "http://bioportal.bioontology.org/ontologies/ENM?p=classes&conceptid=http%3A%2F%2Fpurl.bioontology.org%2Fontology%2Fnpo%23NPO_1155"
|
11
|
+
}
|