Exactly - although in the soo to be released Biopython 1.59 the position objects will subclass int so you can use them directly.
I have set of SecRecord objects with SeqFeature.location.start and I want to transform this coordinate into integer to compare to other sets of coordinates, add shifts etc.. How can I do that? I have read Biopython cookbook, but I still can't solve the problem.
2 answers
I think you need to get the position of the start.
So if currFeat is a SeqFeature from your SeqRecord object:
location = currFeat.location
start = location.start.position
end = location.end.position
start and end should be integers.
I apologize for revealing this ancient thread, but since the discussion is listed among search results for the question, some updates are required. In the current biopython, one should use
start = int(feature.location.start)
The feature.location.start.position is now abandoned as well feature.location.end.position.
Best regards
Asan
Log in to answer this question.
Have you tried nofuzzy_start instead of start?
http://biopython.org/DIST/docs/api/Bio.SeqFeature.FeatureLocation-class.html
Well, I converted it first into string, then into integer, is there a more elegant solution?
Goog idea.thanks!
can you give more of your code?
In the soon to be released Biopython 1.59 the position objects will be subclasses of int, so you won't need to do anything.