samplot icon indicating copy to clipboard operation
samplot copied to clipboard

Visualize Insertion

Open lukaslee1127 opened this issue 3 years ago • 3 comments

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 avatar Mar 05 '21 13:03 lukaslee1127

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

jbelyeu avatar Mar 05 '21 17:03 jbelyeu

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

clairemerot avatar Mar 12 '21 17:03 clairemerot

@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.

jjfarrell avatar May 04 '23 20:05 jjfarrell