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

Fix hgvsg for insertion with ref allele - #1124

Open
wants to merge 2 commits into
base: postreleasefix/114
Choose a base branch
from

Conversation

nakib103
Copy link
Contributor

@nakib103 nakib103 commented Sep 26, 2024

Problem

Here #1077 we have fixed hgvsg for multi-allelic variant. But it introduced a bug for insertion types.

We are not sending the end position during trimming -
https://github.com/nuno-agostinho/ensembl-variation/blob/3ed1013c5bfacb2416db9e67d50cb96fb2fcb0b6/modules/Bio/EnsEMBL/Variation/VariationFeature.pm#L1970

What it does for insertion is that it increase the end position by length of reference sequence -1 -
https://github.com/nuno-agostinho/ensembl-variation/blob/3ed1013c5bfacb2416db9e67d50cb96fb2fcb0b6/modules/Bio/EnsEMBL/Variation/Utils/Sequence.pm#L970

This becomes problematic if the length of reference sequence -1 is not the same as end - start and there is no trimming happening so that position sticks around. This happen only in the case when we have - in ref allele for insertion.

The end result is different position in slice and sub slice -
https://github.com/nuno-agostinho/ensembl-variation/blob/3ed1013c5bfacb2416db9e67d50cb96fb2fcb0b6/modules/Bio/EnsEMBL/Variation/VariationFeature.pm#L2016-L2019

and, terminating in a error here -
https://github.com/nuno-agostinho/ensembl-variation/blob/3ed1013c5bfacb2416db9e67d50cb96fb2fcb0b6/modules/Bio/EnsEMBL/Variation/Utils/Sequence.pm#L511

Fix

  • Simply provide end position so trim_sequences do not try to calculate it.
  • And, update the ref_end position. Otherwise it will fail in trim on reverse direction.

Test:

chr8 143694491 143694490 -/TT/TTT +
chr8 143694491 143694490 -/GG/GGG +
chr8 143694490 143694492 GTT/GT/T + (trim on reverse direction)

Copy link
Contributor

@olaaustine olaaustine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

2 participants