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

Summary module swaps LR to RL orientation #319

Closed
zhemingfan opened this issue Mar 4, 2022 · 1 comment · Fixed by #320
Closed

Summary module swaps LR to RL orientation #319

zhemingfan opened this issue Mar 4, 2022 · 1 comment · Fixed by #320
Assignees
Labels
Milestone

Comments

@zhemingfan
Copy link
Collaborator

zhemingfan commented Mar 4, 2022

Currently calls which are correctly called as LR are being swapped to RL in the summary module.

Traceback (most recent call last):
File "/projects/jfan_prj/jfan_prj/MAVIS/mavis/venv/bin/mavis", line 33, in
sys.exit(load_entry_point('mavis', 'console_scripts', 'mavis')())
File "/projects/jfan_prj/jfan_prj/MAVIS/mavis/src/mavis/main.py", line 295, in main
raise err
File "/projects/jfan_prj/jfan_prj/MAVIS/mavis/src/mavis/main.py", line 255, in main
summary_main.main(
File "/projects/jfan_prj/jfan_prj/MAVIS/mavis/src/mavis/summary/main.py", line 217, in main
grouped, removed = group_by_distance(bpp_set, distances)
File "/projects/jfan_prj/jfan_prj/MAVIS/mavis/src/mavis/summary/summary.py", line 191, in group_by_distance
grouped_calls.append(group_events(pairs))
File "/projects/jfan_prj/jfan_prj/MAVIS/mavis/src/mavis/summary/summary.py", line 137, in group_events
raise AssertionError('cannot group events differing on key elements', bpp, new_bpp)
AssertionError: ('cannot group events differing on key elements', 'BPP(Breakpoint(1:3522792-3522852L), Breakpoint(1:3522805-3522839R), opposing=False, tracking_id=vcf-cuteSV.INS.74)', 'BPP(Breakpoint(1:3522792-3522839R), Breakpoint(1:3522792-3522852L ), opposing=False)')

@zhemingfan zhemingfan added the bug label Mar 4, 2022
@zhemingfan zhemingfan added this to the v3.1.0 milestone Mar 4, 2022
@zhemingfan zhemingfan self-assigned this Mar 4, 2022
@creisle
Copy link
Member

creisle commented Mar 4, 2022

After our debugging discussion offline we have narrowed down the cause of this error. When breakpoints are being grouped in the summary module a new breakpoint is created from the grouped breakpoints. However when a new breakpoint pair is created we auto-sort the breakpoints before assigning then 1/2 here

if b1.key[:3] > b2.key[:3]:

This sort method is insufficient when the breakpoint intervals are imprecise ranges. Overall there are 2 things to fix for this bug

  • change the breakpoint sort in BreakpointPair to not sort when the ranges overlap: if the breakpoints have the same chrom but their ranges overlap do not sort the breakpoints in the init function
  • change the convert module to not allow start ranges which encompass areas past the end range

In this instance we are seeing the bizzarre SV that looks like this

ref       -------------------------------------------------------------------------------
break1 ------------------------=======================--------------
break2 ------------------------==========-------------------------------------

which should be impossible

@zhemingfan zhemingfan linked a pull request Mar 4, 2022 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants