class Bio::GFFbrowser::Helpers::LinkedRecs
Helper class for storing linked records based on a shared ID
Public Instance Methods
add(id, rec)
click to toggle source
# File lib/bio/db/gff/gffvalidate.rb, line 37 def add id, rec info "Adding #{rec.feature_type} (validate)",id raise "ID should not be empty" if id == nil or id == "" self[id] = [] if self[id] == nil self[id] << rec end
validate_nonoverlapping()
click to toggle source
walk all (CDS) lists for every container/component and validate they do not overlap
# File lib/bio/db/gff/gffvalidate.rb, line 77 def validate_nonoverlapping each do | id, rec | sections = Sections::sort(rec) sections.each_with_index do | check, i | neighbour = sections[i+1] if neighbour and check.intersection(neighbour) warn "Overlapping sections for ",id end end end end
validate_seqname()
click to toggle source
Validate
all lists belong to the same container/component
# File lib/bio/db/gff/gffvalidate.rb, line 45 def validate_seqname each do | id, rec | seqname = rec.first.seqname rec.each do | section | raise "Non-matching seqname #{section.seqname} in #{seqname}" if section.seqname != seqname end end end