[BioRuby-cvs] bioruby/lib/bio map.rb,1.4,1.5

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


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

Modified Files:
	map.rb 
Log Message:
Only positions of markers /on the same map/ can be compared.


Index: map.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/map.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** map.rb	4 May 2006 16:20:50 -0000	1.4
--- map.rb	4 May 2006 18:41:08 -0000	1.5
***************
*** 4,8 ****
  # Copyright::   Copyright (C) 2006
  #               Jan Aerts <jan.aerts at bbsrc.ac.uk>
! # License::     Ruby's
  require 'bio/location'
  
--- 4,9 ----
  # Copyright::   Copyright (C) 2006
  #               Jan Aerts <jan.aerts at bbsrc.ac.uk>
! # Licence::     Ruby's
! #
  require 'bio/location'
  
***************
*** 209,212 ****
--- 210,217 ----
            raise "[Error] markers are not comparable"
          end
+ 	unless @map.equal?(other.map)
+ 	  raise "[Error] maps have to be the same"
+ 	end
+ 
          return self.location.<=>(other.location)
        end
***************
*** 292,303 ****
    my_marker3.add_mapping_to_map(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
--- 297,310 ----
    my_marker3.add_mapping_to_map(my_map1, '9')
  
+   my_map2.add_mapping_to_marker(my_marker1, '57')
  
    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




More information about the bioruby-cvs mailing list