DnaFeaturesViewer
DnaFeaturesViewer copied to clipboard
BiopythonTranslator: SeqFeatures with location_operator='join' get wrong position
Hello
Thanks for your work, I implemented DnaFeaturesViewer in my software (click on compare gene loci)!
I found a small bug: sometimes, a gene spans the scaffold. Happens rarely with circular assemblies annotated with PGAP. In this case, BiopythonTranslator gives the gene a start position at the beginning of the scaffold, and an end position at the end of the scaffold, meaning the gene spans the entire scaffold.
Example:

Use this genbank file to reproduce the issue.
I managed to fix it by changing the translate_feature function:
location = feature.location if feature.location_operator != 'join' else feature.location.parts[0]
return GraphicFeature(
start=location.start,
end=location.end,
strand=location.strand,
**properties
)
Then, I get the expected result:
