module Bio::Map


The Bio::Map contains classes that describe mapping information and can be used to contain linkage maps, radiation-hybrid maps, etc. As the same marker can be mapped to more than one map, and a single map typically contains more than one marker, the link between the markers and maps is handled by Bio::Map::Mapping objects. Therefore, to link a map to a marker, a Bio::Map::Mapping object is added to that Bio::Map. See usage below.

Not only maps in the strict sense have map-like features (and similarly not only markers in the strict sense have marker-like features). For example, a microsatellite is something that can be mapped on a linkage map (and hence becomes a 'marker'), but a clone can also be mapped to a cytogenetic map. In that case, the clone acts as a marker and has marker-like properties. That same clone can also be considered a 'map' when BAC-end sequences are mapped to it. To reflect this flexibility, the modules Bio::Map::ActsLikeMap and Bio::Map::ActsLikeMarker define methods that are typical for maps and markers.


my_marker1 ='marker1')
my_marker2 ='marker2')
my_marker3 ='marker3')

my_map1 ='RH_map_ABC (2006)', 'RH', 'cR')
my_map2 ='consensus', 'linkage', 'cM')

my_map1.add_mapping_as_map(my_marker1, '17')
my_map1.add_mapping_as_map('marker2'), '5')
my_marker3.add_mapping_as_marker(my_map1, '9')

print "Does my_map1 contain marker3? => "
puts my_map1.contains_marker?(my_marker3).to_s
print "Does my_map2 contain marker3? => "
puts my_map2.contains_marker?(my_marker3).to_s

my_map1.mappings_as_map.sort.each do |mapping|
  puts [,,
         mapping.location.from.to_s, ].join("\t")

my_map2.mappings_as_map.each do |mapping|
  puts [,,
         mapping.location.from.to_s, ].join("\t")