Package Bio :: Package SearchIO :: Package _model
[hide private]
[frames] | no frames]

Source Code for Package Bio.SearchIO._model

 1  # Copyright 2012 by Wibowo Arindrarto.  All rights reserved. 
 2  # This code is part of the Biopython distribution and governed by its 
 3  # license.  Please see the LICENSE file that should have been included 
 4  # as part of this package. 
 6  """Bio.SearchIO objects to model homology search program outputs. 
 8  The SearchIO object model consists of a hierarchy of four nested objects: 
10      * QueryResult, to represent a search query. 
12        This is the top-level object returned by the main SearchIO `parse` and 
13        `read` functions. QueryResult objects may contain zero or more Hit 
14        objects, each accessible by its ID string (like in Python dictionaries) 
15        or integer index (like in Python lists). 
17      * Hit, to represent a database entry containing a full or partial sequence 
18        match with the query sequence. 
20        Hit objects contain one or more HSP objects, each accessible by its integer 
21        index. They behave very similar to a Python list. 
23      * HSP, to represent a region of significant alignment(s) between the query 
24        and hit sequences. 
26        HSP objects contain one or more HSPFragment objects, each accessible by 
27        its integer index. In most cases, the HSP objects are where the bulk of 
28        search result statistics (e.g. e-value, bitscore) are stored. Like Hit 
29        objects, HSPs also behave very similar to a Python list. 
31      * HSPFragment, to represent a single contiguous alignment between the query 
32        and hit sequences. 
34        HSPFragment objects may store hit and query sequences resulting from the 
35        sequence search. If present, these sequences are stored as SeqRecord 
36        objects (see SeqRecord). If both of them are present, HSPFragment will 
37        create a MultipleSeqAlignment object from both sequences. 
39        Most search programs only have HSPs with one HSPFragment in them, making 
40        these two objects inseparable. However, there are programs (e.g. BLAT and 
41        Exonerate) which may have more than one HSPFragment objects in any given 
42        HSP. If you are not using these programs, you can safely consider HSP and 
43        HSPFragment as a single union. 
45  """ 
47  from .query import QueryResult 
48  from .hit import Hit 
49  from .hsp import HSP, HSPFragment 
52  __all__ = ['QueryResult', 'Hit', 'HSP', 'HSPFragment'] 
55  # if not used as a module, run the doctest 
56  if __name__ == "__main__": 
57      from Bio._utils import run_doctest 
58      run_doctest()