Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-04T22:45:35.953Z
Answers.Text: Could you please explain why you downvoted?
Answers.UserDisplayName: d_kennetz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-05T03:15:12.677Z
Answers.Text: I haven't voted up yet since I haven't had a chance to try out gridss. But yeah, that's an unfair downvote.
Answers.UserDisplayName: Daniel Standage
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-19T14:51:19.843Z
Answers.Text: This answer does not appear to answer the OP's question?
Answers.UserDisplayName: winni2k
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-19T16:22:50.920Z
Answers.Text: @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.
Answers.UserDisplayName: d_kennetz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-20T20:05:35.900Z
Answers.Text: Just explaining why someone might down vote. I think it's great that you tried to help though.
Answers.UserDisplayName: winni2k
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-01T18:03:18.533Z
Answers.LastActivityDate: 2019-04-01T18:03:18.533Z
Answers.UserDisplayName: d_kennetz
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-30T04:11:15.127Z
Comments.Text: How would they be displayed? There's nothing in the CIGAR strings to align the soft-clipped bits to the reference
Comments.UserDisplayName: gringer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-19T14:52:53.010Z
Comments.Text: They could be displayed in the same way that igv does it: as a string of unassigned bases at the end of each read.
Comments.UserDisplayName: winni2k
Tags: <samtools><read-mapping><visualization>
Title: Displaying soft-clipped nucleotides in samtools tview
ThreadText: # 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](https://github.com/PapenfussLab/gridss). 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**: @username_2 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.  
  
  ---
  
  