[Biopython-dev] Improving the Alignment object

Jan Kosinski kosa at genesilico.pl
Sat Jul 28 12:55:33 EDT 2007


Hi,

I think the same, an alignment should be mutable and there is no need 
for making two classes, mutable and not mutable.

Janek

Michiel de Hoon wrote:
> Peter wrote:
>>> For instance, the Alignment object should
>>> support changing characters in the alignment without a need of 
>>> copying it (using  aln[a,x] = "D"). Can it be done now with 
>>> Alignment which is a list of SeqRecord objects with sequences 
>>> implemented as immutable Seq objects ?
>>
> ....
>>
>> To me the obvious way to handle this is to have a MutableAlignment 
>> sub-class, where editing individual elements with aln[r,c] = "D" 
>> would be supported (possibly implemented using the MutableSeq class 
>> internally rather than the immutable Seq class).
>>
> I don't think we'd need a separate MutableAlignment for that. An 
> Alignment is a list of sequences and is therefore mutable. If we add a 
> __setitem__ method to the Alignment class, then this method can take 
> care of constructing a new sequence and put it in the appropriate row.
>
> --Michiel.
>
> :.
>


:.



More information about the Biopython-dev mailing list