[BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme analysis.rb, 1.3, 1.4

Trevor Wennblom trevor at pub.open-bio.org
Tue Feb 28 22:21:50 UTC 2006


Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme
In directory pub.open-bio.org:/tmp/cvs-serv12598

Modified Files:
	analysis.rb 
Log Message:
Error handling for when a match isn't found.


Index: analysis.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/analysis.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** analysis.rb	18 Feb 2006 22:11:35 -0000	1.3
--- analysis.rb	28 Feb 2006 22:21:48 -0000	1.4
***************
*** 93,96 ****
--- 93,97 ----
      sequence = Bio::Sequence::NA.new( sequence )
      enzyme_actions = create_enzyme_actions( sequence, *args )
+     return nil if enzyme_actions.empty?
      permutations = permute(enzyme_actions.size)
  
***************
*** 201,204 ****
--- 202,207 ----
    def unique_fragments_for_display( hash_of_sequence_ranges_with_cuts )
      uf_ary = UniqueFragments.new
+     return uf_ary if hash_of_sequence_ranges_with_cuts == nil or hash_of_sequence_ranges_with_cuts.empty?
+ 
      hash_of_sequence_ranges_with_cuts.each do |permutation, sr_with_cuts|
        sr_with_cuts.fragments.for_display.each do |fragment|




More information about the bioruby-cvs mailing list