Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/bio/BIOExtensions.rb
Instance Method Summary collapse
-
#count_ambiguities ⇒ Object
Monkey patching to count how many ambiguity codes are present in the string, for Nucleic Acids.
-
#upper_case_count ⇒ Object
Counts how many bases are uppercase.
Instance Method Details
#count_ambiguities ⇒ Object
Monkey patching to count how many ambiguity codes are present in the string, for Nucleic Acids
75 76 77 78 79 80 81 82 83 |
# File 'lib/bio/BIOExtensions.rb', line 75 def count_ambiguities snps=0 for i in (0..self.size-1) snps += 1 if !Bio::NucleicAcid.is_unambiguous(self[i]) end snps end |
#upper_case_count ⇒ Object
Counts how many bases are uppercase
86 87 88 |
# File 'lib/bio/BIOExtensions.rb', line 86 def upper_case_count match(/[^A-Z]*/).to_s.size end |