allpy
view lib/project.py @ 70:892e54d16419
breaking: change sequence constructor
author | boris <bnagaev@gmail.com> |
---|---|
date | Sat, 18 Sep 2010 11:09:14 +0400 |
parents | 0905a39738f2 |
children | 0b9c0f4f1fda |
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 """
15 """
16 Mandatory data:
17 * sequences -- list of Sequence objects. Sequences don't contain gaps
18 - see sequence.py module
19 * alignment -- dict
20 {<Sequence object>:[<Monomer object>,None,<Monomer object>]}
21 keys are the Sequence objects, values are the lists, which
22 contain monomers of those sequences or None for gaps in the
23 corresponding sequence of
24 alignment
26 """
28 """overloaded constructor
30 Project() -> new empty Project
31 Project(sequences, alignment) -> new Project with sequences and
32 alignment initialized from arguments
33 Project(fasta_file) -> new Project, read alignment and sequences
34 from fasta file
36 """
50 """ The number of sequences in alignment (it's thickness).
51 """
55 """ Calculate the identity of alignment positions for colouring.
57 For every (row, column) in alignment the percentage of the exactly
58 same residue in the same column in the alignment is calculated.
59 The data structure is just like the Project.alignment, but istead of
60 monomers it contains float percentages.
61 """
62 # Oh, God, that's awful! Absolutely not understandable.
63 # First, calculate percentages of amino acids in every column
79 # Second, map these percentages onto the alignment
93 @staticmethod
95 """
96 >>> import project
97 >>> sequences,alignment=project.Project.get_from_fasta(open("test.fasta"))
98 """