lib/rbbt/association/item.rb in rbbt-util-5.14.29 vs lib/rbbt/association/item.rb in rbbt-util-5.14.30
- old
+ new
@@ -82,10 +82,11 @@
return [{}] * self.length if fields.nil? or fields.empty?
value = self.value
value.collect{|v|
+ raise "No info for pair; not registered in index" if v.nil?
Hash[*fields.zip(v).flatten]
}
end
property :tsv => :array do
@@ -99,9 +100,15 @@
tsv.entity_options = {:organism => namespace}
knowledge_base.entity_options.each do |type,options|
tsv.entity_options.merge! options
end
tsv
+ end
+
+ property :filter => :array do |*args,&block|
+ keys = tsv.select(*args,&block).keys
+ keys = self.annotate Annotated.purge(keys)
+ keys
end
def self.incidence(pairs, key_field = nil, &block)
matrix = {}
targets = []