[Biopython-dev] RNA Alphabet: request for comments

Peter biopython at maubp.freeserve.co.uk
Tue Jun 15 14:46:10 UTC 2010

On Tue, Jun 15, 2010 at 3:06 PM, Kristian Rother <krother at rubor.de> wrote:
> Hi,
> I've commited a proof-of-concept implementation how modified RNA bases
> could be made compatible to Biopython Alphabets. Comments are very
> welcome, especially because I had to change two lines in the Seq class to
> make it work.
> The code can be viewed on:
> http://github.com/krother/biopython/commit/d9f942936d6165703512099a6a2d84452fea27aa
> (on github: krother/biopython, branch rna_alphabet).
> The two main classes are:
> RNAAlphabetEntry(str) that contains different abbreviations for one base.
> and
> ModifiedRNAString(str) that behaves like a string except that it iterates
> through RNAAlphabetEntry objects.

Why not create a Seq subclass instead of your class ModifiedRNAString(str)?
This would then implement suitable (reverse) complement etc.

I would also have __iter__ and __getitem__ for a single letter return
an instance
of RNAAlphabetEntry (which would act like a single character string).


More information about the Biopython-dev mailing list