allpy
view lib/block.py @ 129:a6d287f9c901
broken: lib::block::geometrical_cores returns list of blocks
added new parameters to geometrical_core
test passed
author | boris <bnagaev@gmail.com> |
---|---|
date | Sun, 24 Oct 2010 00:26:18 +0400 |
parents | 3e69e4b38017 |
children | 89de20cda19c |
line source
1 #!usr/bin/python
13 """
14 Mandatory data:
15 * self.project -- project object, which the block belongs to
16 * self.sequences - set of sequence objects that contain monomers
17 and/or gaps, that constitute the block
18 * self.positions -- sorted list of positions of the project.alignment that
19 are included in the block
21 How to create a new block:
22 >>> import project
23 >>> import block
24 >>> proj = project.Project(open("test.fasta"))
25 >>> block1 = block.Block(proj)
26 """
29 """
30 Builds new block from project
31 if sequences==None, all sequences are used
32 if positions==None, all positions are used
33 """
43 """
44 Saves alignment to given file in fasta-format
45 Splits long lines to substrings of length=long_line
46 To prevent this, set long_line=None
48 No changes in the names, descriptions or order of the sequences
49 are made.
50 """
66 """
67 returns length-sorted list of blocks, representing GCs
69 max_delta -- threshold of distance spreading
70 timeout -- Bron-Kerbosh timeout (then fast O(n ln n) algorithm)
71 minsize -- min size of each core
72 ac_new_atoms -- min part or new atoms in new alternative core
73 current GC is compared with each of already selected GCs
74 if difference is less then ac_new_atoms, current GC is skipped
75 difference = part of new atoms in current core
76 ac_count -- max number of cores (including main core)
78 If more than one pdb chain for some sequence provided, consider all of them
79 cost is calculated as 1 / (delta + 1)
80 delta in [0, +inf) => cost in (0, 1]
81 """
107 break
111 break
115 """
116 Returns string consisting of '-' and chars x at self.positions
117 Length of returning string = length of project
118 """