[Biopython-dev] Bio.AlignIO (was Re: [BioPython] Bio.SeqIO and files with one record)
Howard Salis
salish at picasso.ucsf.edu
Sun Jul 22 18:27:58 UTC 2007
Hello all,
To get this same behavior, you can also create the __iter__ and next()
methods in Alignment itself.
-Howard Salis
On 7/22/07, Michiel de Hoon <mdehoon at c2b2.columbia.edu> wrote:
> Peter wrote:
> > P.S. Any comments on the Bio.AlignIO ideas I raised back in May 2007?
> > http://lists.open-bio.org/pipermail/biopython/2007-May/003472.html
> >
> Let's discuss the Bio.Align.Alignment class first, and then decide how
> to parse alignment files.
>
> Currently, the alignment class holds a list of SeqRecord objects:
>
>
> class Alignment:
> ...
> def __init__(self, alphabet):
> ...
> # hold everything at a list of seq record objects
> self._records = []
>
> To get access to self_record, the Alignment class has some accessor
> functions:
>
> def get_all_seqs(self):
> ...
> return self._records
>
>
> def get_seq_by_num(self, number):
> ...
> return self._records[number].seq
>
> A cleaner way to do this is to let the class Alignment inherit from
> list. This also allows us to use all list methods on Alignment objects.
> For example, we can iterate over them, as suggested in this bug report:
>
> http://bugzilla.open-bio.org/show_bug.cgi?id=1944
>
> Any objections against letting Alignment inherit from list?
>
>
> --Michiel
> _______________________________________________
> Biopython-dev mailing list
> Biopython-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython-dev
>
More information about the Biopython-dev
mailing list