Package Bio :: Package Alphabet
[hide private]
[frames] | no frames]

Package Alphabet

source code

Alphabets used in Seq objects etc to declare sequence type and letters.

This is used by sequences which contain a finite number of similar words.

Submodules [hide private]

Classes [hide private]
  Alphabet
  SingleLetterAlphabet
  ProteinAlphabet
  NucleotideAlphabet
  DNAAlphabet
  RNAAlphabet
  SecondaryStructure
  ThreeLetterProtein
  AlphabetEncoder
  Gapped
  HasStopCodon
Functions [hide private]
 
_get_base_alphabet(alphabet)
Returns the non-gapped non-stop-codon Alphabet object (PRIVATE).
source code
 
_ungap(alphabet)
Returns the alphabet without any gap encoder (PRIVATE).
source code
 
_consensus_base_alphabet(alphabets)
Returns a common but often generic base alphabet object (PRIVATE).
source code
 
_consensus_alphabet(alphabets)
Returns a common but often generic alphabet object (PRIVATE).
source code
 
_check_type_compatible(alphabets)
Returns True except for DNA+RNA or Nucleotide+Protein (PRIVATE).
source code
Variables [hide private]
  generic_alphabet = Alphabet()
  single_letter_alphabet = SingleLetterAlphabet()
  generic_protein = ProteinAlphabet()
  generic_nucleotide = NucleotideAlphabet()
  generic_dna = DNAAlphabet()
  generic_rna = RNAAlphabet()
  __package__ = None
hash(x)
Function Details [hide private]

_consensus_base_alphabet(alphabets)

source code 

Returns a common but often generic base alphabet object (PRIVATE).

This throws away any AlphabetEncoder information, e.g. Gapped alphabets.

Note that DNA+RNA -> Nucleotide, and Nucleotide+Protein-> generic single letter. These DO NOT raise an exception!

_consensus_alphabet(alphabets)

source code 

Returns a common but often generic alphabet object (PRIVATE).

Note that DNA+RNA -> Nucleotide, and Nucleotide+Protein-> generic single letter. These DO NOT raise an exception!

This is aware of Gapped and HasStopCodon and new letters added by other AlphabetEncoders. This WILL raise an exception if more than one gap character or stop symbol is present.

_check_type_compatible(alphabets)

source code 

Returns True except for DNA+RNA or Nucleotide+Protein (PRIVATE).

This relies on the Alphabet subclassing hierarchy. It does not check things like gap characters or stop symbols.