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

Visualize Insertion #129

Open
lukaslee1127 opened this issue Mar 5, 2021 · 3 comments
Open

Visualize Insertion #129

lukaslee1127 opened this issue Mar 5, 2021 · 3 comments

Comments

@lukaslee1127
Copy link

lukaslee1127 commented Mar 5, 2021

I tried to visualize Insertion (SV). I used SVIM as a sv caller and they give same location for start and end position. Therefore, I can't visualize the insertion. how do i handle it?

samplot plot \

-n SRR8599836
-b samplot/test/new.SRR8599836.md.bam
-o 4_16468301_16468301.png
-c NC_003282.8
-s 16468301
-e 16468301
-t INS
Traceback (most recent call last):
File "/Users/miniconda3/bin/samplot", line 10, in
sys.exit(main())
File "/Users/miniconda3/lib/python3.8/site-packages/samplot/main.py", line 31, in main
args.func(parser)
File "/Users/miniconda3/lib/python3.8/site-packages/samplot/samplot.py", line 3587, in plot
current_axis_idx = create_variant_plot(
File "/Users/miniconda3/lib/python3.8/site-packages/samplot/samplot.py", line 1771, in create_variant_plot
plot_variant(sv, sv_type, ax, ranges)
File "/Users/miniconda3/lib/python3.8/site-packages/samplot/samplot.py", line 1695, in plot_variant
map_genome_point_to_range_points(ranges, sv[0].chrm, sv[0].start),
File "/Users/miniconda3/lib/python3.8/site-packages/samplot/samplot.py", line 150, in map_genome_point_to_range_points
float(point - ranges[range_hit].start)
ZeroDivisionError: float division by zero

@lukaslee1127 lukaslee1127 changed the title Insertion Visualize Insertion Mar 5, 2021
@jbelyeu
Copy link
Collaborator

jbelyeu commented Mar 5, 2021

Hey, thanks for pointing this out. We'll improve handling for this situation where the region is so small. However, samplot doesn't support insertions because they only exist at one reference point as shown here

@clairemerot
Copy link

Hello,
Thanks for the samplot development, it is very useful! It works super well for deletion.
I'd be very interested if something is developed to extend the feature to insertions as well.
I have tweaked the program to not output an error by artificially making the end at +1 but this is no use as one cannot visualise the reads that may fall in this insertion. If anyone has a solution, I'd be happy to hear about it!
Thanks a lot
Claire

@jjfarrell
Copy link

@clairemerot @jbelyeu
Since it plots DELs great, maybe this is an approach to visualize INS. Essentially turn the INS into a Deletion with a new reference containing the INS sequence.

  1. Develop regional reference with the INS sequence inserted into the reference.
  2. locally re-align the reads from the region to the new reference containing the INS. Now the INS reads are not aligned to a single point but across the new reference where the INS is located.
  3. SInce the reference has the INS, the Samplot should plot a DEL at that location. The X-axis would need to be adjusted to reflect the original reference and where the INS is located.

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

4 participants