[BioRuby-cvs] bioruby/lib/bio map.rb,1.1,1.2

Jan Aerts aerts at dev.open-bio.org
Thu May 4 13:36:18 UTC 2006


Update of /home/repository/bioruby/bioruby/lib/bio
In directory dev.open-bio.org:/tmp/cvs-serv19128

Modified Files:
	map.rb 
Log Message:
* require 'bio/location'
* attr_accessor bug for @mappings in Bio::Map::Marker solved


Index: map.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/map.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** map.rb	4 May 2006 13:26:04 -0000	1.1
--- map.rb	4 May 2006 13:36:16 -0000	1.2
***************
*** 5,8 ****
--- 5,10 ----
  #               Jan Aerts <jan.aerts at bbsrc.ac.uk>
  # License::     Ruby's
+ require 'bio/location'
+ 
  module Bio
    # = DESCRIPTION
***************
*** 32,39 ****
    # 
    # = USAGE
!   #   marker_a = Bio::Map::Marker.new('marker_a')
!   #   marker_b = Bio::Map::Marker.new('marker_b')
!   #   map_A = Bio::Map::SimpleMap.new('map_A', 'linkage', 'cM')
!   #   puts map_A.contains_marker?('marker_b')   # method defined in Bio::Map::ActsLikeMap
    #
    # = TODO
--- 34,58 ----
    # 
    # = USAGE
!   #  my_marker1 = Bio::Map::Marker.new('marker1')
!   #  my_marker2 = Bio::Map::Marker.new('marker2')
!   #  my_marker3 = Bio::Map::Marker.new('marker3')
!   #  
!   #  my_map1 = Bio::Map::SimpleMap.new('RH_map_ABC (2006)', 'RH', 'cR')
!   #  my_map2 = Bio::Map::SimpleMap.new('consensus', 'linkage', 'cM')
!   #  
!   #  my_map1.add_mapping(my_marker1, '17')
!   #  my_map1.add_mapping(Bio::Map::Marker.new('marker2'), '5')
!   #  my_marker3.add_mapping(my_map1, '9')
!   #  
!   #  puts "Does my_map1 contain marker3? => " + my_map1.contains_marker?(my_marker3).to_s
!   #  puts "Does my_map2 contain marker3? => " + my_map2.contains_marker?(my_marker3).to_s
!   #  
!   #  my_map1.sort.each do |mapping|
!   #    puts mapping.map.name + "\t" + mapping.marker.name + "\t" + mapping.location.from.to_s + ".." + mapping.location.to.to_s
!   #  end
!   #  puts my_map1.min.marker.name
!   #  my_map2.each do |mapping|
!   #    puts mapping.map.name + "\t" + mapping.marker.name + "\t" + mapping.location.from.to_s + ".." + mapping.location.to.to_s
!   #  end
    #
    # = TODO
***************
*** 187,191 ****
        # * nil if the argument is not a Bio::Location object
        def <=>(other)
!         unless other.kind_of(Bio::Map::Mapping)
            raise "[Error] markers are not comparable"
          end
--- 206,210 ----
        # * nil if the argument is not a Bio::Location object
        def <=>(other)
!         unless other.kind_of?(Bio::Map::Mapping)
            raise "[Error] markers are not comparable"
          end
***************
*** 256,260 ****
  			
        # Array of mappings for the marker
!       :mappings
      end # Marker
    end # Map
--- 275,279 ----
  			
        # Array of mappings for the marker
!       attr_accessor :mappings
      end # Marker
    end # Map




More information about the bioruby-cvs mailing list