Package Bio :: Package SearchIO :: Package ExonerateIO :: Module _base
[hide private]
[frames] | no frames]

Module _base

source code

Bio.SearchIO abstract base parser for Exonerate standard output format.
Classes [hide private]
  _BaseExonerateParser
Abstract iterator for exonerate format.
  _BaseExonerateIndexer
Indexer class for Exonerate plain text.
Functions [hide private]
 
_set_frame(frag)
Sets the HSPFragment frames.
source code
 
_make_triplets(seq, phase=0)
Selects a valid amino acid sequence given a 3-letter code input.
source code
 
_get_fragments_coord(frags)
Returns the letter coordinate of the given list of fragments.
source code
 
_get_fragments_phase(frags)
Returns the phases of the given list of 3-letter amino acid fragments.
source code
 
_adjust_aa_seq(fraglist)
Transforms three-letter amino acid codes into one-letters in the given HSPFragments.
source code
 
_split_fragment(frag)
Splits one HSPFragment containing frame-shifted alignment into two.
source code
 
_create_hsp(hid, qid, hspd)
Returns a list of HSP objects from the given parsed HSP values.
source code
 
_parse_hit_or_query_line(line)
Parse the 'Query:' line of exonerate alignment outputs.
source code
Variables [hide private]
  _STRAND_MAP = {'+': 1, '-': -1, '.': 0}
  _RE_SHIFTS = re.compile(r'(#+)')
  _RE_TRANS = re.compile(r'[53ISCF]')
  __package__ = 'Bio.SearchIO.ExonerateIO'
Function Details [hide private]

_make_triplets(seq, phase=0)

source code 

Selects a valid amino acid sequence given a 3-letter code input.

This function takes a single three-letter amino acid sequence and the phase of the sequence to return the longest intact amino acid sequence possible. Parts of the input sequence before and after the selected sequence are also returned.

This is an internal private function and is meant for parsing Exonerate's three-letter amino acid output.

>>> from Bio.SearchIO.ExonerateIO._base import _make_triplets
>>> _make_triplets('GlyThrSerAlaPro')
('', ['Gly', 'Thr', 'Ser', 'Ala', 'Pro'], '')
>>> _make_triplets('yThSerAla', phase=1)
('y', ['Thr', 'Ser', 'Ala'], '')
>>> _make_triplets('yThSerAlaPr', phase=1)
('y', ['Thr', 'Ser', 'Ala'], 'Pr')

_get_fragments_coord(frags)

source code 

Returns the letter coordinate of the given list of fragments.

This function takes a list of three-letter amino acid sequences and returns a list of coordinates for each fragment had all the input sequences been flattened.

This is an internal private function and is meant for parsing Exonerate's three-letter amino acid output.

>>> from Bio.SearchIO.ExonerateIO._base import _get_fragments_coord
>>> _get_fragments_coord(['Thr', 'Ser', 'Ala'])
[0, 3, 6]
>>> _get_fragments_coord(['Thr', 'SerAlaPro', 'GlyLeu'])
[0, 3, 12, ]
>>> _get_fragments_coord(['Thr', 'SerAlaPro', 'GlyLeu', 'Cys'])
[0, 3, 12, 18]

_get_fragments_phase(frags)

source code 

Returns the phases of the given list of 3-letter amino acid fragments.

This is an internal private function and is meant for parsing Exonerate's three-letter amino acid output.

>>> from Bio.SearchIO.ExonerateIO._base import _get_fragments_phase
>>> _get_fragments_phase(['Thr', 'Ser', 'Ala'])
[0, 0, 0]
>>> _get_fragments_phase(['ThrSe', 'rAla'])
[0, 1]
>>> _get_fragments_phase(['ThrSe', 'rAlaLeu', 'ProCys'])
[0, 1, 0]
>>> _get_fragments_phase(['ThrSe', 'rAlaLeuP', 'roCys'])
[0, 1, 2]
>>> _get_fragments_phase(['ThrSe', 'rAlaLeuPr', 'oCys'])
[0, 1, 1]