[BioPython] Question about FeatureLocation objects
Brad Chapman
chapmanb at uga.edu
Fri Oct 17 11:49:17 EDT 2003
Hey Andy;
> I noticed that the FeatureLocation start and end attributes are not type
> int¹ but type instance¹ which makes operations like this
> Loc.end loc.start break
>
> And int(loc.start) also fails.
>
> One needs to do
> int(str(location.start))
>
> Now I am new to python, is there a reason that start and end are not int
> objects?
It's because of the mess of fuzzy locations. The start and end can
be single integers, or any of the various GenBank/EMBL-style fuzzy
locations ((2.3), (2^3), <2, >2). If you want to ignore the fuzzy
locations and just deal with integers (which is what I read that you
want to do from your mail), there is already a hook to do this. Just
use loc.nofuzzy_start and loc.nofuzzy_end instead of loc.start and
loc.end.
Hopefully this helps.
Brad
More information about the BioPython
mailing list