Class: Bio::Map::SimpleMap

Inherits:
Object show all
Includes:
ActsLikeMap
Defined in:
lib/bio/map.rb

Overview

Description

This class handles the essential storage of name, type and units of a map. It includes Bio::Map::ActsLikeMap, and therefore supports the methods of that module.

Usage

my_map1 = Bio::Map::SimpleMap.new('RH_map_ABC (2006)', 'RH', 'cR')
my_map1.add_marker(Bio::Map::Marker.new('marker_a', '17')
my_map1.add_marker(Bio::Map::Marker.new('marker_b', '5')

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ActsLikeMap

#add_mapping_as_map, #contains_marker?

Constructor Details

#initialize(name = nil, type = nil, length = nil, units = nil) ⇒ SimpleMap

Builds a new Bio::Map::SimpleMap object


Arguments:

  • name: name of the map

  • type: type of the map (e.g. linkage, radiation_hybrid, cytogenetic, …)

  • units: unit of the map (e.g. cM, cR, …)

Returns

new Bio::Map::SimpleMap object



353
354
355
356
# File 'lib/bio/map.rb', line 353

def initialize (name = nil, type = nil, length = nil, units = nil)
  @name, @type, @length, @units = name, type, length, units
  @mappings_as_map = Array.new
end

Instance Attribute Details

#lengthObject

Length of the map



365
366
367
# File 'lib/bio/map.rb', line 365

def length
  @length
end

#mappings_as_mapObject

Mappings



371
372
373
# File 'lib/bio/map.rb', line 371

def mappings_as_map
  @mappings_as_map
end

#nameObject

Name of the map



359
360
361
# File 'lib/bio/map.rb', line 359

def name
  @name
end

#typeObject

Type of the map



362
363
364
# File 'lib/bio/map.rb', line 362

def type
  @type
end

#unitsObject

Units of the map



368
369
370
# File 'lib/bio/map.rb', line 368

def units
  @units
end