ete2.coretype.seqgroup.SeqGroup

Package ete2 :: Package coretype :: Module seqgroup :: Class SeqGroup |
[hide private]
[frames] | no frames]

# Class SeqGroup

source code

    object --+
             |
            SeqGroup

    SeqGroup class can be used to store a set of sequences (aligned
    or not).

    CONSTRUCTOR ARGUMENTS:
    ======================

      * sequences: Path to the file containing the sequences or,
        alternatively, the text string containing the same information.

      * format (optional): the format in which sequences are encoded. Current
        supported formats are: "fasta", "phylip" (phylip sequencial)
        and "iphylip" (phylip interleaved)

    RETURNS:
    ========
     A SeqGroup object to operate with sequencies.

    EXAMPLES:
    =========
     msf = ">seq1\nAAAAAAAAAAA\n>seq2\nTTTTTTTTTTTTT\n"
     seqs = SeqGroup(msf, format="fasta")
     print seqs.get_seq("seq1")

Instance Methods | [hide private]
__len__(self) | source code
__contains__(self, item) | source code
__str__(self) str(x) | source code
__iter__(self) | source code
__init__(self, sequences=None, format=`'``fasta``'`) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
write(self, format=`'``fasta``'`, outfile=None) Returns the text representation of the sequences in the supplied given format (default=FASTA). | source code
iter_entries(self) Returns an iterator over all sequences in the collection. | source code
get_seq(self, name) Returns the sequence associated to a given entry name. | source code
get_entries(self) Returns the list of entries currently stored. | source code
set_seq(self, name, seq, comments=`[``]`) Updates or creates the sequence of "name" | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

### __init__(self, sequences=None, format=`'``fasta``'`) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Overrides: object.__init__ (inherited documentation)

### write(self, format=`'``fasta``'`, outfile=None) | source code
Returns the text representation of the sequences in the supplied given format (default=FASTA). If "oufile" argument is used, the result is written into the given path.

### iter_entries(self) | source code
Returns an iterator over all sequences in the collection. Each item is a tuple with the sequence name, sequence, and sequence comments