summaryrefslogtreecommitdiff
path: root/lib/dataset.rb
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2012-10-31 17:19:20 +0100
committerAndreas Maunz <andreas@maunz.de>2012-10-31 17:19:20 +0100
commit461a20d9071ad80f334d7a3d8c334e2e085821d2 (patch)
tree225eef328e8219b4481c274a0c04498c31043632 /lib/dataset.rb
parent8a2b749ccef94b229a32ec716c93388f5c7495d7 (diff)
Compounds removed from allnde target
Diffstat (limited to 'lib/dataset.rb')
-rw-r--r--lib/dataset.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 288e4d3..4ce5fc4 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -37,23 +37,34 @@ module OpenTox
# AM: read ordered dataset from RDF
if ordered
+
# Read only some data as rdf
unless have_rdf
self.parse_rdfxml( RestClient.get([@uri,"allnde"].join("/"),{:accept => "application/rdf+xml"}), true )
end
- @compounds = self.find_compounds_rdf
- @features = self.find_features_rdf
+ # Features
+ @features = self.find_features_rdf
numeric_features = @features.collect{|f|
f.get
f[RDF.type].include?(RDF::OT.NumericFeature) or f[RDF.type].include?(RDF::OT.Substructure)
}
+
+ # Compounds
+ if have_rdf
+ @compounds = self.find_compounds_rdf
+ else
+ @compounds = RestClient.get([@uri,"compounds"].join("/"),{:accept => "text/uri-list"}).split("\n").collect { |cmpd| OpenTox::Compound.new cmpd }
+ end
+
+ # Data Entries
if have_rdf
- table = find_data_entries_rdf
+ table = self.find_data_entries_rdf
else
values = OpenTox::Dataset.find_data_entries_sparql(@uri)
table = values + Array.new(@compounds.size*@features.size-values.size, "")
end
+
clim=(@compounds.size-1)
cidx = fidx = 0
num=numeric_features[fidx]