[Biopython] sequence coordinate mapping

Peter biopython at maubp.freeserve.co.uk
Fri Jun 18 12:00:04 UTC 2010


On Fri, Jun 18, 2010 at 11:01 AM, Peter <biopython at maubp.freeserve.co.uk> wrote:
>
> Just thinking out loud, implementing "in" and/or sorting on our
> FeatureLocation (and perhaps SeqFeature) objects (i.e. implement
> the special __contains__ method,  __lt__ method etc) could be
> useful syntactic sugar for this kind of work.
>

Something like this? This implements __contains__ on the SeqFeature
so that you can check if a simple location (integer) is within a feature.
http://github.com/peterjc/biopython/tree/feature-in

There is a docstring with examples, just look at the diff here:
http://github.com/peterjc/biopython/commit/83c44e8f6ee62a9c5855b603cb3c080d367e23d6

Would that go part way to solving your task?

Peter




More information about the Biopython mailing list