<p>You just need to check the flag for suplementary mapping. If there is suplementary mapping then use the coordinates; if they are all the same the seq is the same and you just have one event, if different reads have different suplementary mapping locations then there's multiple events. The problem is more complex than this though so just use an existing tool.</p>

CC BY-SA 4.0
2021-01-28T03:47:39.187Z
2021-01-28T03:47:39.187Z
Liam McIntyre
<p><strong>My Problem:</strong></p>
<p>Skipping some specific background, what I want to do is <strong>judging whether some soft-clipping sequences are the same</strong>, which may result by the same SV event. Colored bases in Fig.1 is an example of soft-clipping sequences.</p>
<p><a href="https://i.sstatic.net/lGaR6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lGaR6.png" alt="Fig.1 an example of soft-clipping sequences" /></a></p>
<p>I use <code>BWA -MEM</code> as the aligner. And I am trying to develop an SV caller actually, what I want to do here is refining PE(Paired-Ends) signal. If it is SR(Split-Reads), I don't need to do this, because of SR and its supplemental alignments coming from the same read. But PE signal generated from some cluster procedures need some filters. And I think K-mer is not a good way to do this which adapted by some SV callers. For me, as a bioinformatic fool, imitation and implementation may be a good learning process. It seems still a long way to go.</p>
<p><strong>My solution</strong>:</p>
<p>I suppose this is a sequence alignment problem. Then I use FM-indexing based on BWT to do this. My inexact/approximate matching implementation is referred from <a href="https://www.ncbi.nlm.nih.gov/pubmed/19451168" rel="nofollow noreferrer">BWA</a>.</p>
<p><strong>My workflow</strong>:</p>
<ol>
<li>Extract these soft-clipping sequences</li>
<li>Choose the longest one as the reference</li>
<li>Iterate others to match with the reference, if the number of unmatched is large than 1, it means these sequences are not the same.</li>
</ol>
<hr />
<ul>
<li><p>Question 1:
Is that sounds reasonable to you?  Any suggestions?</p>
</li>
<li><p>Question 2:
If it is OK, how should I implement <strong>the penalty scoring scheme</strong>?<br />
Here, because these sequences should come from the same SV event, the main differences(Mismatch, InDel) should arise from sequencing errors, not small genomic variants. So I want to set a higher gap open penalty and even higher gap extend penalty, like</p>
<p>mismatch_penalty = 4
gapopen_penalty = 11
gapextend_penalty = 20
alignment penalty cutoff = 30</p>
</li>
</ul>
<p>The later means that one alignment with two more gaps will be considered as spurious alignment.</p>
<p>How do I optimize these parameters?</p>

<phylogenetics><bwa>
Sequence alignment using BWT
# Sequence alignment using BWT

(Asked by: username_0 on 2018-10-25)

**My Problem:**

Skipping some specific background, what I want to do is **judging whether some soft-clipping sequences are the same**, which may result by the same SV event. Colored bases in Fig.1 is an example of soft-clipping sequences.

[![Fig.1 an example of soft-clipping sequences](https://i.sstatic.net/lGaR6.png)](https://i.sstatic.net/lGaR6.png)

I use `BWA -MEM` as the aligner. And I am trying to develop an SV caller actually, what I want to do here is refining PE(Paired-Ends) signal. If it is SR(Split-Reads), I don't need to do this, because of SR and its supplemental alignments coming from the same read. But PE signal generated from some cluster procedures need some filters. And I think K-mer is not a good way to do this which adapted by some SV callers. For me, as a bioinformatic fool, imitation and implementation may be a good learning process. It seems still a long way to go.

**My solution**:

I suppose this is a sequence alignment problem. Then I use FM-indexing based on BWT to do this. My inexact/approximate matching implementation is referred from [BWA](https://www.ncbi.nlm.nih.gov/pubmed/19451168).

**My workflow**:

1. Extract these soft-clipping sequences
2. Choose the longest one as the reference
3. Iterate others to match with the reference, if the number of unmatched is large than 1, it means these sequences are not the same.

---

* Question 1:
  Is that sounds reasonable to you? Any suggestions?
* Question 2:
  If it is OK, how should I implement **the penalty scoring scheme**?  
  Here, because these sequences should come from the same SV event, the main differences(Mismatch, InDel) should arise from sequencing errors, not small genomic variants. So I want to set a higher gap open penalty and even higher gap extend penalty, like

  mismatch\_penalty = 4
  gapopen\_penalty = 11
  gapextend\_penalty = 20
  alignment penalty cutoff = 30

The later means that one alignment with two more gaps will be considered as spurious alignment.

How do I optimize these parameters?

**Tags:** phylogenetics, bwa

---

## 1 answers

### Answer by username_1 on 2021-01-28. Score: 1

You just need to check the flag for suplementary mapping. If there is suplementary mapping then use the coordinates; if they are all the same the seq is the same and you just have one event, if different reads have different suplementary mapping locations then there's multiple events. The problem is more complex than this though so just use an existing tool.


---

