lib/rbbt/association/item.rb in rbbt-util-5.14.14 vs lib/rbbt/association/item.rb in rbbt-util-5.14.15
- old
+ new
@@ -21,10 +21,18 @@
property :source => :array2single do
self.clean_annotations.collect{|p| p[/[^~]+/] }
end
+ property :target_entity_type => :both do
+ Entity.formats[target_type].to_s
+ end
+
+ property :source_entity_type => :both do
+ Entity.formats[source_type].to_s
+ end
+
property :target_type => :both do
type = reverse ? knowledge_base.source(database) : knowledge_base.target(database)
end
property :source_type => :both do
@@ -66,9 +74,13 @@
fields = [self.source_type, self.target_type].concat info_fields
type = [self.source_type, self.target_type] * "~"
tsv = TSV.setup({}, :key_field => type, :fields => fields, :type => :list, :namespace => self.namespace)
self.each do |match|
tsv[match] = [match.source, match.target].concat match.info.values_at(*info_fields)
+ end
+ tsv.entity_options = {:organism => namespace}
+ knowledge_base.entity_options.each do |type,options|
+ tsv.entity_options.merge! options
end
tsv
end
def self.incidence(pairs, key_field = nil)