allpy
view lib/block.py @ 9:505ce122068b
Generalized tcl examples in the sandbox.
author | Danya Alexeyevsky <me.dendik@gmail.com> |
---|---|
date | Thu, 10 Jun 2010 14:24:08 +0400 |
parents | 757f2a1f8732 |
children | 217d83a617c3 |
line source
1 #!usr/bin/python
10 """
11 Mandatory data:
12 * self.project -- project object, which the block belongs to
13 * self.sequences - set of sequence objects that contain monomers
14 and/or gaps, that constitute the block
15 * self.positions -- list of positions of the project.alignment that
16 are included in the block
18 How to create a new block:
19 >>> import project
20 >>> import block
21 >>> proj = project.Project(open("test.fasta"))
22 >>> block1 = block.Block(proj, proj.sequences, range(len(proj.alignment[proj.sequences[0]])))
24 """
32 """writes the block as an alignment in fasta-format into the file.
34 No changes in the names, descriptions or order of the sequences
35 are made.
37 """