[Biopython] How to construct a SeqRecord with the info in the SeqFeatures type mRNA or CDS?

Peter biopython at maubp.freeserve.co.uk
Fri Oct 16 08:11:45 UTC 2009


On Thu, Oct 15, 2009 at 10:35 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> On Thu, Oct 15, 2009 at 10:18 PM, Carlos Javier Borroto wrote:
>> I read in the tutorial that you can splice a SeqRecord, but I can't
>> find a reference to how to form a SeqRecord from several different
>> splicing, something like:
>>
>> new_record = record[1:200] + record[400:600]
>
> That isn't built in, but is something I've been working on that
> might be in Biopython in future. Do you fancy trying some
> experimental code?
>
> http://github.com/peterjc/biopython/tree/seqrecords
> http://lists.open-bio.org/pipermail/biopython-dev/2009-October/006851.html

What I should have added yesterday was how you would solve
this with Biopython is it is now (e.g. Biopython 1.52):

new_record = SeqRecord(record.seq[1:200]+record.seq[400:600])
new_record.id = record.id #if this makes sense
new_record.name = record.name #if this makes sense
...

Dealing with complex annotation however is (currently) more
complicated - hence the code I was working on.

Peter



More information about the Biopython mailing list