allpy
view lib/project.py @ 101:5091fef2ad88
lib::MonomerType operator== consider only one letter code
align -- additional check of monomer equality
fix bug with missing __ne__ where __eq__ present
author | boris <bnagaev@gmail.com> |
---|---|
date | Thu, 21 Oct 2010 00:39:57 +0400 |
parents | ffc102ed0249 |
children | 16cb30a3b387 |
line source
1 #!/usr/bin/python
3 """
4 "I will not use abbrev."
5 "I will always finish what I st"
6 - Bart Simpson
8 """
17 """
18 Mandatory data:
19 * sequences -- list of Sequence objects. Sequences don't contain gaps
20 - see sequence.py module
21 * alignment -- dict
22 {<Sequence object>:[<Monomer object>,None,<Monomer object>]}
23 keys are the Sequence objects, values are the lists, which
24 contain monomers of those sequences or None for gaps in the
25 corresponding sequence of
26 alignment
28 """
30 """overloaded constructor
32 Project() -> new empty Project
33 Project(sequences, alignment) -> new Project with sequences and
34 alignment initialized from arguments
35 Project(fasta_file) -> new Project, read alignment and sequences
36 from fasta file
38 """
52 """ The number of sequences in alignment (it's thickness).
53 """
57 """ Calculate the identity of alignment positions for colouring.
59 For every (row, column) in alignment the percentage of the exactly
60 same residue in the same column in the alignment is calculated.
61 The data structure is just like the Project.alignment, but istead of
62 monomers it contains float percentages.
63 """
64 # Oh, God, that's awful! Absolutely not understandable.
65 # First, calculate percentages of amino acids in every column
81 # Second, map these percentages onto the alignment
95 @staticmethod
97 """
98 >>> import project
99 >>> sequences,alignment=project.Project.from_fasta(open("test.fasta"))
100 """
139 @staticmethod
141 """
142 Constructs new alignment from sequences
143 Add gaps to right end to make equal lengthes of alignment sequences
144 """
154 """
155 Saves alignment to given file
156 Splits long lines to substrings of length=long_line
157 To prevent this, set long_line=None
158 """
169 """
170 Simple align ths alignment using sequences (muscle)
171 uses old Monomers and Sequences objects
172 """