[Biopython] iterating over FeatureLocation

Peter Cock p.j.a.cock at googlemail.com
Mon Jan 13 15:38:54 UTC 2014


On Mon, Jan 13, 2014 at 3:09 PM, Michael Thon <mike.thon at gmail.com> wrote:
> I need to iterate over all the features of a sequence, and then
> iterate over the locations/sublocations in each feature.  I’m not
> sure how to work with the sublocations though:
>
> I need to do something like this:
>
> for feat in seq.features:
>         for loc in feat.locations:
>                 start = loc.start
>>
> which does not work but maybe shows what I need to do.
> Can anyone help me out?

Are you talking about join locations? Could you give an example
(e.g. link to a GenBank file) and what you want to look at?

Peter

P.S. This changed a bit back in Biopython 1.62 with the introduction
of the CompoundLocation object.




More information about the Biopython mailing list