<p>A program called gridss does this. It can be found <a href="https://github.com/PapenfussLab/gridss" rel="nofollow noreferrer">here</a>. It basically extracts the clipped bases and repeatedly realigns them to reference with the aligner of your choice with bwa as default. It will do this until there are no further realignments. The simple command-line for this tool after install is:</p>

<pre><code>java -Xmx512M -cp gridss-VERSION-with-dependencies.jar gridss.SoftClipsToSplitReads I=your_input.bam O=your_output.bam REFERENCE_SEQUENCE=your_reference.fa
</code></pre>

<p>I hope this helps! </p>

CC BY-SA 4.0
2019-04-04T22:45:35.953Z
Could you please explain why you downvoted?
d_kennetz
CC BY-SA 4.0
2019-04-05T03:15:12.677Z
I haven't voted up yet since I haven't had a chance to try out gridss. But yeah, that's an unfair downvote.
Daniel Standage
CC BY-SA 4.0
2020-08-19T14:51:19.843Z
This answer does not appear to answer the OP's question?
winni2k
CC BY-SA 4.0
2020-08-19T16:22:50.920Z
@winni2k would it be more beneficial for me to have posted an answer that says, "No"? OP's question boiled down to, "Is there any way to toggle this behavior?" There is no way to toggle this behavior, so I proposed an alternate program as a solution. Seems reasonable to me.
d_kennetz
CC BY-SA 4.0
2020-08-20T20:05:35.900Z
Just explaining why someone might down vote. I think it's great that you tried to help though.
winni2k
CC BY-SA 4.0
2019-04-01T18:03:18.533Z
2019-04-01T18:03:18.533Z
d_kennetz
<p>There are nicer genomics visualization tools available, but the <code>samtools tview</code> command is almost always my go-to for a quick first look at read alignments. I just brought up the following locus in <code>tview</code>.</p>

<pre><code>81055951  81055961  81055971  81055981                                                81055991  81056001  81056011  81056021
GTGGAGGTCGGCAGCAGAGCCTGTGGCAGCT**********************************************CTGAGGGTCGGCGTGGCCTCCTGGTGGAAGTTGCACCTGGTTTGCTT
...............................                                              ...............................................
...............................**********************************************..       ......................................
   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,       .....T................................
.....                  ,,,,,,,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
.......                      ,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,                                                                    ...............................................
.............                                                                .........................................A.....
........................                                                     ...............................................
...............................**********************************************..         ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,           ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
...............................**********************************************.A......                 ,,,,,,,,,,,,,,,,,,,,,,
...............................**********************************************..                         ....................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                         ....................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,    ,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,        ,,,,,
...............................**********************************************..                               ,,,,,,,,,,,,,,
...............................**********************************************..                                             
...............................**********************************************..                                             
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
..................T............**********************************************...............................................
...............................**********************************************...............................................
...............................**********************************************...............................................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
...............................**********************************************...............................................
...............................**********************************************...............................................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
..............G................**********************************************...............................................
,,c,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
...............................CTAAGCAAGTAACTGTGGTGTTAGAACCTACCTCCCTCGCCGGGCA...............................................
...............................**********************************************...............................................
...............................**********************************************........................................A......
...............................**********************************************...........................................T...
,,,,,,,,,,,,,,,,,,,,,g,,,,,,,,,**********************************************,,                                             
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
                                                                             ...............................................
                                                                             ...............................................
                                                                             ...............................................
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,a, 
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,                
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
</code></pre>

<p>At first glance there appears to be only a single read spanning this insertion, although the abrupt end of many reads at the insertion breakpoints made me suspicious. Indeed, upon closer inspection, 19 additional reads have primary alignments with soft clipping at the insertion breakpoints.</p>

<p>By default, soft-clipped portions of the reads are not displayed. <strong>Is there any way to toggle this behavior?</strong></p>

CC BY-SA 4.0
2019-03-30T04:11:15.127Z
How would they be displayed? There's nothing in the CIGAR strings to align the soft-clipped bits to the reference
gringer
CC BY-SA 4.0
2020-08-19T14:52:53.010Z
They could be displayed in the same way that igv does it: as a string of unassigned bases at the end of each read.
winni2k
<samtools><read-mapping><visualization>
Displaying soft-clipped nucleotides in samtools tview
# Displaying soft-clipped nucleotides in samtools tview

(Asked by: username_0 on 2019-03-28)

There are nicer genomics visualization tools available, but the samtools tview command is almost always my go-to for a quick first look at read alignments. I just brought up the following locus in tview.
81055951  81055961  81055971  81055981                                                81055991  81056001  81056011  81056021
GTGGAGGTCGGCAGCAGAGCCTGTGGCAGCT**********************************************CTGAGGGTCGGCGTGGCCTCCTGGTGGAAGTTGCACCTGGTTTGCTT
...............................                                              ...............................................
...............................**********************************************..       ......................................
   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,       .....T................................
.....                  ,,,,,,,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
.......                      ,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,                                                                    ...............................................
.............                                                                .........................................A.....
........................                                                     ...............................................
...............................**********************************************..         ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,           ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
...............................**********************************************.A......                 ,,,,,,,,,,,,,,,,,,,,,,
...............................**********************************************..                         ....................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                         ....................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,    ,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,        ,,,,,
...............................**********************************************..                               ,,,,,,,,,,,,,,
...............................**********************************************..                                             
...............................**********************************************..                                             
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
..................T............**********************************************...............................................
...............................**********************************************...............................................
...............................**********************************************...............................................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
...............................**********************************************...............................................
...............................**********************************************...............................................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
..............G................**********************************************...............................................
,,c,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
...............................CTAAGCAAGTAACTGTGGTGTTAGAACCTACCTCCCTCGCCGGGCA...............................................
...............................**********************************************...............................................
...............................**********************************************........................................A......
...............................**********************************************...........................................T...
,,,,,,,,,,,,,,,,,,,,,g,,,,,,,,,**********************************************,,                                             
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**********************************************,,                                             
                                                                             ...............................................
                                                                             ...............................................
                                                                             ...............................................
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,a, 
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,                
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

At first glance there appears to be only a single read spanning this insertion, although the abrupt end of many reads at the insertion breakpoints made me suspicious. Indeed, upon closer inspection, 19 additional reads have primary alignments with soft clipping at the insertion breakpoints.
By default, soft-clipped portions of the reads are not displayed. Is there any way to toggle this behavior?

**Tags:** samtools, read-mapping, visualization
> **Comments:**
> **username_1**: How would they be displayed? There's nothing in the CIGAR strings to align the soft-clipped bits to the reference  
> **username_2**: They could be displayed in the same way that igv does it: as a string of unassigned bases at the end of each read.  

---

## 1 answers

### Answer by username_3 on 2019-04-01. Score: 1

A program called gridss does this. It can be found here. It basically extracts the clipped bases and repeatedly realigns them to reference with the aligner of your choice with bwa as default. It will do this until there are no further realignments. The simple command-line for this tool after install is:
java -Xmx512M -cp gridss-VERSION-with-dependencies.jar gridss.SoftClipsToSplitReads I=your_input.bam O=your_output.bam REFERENCE_SEQUENCE=your_reference.fa

I hope this helps!

> **Comments:**
> **username_3**: Could you please explain why you downvoted?  
> **username_0**: I haven't voted up yet since I haven't had a chance to try out gridss. But yeah, that's an unfair downvote.  
> **username_2**: This answer does not appear to answer the OP's question?  
> **username_3**: @winni2k would it be more beneficial for me to have posted an answer that says, "No"? OP's question boiled down to, "Is there any way to toggle this behavior?" There is no way to toggle this behavior, so I proposed an alternate program as a solution. Seems reasonable to me.  
> **username_2**: Just explaining why someone might down vote. I think it's great that you tried to help though.  

---

