Class Bio::Map::Mapping
In: lib/bio/map.rb  (CVS)
Parent: Object

Description

Creates a new Bio::Map::Mapping object, which links Bio::Map::ActsAsMap- and Bio::Map::ActsAsMarker-like objects. This class is typically not accessed directly, but through map- or marker-like objects.

Methods

<=>   new  

Included Modules

Comparable

Attributes

location  [RW] 
map  [RW] 
marker  [RW] 

Public Class methods

Creates a new Bio::Map::Mapping object


Arguments:

[Source]

# File lib/bio/map.rb, line 304
      def initialize (map, marker, location = nil)
        @map, @marker, @location = map, marker, location
      end

Public Instance methods

Compares the location of this mapping to another mapping.


Arguments:

Returns::

  • 1 if self < other location
  • -1 if self > other location
  • 0 if both location are the same
  • nil if the argument is not a Bio::Location object

[Source]

# File lib/bio/map.rb, line 318
      def <=>(other)
        unless other.kind_of?(Bio::Map::Mapping)
          raise "[Error] markers are not comparable"
        end
            unless @map.equal?(other.map)
          raise "[Error] maps have to be the same"
        end

        return self.location[0].<=>(other.location[0])
      end

[Validate]