allpy
changeset 1082:4b1a6a7bbeea 1.4.3
Removed Alignment.process() and the code that it used (see #99)
The code was documented to be removed in 1.4.1.
author | Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru> |
---|---|
date | Wed, 30 May 2012 13:38:27 +0400 |
parents | 43b5207a70d7 |
children | 6965683cee99 |
files | allpy/base.py |
diffstat | 1 files changed, 2 insertions(+), 54 deletions(-) [+] |
line diff
1.1 --- a/allpy/base.py Wed May 30 13:35:04 2012 +0400 1.2 +++ b/allpy/base.py Wed May 30 13:38:27 2012 +0400 1.3 @@ -415,28 +415,6 @@ 1.4 if sequence in column: 1.5 del column[sequence] 1.6 1.7 - def _merge(self, dst, new, merge): 1.8 - """Replace contents of `dst` with those of `new`. 1.9 - 1.10 - Replace contents of elements using function `merge(dst_el, new_le)`. 1.11 - """ 1.12 - for el, new_el in zip(dst, new): 1.13 - merge(el, new_el) 1.14 - dst[len(dst):] = new[len(dst):] 1.15 - del dst[len(new):] 1.16 - 1.17 - def _replace_sequence_contents(self, new, copy_descriptions): 1.18 - """Replace contents of sequences with those of `new` alignment.""" 1.19 - # XXX: we manually copy sequence contents here 1.20 - # XXX: we only copy, overlapping parts and link to the rest 1.21 - def merge_monomers(dst, new): 1.22 - dst.__class__ = new.__class__ 1.23 - def merge_sequences(dst, new): 1.24 - if copy_descriptions: 1.25 - vars(dst).update(vars(new)) 1.26 - self._merge(dst, new, merge_monomers) 1.27 - self._merge(self.sequences, new.sequences, merge_sequences) 1.28 - 1.29 def _replace_column_contents(self, new): 1.30 """Replace column contents with those of `new` alignment. 1.31 1.32 @@ -458,41 +436,11 @@ 1.33 for monomer, column in zip(monomers, non_gap_columns): 1.34 column[sequence] = monomer 1.35 1.36 - def _replace_contents(self, new, copy_descriptions, copy_contents): 1.37 - """Replace alignment contents with those of other alignment.""" 1.38 - if copy_contents: 1.39 - self._replace_sequence_contents(new, copy_descriptions) 1.40 - self._replace_column_contents(new) 1.41 - 1.42 - def process(self, function, copy_descriptions=True, copy_contents=True): 1.43 - """Apply function to the alignment (or block); inject results back. 1.44 - 1.45 - - `function(block)` must return block with same line order. 1.46 - - if `copy_descriptions` is False, ignore new sequence names. 1.47 - - if `copy_contents` is False, don't copy sequence contents too. 1.48 - 1.49 - `function` (object) may have attributes `copy_descriptions` and 1.50 - `copy_contents`, which override the same named arguments. 1.51 - """ 1.52 - deprecated( 1.53 - "aln.process() is deprecated and may cause damage to your" 1.54 - " alignment! It will be removed from 1.4.1 realease." 1.55 - " Use aln.realign() instead." 1.56 - ) 1.57 - new = function(self) 1.58 - if hasattr(function, 'copy_descriptions'): 1.59 - copy_descriptions = function.copy_descriptions 1.60 - if hasattr(function, 'copy_contents'): 1.61 - copy_contents = function.copy_contents 1.62 - self._replace_contents(new, copy_descriptions, copy_contents) 1.63 - 1.64 def realign(self, function): 1.65 """Realign self. 1.66 1.67 - I.e.: apply function to self to produce a new alignment, then update 1.68 - self to have the same gap patterns as the new alignment. 1.69 - 1.70 - This is the same as process(function, False, False) 1.71 + * apply function to self to produce a new alignment, 1.72 + * update self to have the same gap patterns as the new alignment. 1.73 """ 1.74 new = function(self) 1.75 self._replace_column_contents(new)