allpy
view lib/block.py @ 11:693943fed7b0
Sandbox: another failed attempt at using python+tk+text for rendering.
| author | Danya Alexeyevsky <dendik@kodomo.fbb.msu.ru> | 
|---|---|
| date | Thu, 10 Jun 2010 15:03:09 +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         """
