allpy
diff lib/alignment.py @ 187:b2ec17578145
rename some Alignment member function and attributes
author | boris (netbook) <bnagaev@gmail.com> |
---|---|
date | Wed, 17 Nov 2010 21:02:10 +0300 |
parents | e4f3a2022b08 |
children |
line diff
1.1 --- a/lib/alignment.py Wed Nov 10 12:47:47 2010 +0300 1.2 +++ b/lib/alignment.py Wed Nov 17 21:02:10 2010 +0300 1.3 @@ -19,16 +19,17 @@ 1.4 """ Alignment 1.5 1.6 Mandatory data: 1.7 - * sequences -- list of Sequence objects. Sequences don't contain gaps 1.8 - - see sequence.py module 1.9 * body -- dict 1.10 {<Sequence object>:[<Monomer object>,None,<Monomer object>]} 1.11 keys are the Sequence objects, values are the lists, which 1.12 contain monomers of those sequences or None for gaps in the 1.13 corresponding sequence of 1.14 alignment 1.15 + 1.16 + """ 1.17 + # _sequences -- list of Sequence objects. Sequences don't contain gaps 1.18 + # - see sequence.py module 1.19 1.20 - """ 1.21 def __init__(self, *args): 1.22 """overloaded constructor 1.23 1.24 @@ -48,15 +49,15 @@ 1.25 else: 1.26 self.sequences, self.body = Alignment.from_fasta(args[0]) 1.27 1.28 - def __len__(self): 1.29 + def length(self): 1.30 """ Returns width, ie length of each sequence with gaps """ 1.31 return max([len(line) for line in self.body.values()]) 1.32 1.33 - def thickness(self): 1.34 + def height(self): 1.35 """ The number of sequences in alignment (it's thickness). """ 1.36 return len(self.body) 1.37 - 1.38 - def calc_identity(self): 1.39 + 1.40 + def identity(self): 1.41 """ Calculate the identity of alignment positions for colouring. 1.42 1.43 For every (row, column) in alignment the percentage of the exactly