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



346
347
348
349
350
351
352
353
354
# File 'lib/bio/location.rb', line 346

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