Answers.Body: <p>Using <code>-SP</code> is equivalent to running <code>bwa mem</code> on each of the two mates as if they are single-end reads, but it formats the output as a proper paired-end output, i.e. with all pair-related flags added properly. Without <code>-SP</code>, by default <code>bwa mem</code> forces an alignment of a poorly aligned read if its mate is aligned somewhere. <code>-SP</code> turns off the forced alignment. We use <code>-SP</code> for mapping Hi-C reads.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-27T06:08:12.213Z
Answers.LastActivityDate: 2018-11-27T06:08:12.213Z
Answers.UserDisplayName: Soo Lee
Answers.Body: <p>If one read maps and the other doesn't, BWA attempts to rescue the other read by performing Smith-Waterman alignment with the unmapped mate, <code>-S</code> disables this mate rescue.</p>
  
  <p><code>-P</code> does indeed disables pairing, but mate rescues is still enabled - I think <code>-P</code> disables the setting of the proper pair flag. If you set <code>-P</code> and <code>-S</code>, BWA maps the paired reads essentially as single reads.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-27T01:33:05.397Z
Answers.Text: What does "attempts to rescue" mean? Why would the second read map using Smith-Waterman and not using the original algorithm?
Answers.UserDisplayName: juniper-
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-26T20:24:57.097Z
Answers.LastActivityDate: 2018-11-26T20:24:57.097Z
Answers.UserDisplayName: h.mon
Body: <p>BWA mem has the <code>-S</code> and <code>-P</code> tags for <em>skip mate rescue</em> and <em>skip pairing; mate rescue performed unless -S also in use</em>. </p>
  
  <p>What do these do? I presume <code>-P</code> aligns read pairs independently of each other. Is that correct? </p>
  
  <p>And what does <code>-S</code> do?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-26T19:59:25.410Z
Comments.Text: What version of BWA mem are you using?  Have you looked at the manual that gets installed with bwa?  "Please `man ./bwa.1' for the manual."
Comments.UserDisplayName: Bioathlete
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-26T20:11:25.943Z
Comments.Text: 0.7.17; I did look at the manual page but the explanation is somewhat cryptic: _"-P: In the paired-end mode, perform SW to rescue missing hits only but do not try to find hits that fit a proper pair."_
Comments.UserDisplayName: juniper-
Tags: <read-mapping><bwa>
Title: What is mate rescue in bwa mem?
ThreadText: # What is mate rescue in bwa mem?
  
  (Asked by: username_0 on 2018-11-26)
  
  BWA mem has the `-S` and `-P` tags for *skip mate rescue* and *skip pairing; mate rescue performed unless -S also in use*.
  
  What do these do? I presume `-P` aligns read pairs independently of each other. Is that correct?
  
  And what does `-S` do?
  
  **Tags:** read-mapping, bwa
  
  > **Comments:**
  > **username_1**: What version of BWA mem are you using?  Have you looked at the manual that gets installed with bwa?  "Please `man ./bwa.1' for the manual."  
  > **username_0**: 0.7.17; I did look at the manual page but the explanation is somewhat cryptic: _"-P: In the paired-end mode, perform SW to rescue missing hits only but do not try to find hits that fit a proper pair."_  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-11-27. Score: 6 | Accepted answer
  
  Using `-SP` is equivalent to running `bwa mem` on each of the two mates as if they are single-end reads, but it formats the output as a proper paired-end output, i.e. with all pair-related flags added properly. Without `-SP`, by default `bwa mem` forces an alignment of a poorly aligned read if its mate is aligned somewhere. `-SP` turns off the forced alignment. We use `-SP` for mapping Hi-C reads.
  
  
  ---
  
  ### Answer by username_3 on 2018-11-26. Score: 2
  
  If one read maps and the other doesn't, BWA attempts to rescue the other read by performing Smith-Waterman alignment with the unmapped mate, `-S` disables this mate rescue.
  
  `-P` does indeed disables pairing, but mate rescues is still enabled - I think `-P` disables the setting of the proper pair flag. If you set `-P` and `-S`, BWA maps the paired reads essentially as single reads.
  
  > **Comments:**
  > **username_0**: What does "attempts to rescue" mean? Why would the second read map using Smith-Waterman and not using the original algorithm?  
  
  ---
  
  