allpy
view lib/block.py @ 125:c84a7840f9b8
Backed out changeset 9f96bc38bc3d
There can be more than one GC!!
author | boris <bnagaev@gmail.com> |
---|---|
date | Sat, 23 Oct 2010 23:50:50 +0400 |
parents | 9f96bc38bc3d |
children | 69e1650feb6b |
line source
1 #!usr/bin/python
12 """
13 Mandatory data:
14 * self.project -- project object, which the block belongs to
15 * self.sequences - set of sequence objects that contain monomers
16 and/or gaps, that constitute the block
17 * self.positions -- sorted list of positions of the project.alignment that
18 are included in the block
20 How to create a new block:
21 >>> import project
22 >>> import block
23 >>> proj = project.Project(open("test.fasta"))
24 >>> block1 = block.Block(proj)
25 """
28 """
29 Builds new block from project
30 if sequences==None, all sequences are used
31 if positions==None, all positions are used
32 """
42 """
43 Saves alignment to given file in fasta-format
44 Splits long lines to substrings of length=long_line
45 To prevent this, set long_line=None
47 No changes in the names, descriptions or order of the sequences
48 are made.
49 """
63 """
64 returns sorted list of positions, representing geometrical core
65 delta -- threshold of distance spreading
67 If more than one pdb chain for some sequence provided, consider all of them
68 cost is calculated as 1 / (delta + 1)
69 delta in [0, +inf) => cost in (0, 1]
70 """
94 """
95 Returns string consisting of '-' and chars x at self.positions
96 Length of returning string = length of project
97 """