Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BiopythonTranslator: SeqFeatures with location_operator='join' get wrong position #63

Open
MrTomRod opened this issue Nov 12, 2021 · 0 comments

Comments

@MrTomRod
Copy link
Contributor

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:
image

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:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant