[Biopython] SeqRecord substring should return SeqRecord or character?

Nick Loman n.j.loman at bham.ac.uk
Wed Jul 11 15:02:00 UTC 2012


Hi there

I wanted to add the last character of a SeqRecord s1 to another
SeqRecord s2. However s1[-1] + s2 fails because s1[-1] returns a
string rather than a SeqRecord just containing a single base and
associated annotations. I have to do s1[-1:] to get a sliced
SeqRecord.

Is this behaviour intentional? I kind of assumed I would always get a
SeqRecord from any given slice, and it's seems weird to get just a
string back instead, although no doubt there's a good reason for this.

Cheers

Nick



More information about the Biopython mailing list