Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/file/80043822a41e/allpy/markups.py
Дата изменения: Unknown
Дата индексирования: Mon Feb 4 05:51:02 2013
Кодировка:
allpy: 80043822a41e allpy/markups.py

allpy

view allpy/markups.py @ 704:80043822a41e

Added fileio.File.read_alignment and fileio.File.write_alignment [closes #57] This is now the recommended interface. In the following commits this interface will be used to write markup together with alignment. Previously, fileio received the alignment torn-apart into sequence representations as strings with gaps, sequence names and descriptions. Now, fileio tears the alignment apart by itself.
author Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru>
date Thu, 07 Jul 2011 19:21:12 +0400
parents 4d1f5ece3f0a
children 21cfc7897a8f
line source
1 import base
3 class SequenceNumberMarkup(base.SequenceMarkup):
5 name = 'number'
7 def refresh(self):
8 for number, monomer in enumerate(self.sequence, 1):
9 monomer.number = number
11 class SequenceIndexMarkup(base.SequenceMarkup):
13 name = 'index'
15 def refresh(self):
16 for index, monomer in enumerate(self.sequence):
17 monomer.index = index
19 class AlignmentNumberMarkup(base.AlignmentMarkup):
21 name = 'number'
23 def refresh(self):
24 for number, column in enumerate(self.alignment.columns, 1):
25 self[column] = number
27 class AlignmentIndexMarkup(base.AlignmentMarkup):
29 name = 'index'
31 def refresh(self):
32 for index, column in enumerate(self.alignment.columns):
33 self[column] = index
35 class SequenceCaseMarkup(base.SequenceMarkup):
37 name = 'case'
39 def refresh(self):
40 for monomer in self.sequence:
41 if monomer.input_code1.isupper():
42 monomer.case = 'upper'
43 elif monomer.input_code1.islower():
44 monomer.case = 'lower'
46 # vim: set ts=4 sts=4 sw=4 et: