allpy
diff allpy/base.py @ 298:c305a80cdb75
Removed obsolete allpy.base.Alignment.column() method
author | Daniil Alexeyevsky <me.dendik@gmail.com> |
---|---|
date | Thu, 16 Dec 2010 18:35:56 +0300 |
parents | be9c3cacd009 |
children | 21c2358cb5e7 |
line diff
1.1 --- a/allpy/base.py Thu Dec 16 18:35:25 2010 +0300 1.2 +++ b/allpy/base.py Thu Dec 16 18:35:56 2010 +0300 1.3 @@ -286,31 +286,6 @@ 1.4 line.append(all_columns[position].get(aa)) 1.5 return self.identity_percentages 1.6 1.7 - def column(self, sequence=None, sequences=None, original=None): 1.8 - """ returns list of columns of alignment 1.9 - 1.10 - sequence or sequences: 1.11 - * if sequence is given, then column is (original_monomer, monomer) 1.12 - * if sequences is given, then column is (original_monomer, {sequence: monomer}) 1.13 - * if both of them are given, it is an error 1.14 - 1.15 - original (Sequence type): 1.16 - * if given, this filters only columns represented by original sequence 1.17 - """ 1.18 - if sequence and sequences: 1.19 - raise Exception("Wrong usage. read help") 1.20 - indexes = dict([(v, k) for( k, v) in enumerate(self.sequences)]) 1.21 - alignment = self.body.items() 1.22 - alignment.sort(key=lambda i: indexes[i[0]]) 1.23 - alignment = [monomers for seq, monomers in alignment] 1.24 - for column in zip(*alignment): 1.25 - if not original or column[indexes[original]]: 1.26 - if sequence: 1.27 - yield (column[indexes[original]], column[indexes[sequence]]) 1.28 - else: 1.29 - yield (column[indexes[original]], 1.30 - dict([(s, column[indexes[s]]) for s in sequences])) 1.31 - 1.32 class Block(object): 1.33 """ Block of alignment 1.34