[Biopython] reading Alphabet from file

Peter Cock p.j.a.cock at googlemail.com
Mon May 23 22:09:02 UTC 2011


On Monday, May 23, 2011, Uri Laserson <laserson at mit.edu> wrote:
> Hi all,
>
> I am trying to implement a method that will convert a SeqRecord to a JSON
> serializable object.  One piece of data that must be stored for a Seq object
> is the alphabet type.  When I read this from file, what is the best practice
> to reload a the same alphabet type?
>
> Thanks!
> Uri

Hmm, that's tricky because the Biopython alphabet haerachy is so
complicated. Or richly detailed depending on your point of view ;-)

In your position I would apply the KISS principle and reduce it to
Protein, DNA, RNA or unknown - and use the generic_protein etc classes
on reconstruction. Unless you need more detail than that?

Peter




More information about the Biopython mailing list