Multiple Sequence Alignments (SeqGroup)¶
This module provides the SeqGroup class with methods to operate with Multiple Sequence Files, including Multiple Sequence Alignments.
Currently, Fasta, Phylip sequencial and Phylip interleaved formats are supported.
- class SeqGroup(sequences=None, format='fasta', fix_duplicates=True, **kwargs)[source]¶
Class to store a set of sequences (aligned or not).
- __init__(sequences=None, format='fasta', fix_duplicates=True, **kwargs)[source]¶
- Parameters:
sequences – Path to the file containing the sequences or, alternatively, the text string containing them.
format – Encoding format of sequences. Supported formats are:
fasta
,phylip
(phylip sequencial) andiphylip
(phylip interleaved). Phylip format forces sequence names to a maximum of 10 chars. To avoid this effect, you can use the relaxed phylip format:phylip_relaxed
andiphylip_relaxed
.
Example:
seqs_str = ('>seq1\n' 'AAAAAAAAAAA\n' '>seq2\n' 'TTTTTTTTTTTTT\n') seqs = SeqGroup(seqs_str, format='fasta') print(seqs.get_seq('seq1'))