Method: Bio::Locations#initialize

Defined in:
lib/bio/location.rb

#initialize(position) ⇒ Locations

Parses a GenBank style position string and returns a Bio::Locations object, which contains a list of Bio::Location objects.

locations = Bio::Locations.new('join(complement(500..550), 600..625)')

Arguments:

  • (required) str: GenBank style position string

Returns

Bio::Locations object



324
325
326
327
328
329
330
331
332
# File 'lib/bio/location.rb', line 324

def initialize(position)
  @operator = nil
  if position.is_a? Array
    @locations = position
  else
    position   = gbl_cleanup(position)  # preprocessing
    @locations = gbl_pos2loc(position)  # create an Array of Bio::Location objects
  end
end