allpy
diff lib/block.py @ 132:4b7a31ae5faa
lib.block -- copy of sequences --> link to old sequences, when create from block
author | boris <bnagaev@gmail.com> |
---|---|
date | Sun, 24 Oct 2010 11:42:21 +0400 |
parents | d591f3caf6fb |
children | 425d94783375 |
line diff
1.1 --- a/lib/block.py Sun Oct 24 10:59:38 2010 +0400 1.2 +++ b/lib/block.py Sun Oct 24 11:42:21 2010 +0400 1.3 @@ -18,6 +18,8 @@ 1.4 * self.positions -- sorted list of positions of the project.alignment that 1.5 are included in the block 1.6 1.7 + Don't change self.sequences -- it may be a link to other block.sequences 1.8 + 1.9 How to create a new block: 1.10 >>> import project 1.11 >>> import block 1.12 @@ -32,7 +34,7 @@ 1.13 if positions==None, all positions are used 1.14 """ 1.15 if sequences == None: 1.16 - sequences = copy(project.sequences) 1.17 + sequences = set(project.sequences) # copy 1.18 if positions == None: 1.19 positions = range(len(project)) 1.20 self.project = project 1.21 @@ -106,7 +108,7 @@ 1.22 if len(clique - set(GC.positions)) < ac_new_atoms * len(clique): 1.23 break 1.24 else: 1.25 - GCs.append(Block(self.project, copy(self.sequences), clique)) 1.26 + GCs.append(Block(self.project, self.sequences, clique)) 1.27 if ac_count != -1 and len(GCs) >= ac_count: 1.28 break 1.29 return GCs