allpy
view lib/project.py @ 5:76816df24fe2
dummy_pytale.py: file added
Can do: display an alignment, colour by identity.
Features: Both sequence names and sequences are TextCtrl. Extremely slow.
author | grishin@gorilla |
---|---|
date | Wed, 09 Jun 2010 14:46:02 +0400 |
parents | 4ed6440f4f70 |
children | a185e7e255b3 |
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 """ Calculate the identity of alignment positions for colouring.
52 For every (row, column) in alignment the percentage of the exactly
53 same residue in the same column in the alignment is calculated.
54 The data structure is just like the Project.alignment, but istead of
55 monomers it contains float percentages.
56 """
57 # Oh, God, that's awful! Absolutely not understandable.
58 # First, calculate percentages of amino acids in every column
74 # Second, map these percentages onto the alignment
88 @staticmethod
90 """
91 >>> import project
92 >>> sequences,alignment=project.Project.get_from_fasta(open("test.fasta"))
93 """