*ė
ā@;c       sr     d  Z    d k Z  d k l Z  d k l Z  d k l Z  d k l	 Z	  d f  d     YZ
 d S(   s   Generic.py

Contains classes to deal with generic sequence alignment stuff not
specific to a particular program or format.

classes:
o Alignment
N(   s   Seq(   s	   SeqRecord(   s   Alphabet(   s   IUPACs	   Alignmentc      s_    d  Z    d   Z $ d   Z + d   Z 6 d   Z E e e d d  Z l d   Z RS(   s„   Represent a set of alignments.

    This is a base class to represent alignments, which should be subclassed
    to deal with an alignment in a specific format.
    c    s"       | |  _ " g  |  _ d S(   sĄ   Initialize a new Alignment object.

        Arguments:
        o alphabet - The alphabet to use for the sequence objects that are
        created. This alphabet must be a gapped type.
        N(   s   alphabets   selfs	   _alphabets   _records(   s   selfs   alphabet(    (    s;   /mit/seven/lib/python2.1/site-packages/Bio/Align/Generic.pys   __init__ s   c    s   $ ( ) |  i Sd S(   sy   Return all of the sequences involved in the alignment.

        The return value is a list of SeqRecord objects.
        N(   s   selfs   _records(   s   self(    (    s;   /mit/seven/lib/python2.1/site-packages/Bio/Align/Generic.pys   get_all_seqs$ s   c    s   + 3 4 |  i | i Sd S(   sā   Retrieve a sequence by the number of the sequence in the consensus.

        Returns:
        o A Seq object for the requested sequence.

        Raises:
        o IndexError - If the specified number is out of range.
        N(   s   selfs   _recordss   numbers   seq(   s   selfs   number(    (    s;   /mit/seven/lib/python2.1/site-packages/Bio/Align/Generic.pys   get_seq_by_num+ s   c    se   6 < = d } ? xE |  i d ? r5 } @ t | i  | j o A t | i  } n q WC | Sd S(   s  Return the maximum length of the alignment.

        All objects in the alignment should (hopefully) have the same
        length. This function will go through and find this length
        by finding the maximum length of sequences in the alignment.
        i    N(   s
   max_lengths   selfs   _recordss   records   lens   seq(   s   selfs
   max_lengths   record(    (    s;   /mit/seven/lib/python2.1/site-packages/Bio/Align/Generic.pys   get_alignment_length6 s   	 	f1.0c    s   E X Y t  | |  i  } Z t | d | } c | o d | | i	 d <n e | o f | | i	 d <n i | | i	 d <k |  i i |  d S(   s8  Add a sequence to the alignment.

        This doesn't do any kind of alignment, it just adds in the sequence
        object, which is assumed to be prealigned with the existing
        sequences.

        Arguments:
        o descriptor - The descriptive id of the sequence being added.
        o sequence - A string with sequence info.
        o start - You can explicitly set the start point of the sequence.
        This is useful (at least) for BLAST alignments, which can just
        be partial alignments of sequences.
        o end - Specify the end of the sequence, which is important
        for the same reason as the start.
        o weight - The weight to place on the sequence in the alignment.
        By default, all sequences have the same weight. (0.0 => no weight,
        1.0 => highest weight)
        s   descriptions   starts   ends   weightN(   s   Seqs   sequences   selfs	   _alphabets   new_seqs	   SeqRecords
   descriptors
   new_records   starts   annotationss   ends   weights   _recordss   append(   s   selfs
   descriptors   sequences   starts   ends   weights   new_seqs
   new_record(    (    s;   /mit/seven/lib/python2.1/site-packages/Bio/Align/Generic.pys   add_sequenceE s   	

c    s{   l m n d } o t o' | d j o | |  i   j p t  p x* |  i d p r } q | | i | 7} qO Wr | Sd S(   s*   Returns a string containing a given columns    i    N(	   s   col_strs	   __debug__s   cols   selfs   get_alignment_lengths   AssertionErrors   _recordss   recs   seq(   s   selfs   cols   col_strs   rec(    (    s;   /mit/seven/lib/python2.1/site-packages/Bio/Align/Generic.pys
   get_columnl s   	1 	(   s   __doc__s   __init__s   get_all_seqss   get_seq_by_nums   get_alignment_lengths   Nones   add_sequences
   get_column(    (    (    s;   /mit/seven/lib/python2.1/site-packages/Bio/Align/Generic.pys	   Alignment s   	'(   s   __doc__s   strings   Bio.Seqs   Seqs   Bio.SeqRecords	   SeqRecords   Bios   Alphabets   Bio.Alphabets   IUPACs	   Alignment(   s	   SeqRecords	   Alignments   IUPACs   Alphabets   Seqs   string(    (    s;   /mit/seven/lib/python2.1/site-packages/Bio/Align/Generic.pys   ? s   