[Biopython] Using SeqLocation to extract subsequence

Peter biopython at maubp.freeserve.co.uk
Mon Nov 2 20:24:36 UTC 2009


On Mon, Nov 2, 2009 at 8:06 PM, Kyle Ellrott <kellrott at gmail.com> wrote:
> This should be a relatively simple question, but I didn't find any google
> hits...
>
> I'm parsing a genbank file of a chromosome, and I want to take the
> FeatureLocation data from a SeqFeature and extract the referenced DNA.
> Basically take a 'CDS' feature and get the gene DNA that coded it.  Is there
> a function that I can pass the location data from a feature record and it
> will extract the DNA, including doing segment joining and reverse
> translation?
>
> I could write this myself, but it seems like a better idea to use something
> that has been well tested.

You missed this thread earlier this month:
http://lists.open-bio.org/pipermail/biopython/2009-October/005695.html

Are you on the dev mailing list? I was hoping to get a little discussion
going there, before moving over to the discussion list for more general
comment. The code mentioned there is the best tested bit of code I
can suggest for now:
http://lists.open-bio.org/pipermail/biopython-dev/2009-October/006922.html

Note there is no such thing as a SeqLocation object. There is a
FeatureLocation, but you need the strand information - hence my
code requires a SeqFeature object to fully describe the location.

Peter




More information about the Biopython mailing list