Module: ParseFasta::CoreExt::String
- Defined in:
- lib/parse_fasta/core_ext/string.rb
Instance Method Summary collapse
-
#remove_gaps(gap_char = "-") ⇒ String
Removes all gap chars from the string.
Instance Method Details
#remove_gaps(gap_char = "-") ⇒ String
Removes all gap chars from the string.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/parse_fasta/core_ext/string.rb', line 30 def remove_gaps gap_char="-" if gap_char.length > 1 if gap_char.include? "^" gap_char.sub! '^', '\\^' end if gap_char.include? "-" gap_char.sub! '-', '\\-' end end self.tr gap_char, "" end |