Method: Bio::EMBLDB::Common#dr

Defined in:
lib/bio/db/embl/common.rb

#drObject

returns contents in the DR line.

  • Bio::EMBLDB::Common#dr -> [ <Database cross-reference Hash>* ]

where <Database cross-reference Hash> is:

  • Bio::EMBLDB::Common#dr {|k,v| }

DR Line; defabases cross-reference (>=0) a cross_ref pre one line

"DR  database_identifier; primary_identifier; secondary_identifier."


329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/bio/db/embl/common.rb', line 329

def dr
  unless @data['DR']
    tmp = Hash.new
    self.get('DR').split(/\n/).each do |db|
      a = db.sub(/^DR   /,'').sub(/.$/,'').strip.split(/;[ ]/)
      dbname = a.shift
      tmp[dbname] = Array.new unless tmp[dbname]
      tmp[dbname].push(a)
    end
    @data['DR'] = tmp
  end
  if block_given?
    @data['DR'].each do |k,v|
      yield(k, v)
    end
  else
    @data['DR']
  end
end