Module: Bio::GFFbrowser::Helpers::Record

Includes:
Logger
Defined in:
lib/bio/db/gff/gffcomponent.rb

Class Method Summary collapse

Methods included from Logger

#debug, #error, #info, #log_sys_info, #warn

Class Method Details

.formatID(rec) ⇒ Object

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



21
22
23
24
25
26
27
28
29
30
31
32
33
# 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