o
    Rŀgu                     @   sz   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 G dd	 d	eZd
d Zedkr;ddlmZ e  dS dS )z@Bio.SearchIO object to model search results from a single query.    deepcopy)chain)optionalcascade   )_BaseSearchObject)Hitc                   @   s0  e Zd ZdZdZdDddZdd Zed	d
 Zedd Z	edd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zed%d&d'Zed(d)d*Zed+d, Zed-d. Zd/d0 Zd1d2 ZdEd3d4ZdEd5d6ZdEd7d8ZdEd9d:Z e! Z"d;e"fd<d=Z#d>d? Z$dFdBdCZ%dS )GQueryResulta  Class representing search results from a single query.

    QueryResult is the container object that stores all search hits from a
    single search query. It is the top-level object returned by SearchIO's two
    main functions, ``read`` and ``parse``. Depending on the search results and
    search output format, a QueryResult object will contain zero or more Hit
    objects (see Hit).

    You can take a quick look at a QueryResult's contents and attributes by
    invoking ``print`` on it::

        >>> from Bio import SearchIO
        >>> qresult = next(SearchIO.parse('Blast/mirna.xml', 'blast-xml'))
        >>> print(qresult)
        Program: blastn (2.2.27+)
          Query: 33211 (61)
                 mir_1
         Target: refseq_rna
           Hits: ----  -----  ----------------------------------------------------------
                    #  # HSP  ID + description
                 ----  -----  ----------------------------------------------------------
                    0      1  gi|262205317|ref|NR_030195.1|  Homo sapiens microRNA 52...
                    1      1  gi|301171311|ref|NR_035856.1|  Pan troglodytes microRNA...
                    2      1  gi|270133242|ref|NR_032573.1|  Macaca mulatta microRNA ...
                    3      2  gi|301171322|ref|NR_035857.1|  Pan troglodytes microRNA...
                    4      1  gi|301171267|ref|NR_035851.1|  Pan troglodytes microRNA...
                    5      2  gi|262205330|ref|NR_030198.1|  Homo sapiens microRNA 52...
                    6      1  gi|262205302|ref|NR_030191.1|  Homo sapiens microRNA 51...
                    7      1  gi|301171259|ref|NR_035850.1|  Pan troglodytes microRNA...
                    8      1  gi|262205451|ref|NR_030222.1|  Homo sapiens microRNA 51...
                    9      2  gi|301171447|ref|NR_035871.1|  Pan troglodytes microRNA...
                   10      1  gi|301171276|ref|NR_035852.1|  Pan troglodytes microRNA...
                   11      1  gi|262205290|ref|NR_030188.1|  Homo sapiens microRNA 51...
        ...

    If you just want to know how many hits a QueryResult has, you can invoke
    ``len`` on it. Alternatively, you can simply type its name in the interpreter::

        >>> len(qresult)
        100
        >>> qresult
        QueryResult(id='33211', 100 hits)

    QueryResult behaves like a hybrid of Python's built-in list and dictionary.
    You can retrieve its items (Hit objects) using the integer index of the
    item, just like regular Python lists::

        >>> first_hit = qresult[0]
        >>> first_hit
        Hit(id='gi|262205317|ref|NR_030195.1|', query_id='33211', 1 hsps)

    You can slice QueryResult objects as well. Slicing will return a new
    QueryResult object containing only the sliced hits::

        >>> sliced_qresult = qresult[:3]    # slice the first three hits
        >>> len(qresult)
        100
        >>> len(sliced_qresult)
        3
        >>> print(sliced_qresult)
        Program: blastn (2.2.27+)
          Query: 33211 (61)
                 mir_1
         Target: refseq_rna
           Hits: ----  -----  ----------------------------------------------------------
                    #  # HSP  ID + description
                 ----  -----  ----------------------------------------------------------
                    0      1  gi|262205317|ref|NR_030195.1|  Homo sapiens microRNA 52...
                    1      1  gi|301171311|ref|NR_035856.1|  Pan troglodytes microRNA...
                    2      1  gi|270133242|ref|NR_032573.1|  Macaca mulatta microRNA ...

    Like Python dictionaries, you can also retrieve hits using the hit's ID.
    This is useful for retrieving hits that you know should exist in a given
    search::

        >>> hit = qresult['gi|262205317|ref|NR_030195.1|']
        >>> hit
        Hit(id='gi|262205317|ref|NR_030195.1|', query_id='33211', 1 hsps)

    You can also replace a Hit in QueryResult with another Hit using either the
    integer index or hit key string. Note that the replacing object must be a
    Hit that has the same ``query_id`` property as the QueryResult object.

    If you're not sure whether a QueryResult contains a particular hit, you can
    use the hit ID to check for membership first::

        >>> 'gi|262205317|ref|NR_030195.1|' in qresult
        True
        >>> 'gi|262380031|ref|NR_023426.1|' in qresult
        False

    Or, if you just want to know the rank / position of a given hit, you can
    use the hit ID as an argument for the ``index`` method. Note that the values
    returned will be zero-based. So zero (0) means the hit is the first in the
    QueryResult, three (3) means the hit is the fourth item, and so on. If the
    hit does not exist in the QueryResult, a ``ValueError`` will be raised.

        >>> qresult.index('gi|262205317|ref|NR_030195.1|')
        0
        >>> qresult.index('gi|262205330|ref|NR_030198.1|')
        5
        >>> qresult.index('gi|262380031|ref|NR_023426.1|')
        Traceback (most recent call last):
        ...
        ValueError: ...

    To ease working with a large number of hits, QueryResult has several
    ``filter`` and ``map`` methods, analogous to Python's built-in functions with
    the same names. There are ``filter`` and ``map`` methods available for
    operations over both Hit objects or HSP objects. As an example, here we are
    using the ``hit_map`` method to rename all hit IDs within a QueryResult::

        >>> def renamer(hit):
        ...     hit.id = hit.id.split('|')[3]
        ...     return hit
        >>> mapped_qresult = qresult.hit_map(renamer)
        >>> print(mapped_qresult)
        Program: blastn (2.2.27+)
          Query: 33211 (61)
                 mir_1
         Target: refseq_rna
           Hits: ----  -----  ----------------------------------------------------------
                    #  # HSP  ID + description
                 ----  -----  ----------------------------------------------------------
                    0      1  NR_030195.1  Homo sapiens microRNA 520b (MIR520B), micr...
                    1      1  NR_035856.1  Pan troglodytes microRNA mir-520b (MIR520B...
                    2      1  NR_032573.1  Macaca mulatta microRNA mir-519a (MIR519A)...
        ...

    The principle for other ``map`` and ``filter`` methods are similar: they accept
    a function, applies it, and returns a new QueryResult object.

    There are also other methods useful for working with list-like objects:
    ``append``, ``pop``, and ``sort``. More details and examples are available in
    their respective documentations.

    Finally, just like Python lists and dictionaries, QueryResult objects are
    iterable. Iteration over QueryResults will yield Hit objects::

        >>> for hit in qresult[:4]:     # iterate over the first four items
        ...     hit
        ...
        Hit(id='gi|262205317|ref|NR_030195.1|', query_id='33211', 1 hsps)
        Hit(id='gi|301171311|ref|NR_035856.1|', query_id='33211', 1 hsps)
        Hit(id='gi|270133242|ref|NR_032573.1|', query_id='33211', 1 hsps)
        Hit(id='gi|301171322|ref|NR_035857.1|', query_id='33211', 2 hsps)

    If you need access to all the hits in a QueryResult object, you can get
    them in a list using the ``hits`` property. Similarly, access to all hit IDs is
    available through the ``hit_keys`` property.

        >>> qresult.hits
        [Hit(id='gi|262205317|ref|NR_030195.1|', query_id='33211', 1 hsps), ...]
        >>> qresult.hit_keys
        ['gi|262205317|ref|NR_030195.1|', 'gi|301171311|ref|NR_035856.1|', ...]

    )_items__alt_hit_ids Nc                 C   sL   || _ |pt| _i | _d| _i | _d| _d| _d| _|D ]}| 	| qdS )aD  Initialize a QueryResult object.

        :param id: query sequence ID
        :type id: string
        :param hits: iterator yielding Hit objects
        :type hits: iterable
        :param hit_key_function: function to define hit keys
        :type hit_key_function: callable, accepts Hit objects, returns string

        Nz<unknown program>z<unknown target>z<unknown version>)
_id_hit_key_func_hit_key_functionr
   _description_QueryResult__alt_hit_idsprogramtargetversionappend)selfhitsidhit_key_functionhitr   r   M/var/www/html/myenv/lib/python3.10/site-packages/Bio/SearchIO/_model/query.py__init__   s   
zQueryResult.__init__c                 C   
   t | jS )zIterate over hits.)iterr   r   r   r   r   __iter__      
zQueryResult.__iter__c                 C      t | j S )z)Hit objects contained in the QueryResult.)listr
   valuesr   r   r   r   r         zQueryResult.hitsc                 C   r"   )z8Hit IDs of the Hit objects contained in the QueryResult.)r#   r
   keysr   r   r   r   hit_keys   r%   zQueryResult.hit_keysc                 C   r"   )z*List of tuples of Hit IDs and Hit objects.)r#   r
   itemsr   r   r   r   r(      r%   zQueryResult.itemsc                 c       | j  E dH  dS )z(Return an iterator over the Hit objects.N)r
   r$   r   r   r   r   iterhits      zQueryResult.iterhitsc                 c   s    | j E dH  dS )z2Return an iterator over the ID of the Hit objects.N)r
   r   r   r   r   iterhit_keys   s   zQueryResult.iterhit_keysc                 c   r)   )z=Return an iterator yielding tuples of Hit ID and Hit objects.N)r
   r(   r   r   r   r   	iteritems   r+   zQueryResult.iteritemsc                 C   s.   t |tr| || jv S || jv p|| jv S )z?Return True if hit key in items or alternative hit identifiers.)
isinstancer   r   r
   r   r   hit_keyr   r   r   __contains__   s   
zQueryResult.__contains__c                 C   r   )zReturn the number of items.)lenr
   r   r   r   r   __len__   r!   zQueryResult.__len__c                 C   r   )zReturn True if there are items.)boolr
   r   r   r   r   __bool__   r!   zQueryResult.__bool__c                 C   s   d| j t| f S )z7Return string representation of the QueryResult object.zQueryResult(id=%r, %r hits))r   r2   r   r   r   r   __repr__   s   zQueryResult.__repr__c           	      C   s  g }| d| j| jf  d| j }z| j}W n	 ty    Y nw |d| 7 }| | | jrId| j }t|dkrB|dd d n|}| | | d	| j  | j	sZ| d
 n| dd  d}| |d  | |d  t
| j	D ]b\}}|dk rd|j|jf }t|dkr|dd d }| ||t||f  qv|t| j	d krd|j|jf }t|dkr|dd d }| ||t||f  qv|dkr| dd  qvd|S )z:Return a human readable summary of the QueryResult object.zProgram: %s (%s)z  Query: %sz (%i)z         %sP   NM   z...z Target: %sz
   Hits: 0z   Hits: %s  %s  %s)z----z-----z:----------------------------------------------------------z%13s  %5s  %s)#z# HSPzID + description   z%s  %s:   7      z%14sz~~~
)r   r   r   r   seq_lenAttributeErrordescriptionr2   r   r   	enumeratejoin)	r   linesqid_liner?   linepatternidxr   hid_liner   r   r   __str__   sH   



 

zQueryResult.__str__c                 C   s  t |trt| j| }| || j| j}| | |S t |trrt	| }d|  kr/|k rHn nt
|  D ]\}}||krC|  S q7tdd| |  krTdk rnn tdt
|  D ]\}}|| |krm|  S q_tdz| j| W S  ty   | j| j|   Y S w )z5Return a QueryResult object that matches the hit_key.r   zlist index out of range)r.   slicer#   r   	__class__r   r   _transfer_attrsintr2   rB   r*   
IndexErrorr
   KeyErrorr   )r   r0   r   objlengthrH   itemr   r   r   __getitem__/  s2   


zQueryResult.__getitem__c           	      C   s   t |ts	tdt |tstd| j}|j}|dur)||kr(td||f n|| _| j}|j}|durC||krBtd||f n|| _|| j	v r\| j	| j
dd D ]}| j|= qU|| jv re| j|= || j	|< |j
dd D ]}|| j|< qqdS )z)Add an item of key hit_key and value hit.z)QueryResult object keys must be a string.z1QueryResult objects can only contain Hit objects.Nz0Expected Hit with query ID %r, found %r instead.z9Expected Hit with query description %r, found %r instead.r   )r.   str	TypeErrorr   r   query_id
ValueErrorrA   query_descriptionr
   id_allr   )	r   r0   r   qidhqidqdeschqdescalt_keyalt_idr   r   r   __setitem__N  sB   






zQueryResult.__setitem__c                 C   s   t |trt| j| g}nt |trt| j| }n|g}|D ])}d}|| jv r/| j|= d}|| jv rA| j| j| = | j|= d}|sItt|q dS )zDelete item of key hit_key.FTN)	r.   rO   r#   r'   rL   r
   r   rQ   repr)r   r0   r'   keydeletedr   r   r   __delitem__|  s$   



zQueryResult.__delitem__r   rX   zQueryResult ID stringr   rZ   zQueryResult descriptionc                 C   s    t dd t| j D dd dS )z4Access the HSP objects contained in the QueryResult.c                 s   s    | ]}|V  qd S Nr   ).0hspr   r   r   	<genexpr>  s    z#QueryResult.hsps.<locals>.<genexpr>c                 S      | j S rg   )output_index)ri   r   r   r   <lambda>  s    z"QueryResult.hsps.<locals>.<lambda>)rd   )sortedr   r   r   r   r   r   hsps  s   zQueryResult.hspsc                 C   s   t t| j S )z<Access the HSPFragment objects contained in the QueryResult.)r#   r   ro   r   r   r   r   	fragments  r%   zQueryResult.fragmentsc                 C   sN   z|  | W dS  ty&   |j| v sJ |D ]
}| |j  | qY dS w )aa  Add a Hit object to the end of QueryResult.

        If the QueryResult already has a Hit with the same ID, append the new
        Hit's HSPs into the existing Hit.

        :param hit: object to absorb
        :type hit: Hit

        This method is used for file formats that may output the same Hit in
        separate places, such as BLAT or Exonerate. In both formats, Hit
        with different strands are put in different places. However, SearchIO
        considers them to be the same as a Hit object should be all database
        entries with the same ID, regardless of strand orientation.

        N)r   rY   r   )r   r   ri   r   r   r   absorb  s   zQueryResult.absorbc                    s\    j dur  |}n|j}| vr(t fdd|jdd D r(| |< dS td| )a2  Add a Hit object to the end of QueryResult.

        :param hit: object to append
        :type hit: Hit

        Any Hit object appended must have the same ``query_id`` property as the
        QueryResult's ``id`` property. If the hit key already exists, a
        ``ValueError`` will be raised.

        Nc                 3   s    | ]}| vV  qd S rg   r   )rh   pidr   r   r   rj     s    z%QueryResult.append.<locals>.<genexpr>r   z?The ID or alternative IDs of Hit %r exists in this QueryResult.)r   r   allr[   rY   )r   r   r0   r   r   r   r     s   
(zQueryResult.appendc                 C   s0   t t|| j}| || j| j}| | |S )a  Create new QueryResult object whose Hit objects pass the filter function.

        :param func: filter function
        :type func: callable, accepts Hit, returns bool

        Here is an example of using ``hit_filter`` to select Hits whose
        description begins with the string 'Homo sapiens', case sensitive::

            >>> from Bio import SearchIO
            >>> qresult = next(SearchIO.parse('Blast/mirna.xml', 'blast-xml'))
            >>> def desc_filter(hit):
            ...     return hit.description.startswith('Homo sapiens')
            ...
            >>> len(qresult)
            100
            >>> filtered = qresult.hit_filter(desc_filter)
            >>> len(filtered)
            39
            >>> print(filtered[:4])
            Program: blastn (2.2.27+)
              Query: 33211 (61)
                     mir_1
             Target: refseq_rna
               Hits: ----  -----  ----------------------------------------------------------
                        #  # HSP  ID + description
                     ----  -----  ----------------------------------------------------------
                        0      1  gi|262205317|ref|NR_030195.1|  Homo sapiens microRNA 52...
                        1      2  gi|262205330|ref|NR_030198.1|  Homo sapiens microRNA 52...
                        2      1  gi|262205302|ref|NR_030191.1|  Homo sapiens microRNA 51...
                        3      1  gi|262205451|ref|NR_030222.1|  Homo sapiens microRNA 51...

        Note that instance attributes (other than the hits) from the unfiltered
        QueryResult are retained in the filtered object.

            >>> qresult.program == filtered.program
            True
            >>> qresult.target == filtered.target
            True

        )r#   filterr   rM   r   r   rN   r   funcr   rR   r   r   r   
hit_filter  s   )
zQueryResult.hit_filterc                    sJ   dd | j D } dur fdd|D }| || j| j}| | |S )a	  Create new QueryResult object, mapping the given function to its Hits.

        :param func: map function
        :type func: callable, accepts Hit, returns Hit

        Here is an example of using ``hit_map`` with a function that discards all
        HSPs in a Hit except for the first one::

            >>> from Bio import SearchIO
            >>> qresult = next(SearchIO.parse('Blast/mirna.xml', 'blast-xml'))
            >>> print(qresult[:8])
            Program: blastn (2.2.27+)
              Query: 33211 (61)
                     mir_1
             Target: refseq_rna
               Hits: ----  -----  ----------------------------------------------------------
                        #  # HSP  ID + description
                     ----  -----  ----------------------------------------------------------
                        0      1  gi|262205317|ref|NR_030195.1|  Homo sapiens microRNA 52...
                        1      1  gi|301171311|ref|NR_035856.1|  Pan troglodytes microRNA...
                        2      1  gi|270133242|ref|NR_032573.1|  Macaca mulatta microRNA ...
                        3      2  gi|301171322|ref|NR_035857.1|  Pan troglodytes microRNA...
                        4      1  gi|301171267|ref|NR_035851.1|  Pan troglodytes microRNA...
                        5      2  gi|262205330|ref|NR_030198.1|  Homo sapiens microRNA 52...
                        6      1  gi|262205302|ref|NR_030191.1|  Homo sapiens microRNA 51...
                        7      1  gi|301171259|ref|NR_035850.1|  Pan troglodytes microRNA...

            >>> top_hsp = lambda hit: hit[:1]
            >>> mapped_qresult = qresult.hit_map(top_hsp)
            >>> print(mapped_qresult[:8])
            Program: blastn (2.2.27+)
              Query: 33211 (61)
                     mir_1
             Target: refseq_rna
               Hits: ----  -----  ----------------------------------------------------------
                        #  # HSP  ID + description
                     ----  -----  ----------------------------------------------------------
                        0      1  gi|262205317|ref|NR_030195.1|  Homo sapiens microRNA 52...
                        1      1  gi|301171311|ref|NR_035856.1|  Pan troglodytes microRNA...
                        2      1  gi|270133242|ref|NR_032573.1|  Macaca mulatta microRNA ...
                        3      1  gi|301171322|ref|NR_035857.1|  Pan troglodytes microRNA...
                        4      1  gi|301171267|ref|NR_035851.1|  Pan troglodytes microRNA...
                        5      1  gi|262205330|ref|NR_030198.1|  Homo sapiens microRNA 52...
                        6      1  gi|262205302|ref|NR_030191.1|  Homo sapiens microRNA 51...
                        7      1  gi|301171259|ref|NR_035850.1|  Pan troglodytes microRNA...

        c                 S   s   g | ]}t |qS r   r   rh   r   r   r   r   
<listcomp>6      z'QueryResult.hit_map.<locals>.<listcomp>Nc                    s   g | ]} |qS r   r   rh   xrv   r   r   ry   8  rz   r   rM   r   r   rN   ru   r   r}   r   hit_map  s   0
zQueryResult.hit_mapc                    s>   dd  fdd| j D D }| || j| j}| | |S )a  Create new QueryResult object whose HSP objects pass the filter function.

        ``hsp_filter`` is the same as ``hit_filter``, except that it filters
        directly on each HSP object in every Hit. If the filtering removes
        all HSP objects in a given Hit, the entire Hit will be discarded. This
        will result in the QueryResult having less Hit after filtering.
        c                 S      g | ]}|r|qS r   r   r{   r   r   r   ry   E  rz   z*QueryResult.hsp_filter.<locals>.<listcomp>c                 3       | ]}|  V  qd S rg   )rt   rx   r}   r   r   rj   E      z)QueryResult.hsp_filter.<locals>.<genexpr>r~   ru   r   r}   r   
hsp_filter=  s   
zQueryResult.hsp_filterc                    sJ   dd  fddt | jdd D D }| || j| j}| | |S )zCreate new QueryResult object, mapping the given function to its HSPs.

        ``hsp_map`` is the same as ``hit_map``, except that it applies the given
        function to all HSP objects in every Hit, instead of the Hit objects.
        c                 S   r   r   r   r{   r   r   r   ry   P  rz   z'QueryResult.hsp_map.<locals>.<listcomp>c                 3   r   rg   )maprx   r}   r   r   rj   P  r   z&QueryResult.hsp_map.<locals>.<genexpr>N)r#   r   rM   r   r   rN   ru   r   r}   r   hsp_mapJ  s   *
zQueryResult.hsp_maprK   c                 C   s   t |tr| stdt| j| }z| j|}|jdd D ]	}| j|d q W |S  t	yX   z| | j| }W Y |S  t	yW   || j
urN|}nt	|dY Y |S w w )ao  Remove the specified hit key and return the Hit object.

        :param hit_key: key of the Hit object to return
        :type hit_key: int or string
        :param default: return value if no Hit exists with the given key
        :type default: object

        By default, ``pop`` will remove and return the last Hit object in the
        QueryResult object. To remove specific Hit objects, you can use its
        integer index or hit key.

            >>> from Bio import SearchIO
            >>> qresult = next(SearchIO.parse('Blast/mirna.xml', 'blast-xml'))
            >>> len(qresult)
            100
            >>> for hit in qresult[:5]:
            ...     print(hit.id)
            ...
            gi|262205317|ref|NR_030195.1|
            gi|301171311|ref|NR_035856.1|
            gi|270133242|ref|NR_032573.1|
            gi|301171322|ref|NR_035857.1|
            gi|301171267|ref|NR_035851.1|

            # remove the last hit
            >>> qresult.pop()
            Hit(id='gi|397513516|ref|XM_003827011.1|', query_id='33211', 1 hsps)

            # remove the first hit
            >>> qresult.pop(0)
            Hit(id='gi|262205317|ref|NR_030195.1|', query_id='33211', 1 hsps)

            # remove hit with the given ID
            >>> qresult.pop('gi|301171322|ref|NR_035857.1|')
            Hit(id='gi|301171322|ref|NR_035857.1|', query_id='33211', 2 hsps)

        zpop from empty listr   N)r.   rO   rP   r#   r'   r
   popr[   r   rQ   _QueryResult__marker)r   r0   defaultr   ra   r   r   r   r   Z  s,   
(

zQueryResult.popc                 C   s^   t |trt| j|jS z	t| j|W S  ty.   || jv r-| | j|  Y S  w )a  Return the index of a given hit key, zero-based.

        :param hit_key: hit ID
        :type hit_key: string

        This method is useful for finding out the integer index (usually
        correlated with search rank) of a given hit key.

            >>> from Bio import SearchIO
            >>> qresult = next(SearchIO.parse('Blast/mirna.xml', 'blast-xml'))
            >>> qresult.index('gi|301171259|ref|NR_035850.1|')
            7

        )r.   r   r#   r'   indexr   rY   r   r/   r   r   r   r     s   

zQueryResult.indexFTc                    s   |du r|rt  jddd }nt  jdd }nt j||d}|r1 fdd|D  _dS  | j j} | |S )a7  Sort the Hit objects.

        :param key: sorting function
        :type key: callable, accepts Hit, returns key for sorting
        :param reverse: whether to reverse sorting results or no
        :type reverse: bool
        :param in_place: whether to do in-place sorting or no
        :type in_place: bool

        ``sort`` defaults to sorting in-place, to mimic Python's ``list.sort``
        method. If you set the ``in_place`` argument to False, it will treat
        return a new, sorted QueryResult object and keep the initial one
        unsorted.

        NrK   )rd   reversec                    s   i | ]}  ||qS r   )r   rx   r   r   r   
<dictcomp>  s    z$QueryResult.sort.<locals>.<dictcomp>)r#   r   rn   r
   rM   r   r   rN   )r   rd   r   in_placesorted_hitsrR   r   r   r   sort  s   
zQueryResult.sort)r   NNrg   )NFT)&__name__
__module____qualname____doc___NON_STICKY_ATTRSr   r    propertyr   r'   r(   r*   r,   r-   r1   r3   r5   r6   rJ   rU   rb   rf   r   r   rA   ro   rp   rq   r   rw   r   r   r   objectr   r   r   r   r   r   r   r   r	      sR     !



0.



.
7
?r	   c                 C   rk   )zeMap hit to its identifier (PRIVATE).

    Default hit key function for QueryResult.__init__ use.
    )r   )r   r   r   r   r     s   r   __main__)run_doctestN)r   copyr   	itertoolsr   Bio.SearchIO._utilsr   _baser   r   r   r	   r   r   
Bio._utilsr   r   r   r   r   <module>   s"        I	
