module Bio::GFFbrowser::Helpers::Record

Public Class Methods

formatID(rec) click to toggle source

Format a record ID by, first, getting the ID attribute. If that fails the seqname is used with the start/stop positions.

# File lib/bio/db/gff/gffcomponent.rb, line 21
def Record::formatID rec  
  id = rec.id if rec.id
  if !id
    if rec.seqname
      id = "#{rec.seqname} #{rec.start} #{rec.end}".strip
    else
      id = 'unknown'
      log = Bio::Log::LoggerPlus['bio-gff3']
      log.warn "Record with unknown ID"+rec.to_s.chomp
    end
  end
  id
end