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

Trevor Wennblom trevor at pub.open-bio.org
Sat Feb 18 22:11:38 UTC 2006


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

Modified Files:
	analysis.rb 
Log Message:
Check for empty strings as input and return nil if found.


Index: analysis.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/analysis.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** analysis.rb	18 Feb 2006 22:00:55 -0000	1.2
--- analysis.rb	18 Feb 2006 22:11:35 -0000	1.3
***************
*** 71,74 ****
--- 71,75 ----
  
    def cut_without_permutations( sequence, *args )
+     return nil if !sequence.kind_of?(String) or sequence.empty?
      sequence = Bio::Sequence::NA.new( sequence )
      enzyme_actions = create_enzyme_actions( sequence, *args )
***************
*** 89,92 ****
--- 90,94 ----
  
    def cut_and_return_by_permutations( sequence, *args )
+     return nil if !sequence.kind_of?(String) or sequence.empty?
      sequence = Bio::Sequence::NA.new( sequence )
      enzyme_actions = create_enzyme_actions( sequence, *args )
***************
*** 159,162 ****
--- 161,165 ----
  
    def cut( sequence, *args )
+     return nil if !sequence.kind_of?(String) or sequence.empty?
      hash_of_sequence_ranges_with_cuts = cut_and_return_by_permutations( sequence, *args )
      unique_fragments_for_display( hash_of_sequence_ranges_with_cuts )




More information about the bioruby-cvs mailing list