Module: Bio::RestrictionEnzyme::CutSymbol

Included in:
Bio::RestrictionEnzyme, Bio::RestrictionEnzyme, DoubleStranded, DoubleStranded, DoubleStranded::AlignedStrands, Range::SequenceRange::CalculatedCuts, SingleStrand, SingleStrand::CutLocationsInEnzymeNotation, SingleStrand::CutLocationsInEnzymeNotation, StringFormatting, StringFormatting
Defined in:
lib/bio/util/restriction_enzyme/cut_symbol.rb

Overview

Usage

#require 'bio/util/restriction_enzyme/cut_symbol'
require 'cut_symbol'
include Bio::RestrictionEnzyme::CutSymbol

cut_symbol                            # => "^"
set_cut_symbol('|')                   # => "|"
cut_symbol                            # => "|"
escaped_cut_symbol                    # => "\\|"
re_cut_symbol                         # => /\|/
set_cut_symbol('^')                   # => "^"
"abc^de" =~ re_cut_symbol             # => 3
"abc^de" =~ re_cut_symbol_adjacent    # => nil
"abc^^de" =~ re_cut_symbol_adjacent   # => 3
"a^bc^^de" =~ re_cut_symbol_adjacent  # => 4
"a^bc^de" =~ re_cut_symbol_adjacent   # => nil

Defined Under Namespace

Classes: CutSymbol__

Instance Method Summary (collapse)

Instance Method Details

- (Object) cut_symbol

Get the token that's used as the cut symbol in a restriction enzyme sequece


Arguments

  • none

Returns

glyph



53
# File 'lib/bio/util/restriction_enzyme/cut_symbol.rb', line 53

def cut_symbol; CutSymbol__.cut_symbol; end

- (Object) escaped_cut_symbol

Get the token that's used as the cut symbol in a restriction enzyme sequece with a back-slash preceding it.


Arguments

  • none

Returns

\glyph



62
# File 'lib/bio/util/restriction_enzyme/cut_symbol.rb', line 62

def escaped_cut_symbol; CutSymbol__.escaped_cut_symbol; end

- (Object) re_cut_symbol

A Regexp of the cut_symbol.


Arguments

  • none

Returns

RegExp



80
81
82
# File 'lib/bio/util/restriction_enzyme/cut_symbol.rb', line 80

def re_cut_symbol
  %r"#{escaped_cut_symbol}"
end

- (Object) re_cut_symbol_adjacent

Used to check if multiple cut symbols are next to each other.


Arguments

  • none

Returns

RegExp



70
71
72
# File 'lib/bio/util/restriction_enzyme/cut_symbol.rb', line 70

def re_cut_symbol_adjacent
  %r"#{escaped_cut_symbol}{2}"
end

- (Object) set_cut_symbol(glyph)

Set the token to be used as the cut symbol in a restriction enzyme sequece

Starts as ^ character


Arguments

  • glyph: The single character to be used as the cut symbol in an enzyme sequence

Returns

glyph



43
44
45
# File 'lib/bio/util/restriction_enzyme/cut_symbol.rb', line 43

def set_cut_symbol(glyph)
  CutSymbol__.cut_symbol = glyph
end