Problemcore
Paired-end read mapping
Also called mate pair mapping, mate rescue.
Map both reads of a pair to a reference so that their strands and distance fit the library's insert size distribution. Seed and extend is used for each read, with mate rescue.
Paired-end read mapping is read mapping for read pairs: the two reads come from the two ends of one DNA fragment, so they must map to opposite strands at a distance that fits the length of the fragments in the library. The constraint helps in two ways. A read that falls in a repeat can be placed by its uniquely mapped mate, and a read with too many errors for the seed search can be found by a direct alignment near its mate, which is called mate rescue. Mappers such as BWA, Bowtie 2 and minimap2 solve the problem with seed and extend on each read and a pairing step. This page is about mapping the pairs; the reads and their insert sizes are on paired-end reads.
In plain words
Two short lines are torn from the two ends of one strip of paper, and the strips in this batch are all about the same length. You look for each line in a long book. One line fits in only one place. The other fits in two places, because the book repeats a sentence. Only one of those two places is about one strip length away from the first line, so that is the answer.
Sometimes one line has so many smudges that you cannot find it by searching for short exact pieces. But you know roughly where it must be: about one strip length from its partner. So you compare it letter by letter against just that part of the book, which is a small and cheap search.
Definition
Positions are 1-based, as in SAM.
Input.
- A reference of length over .
- Read pairs , each read of length about , with base qualities.
- A library model: the expected orientation, which for standard Illumina paired-end libraries is FR (the leftmost read on the forward strand and the other on the reverse strand, pointing toward each other), and an insert size distribution on the fragment length . Often is close to normal with mean and standard deviation , and mappers estimate it from the pairs whose two reads map uniquely.
- A scoring scheme for single reads, as in read mapping.
Placements. A placement of a pair gives each read a position, a strand and an alignment. If the reads lie on one chromosome in the expected orientation, the observed template length runs from the leftmost aligned base of the left read to the rightmost aligned base of the right read.
Output. For each pair, the placement that maximizes the pair score
over placements in the expected orientation, where and are the alignment scores of the two reads and converts the log density into score units. If the best such placement is much worse than the best placements of the two reads alone, the reads are reported separately as a discordant or unpaired pair. The output also flags whether the pair is proper (SAM flag 0x2), and gives each read a mapping quality that takes the pair into account.
The probabilistic form. With the scores replaced by log-likelihoods, is the log of , so maximizing is finding the most probable joint origin of the two reads, and the posterior over joint origins gives the mapping quality of the pair.
Variants
- Mate rescue. When one read maps with confidence and the other has no good hit, align the other read, or its reverse complement, against the window of the reference where the insert size model says it must be, on the expected strand. For a left read at , a right read of length and inserts within of the mean, the window runs from to . The alignment is a Smith-Waterman or semi-global alignment of bases against a window of bases, which is cheap. The alias "mate rescue" names this step, not the whole problem.
- Mate pairs. Mate pair libraries have long inserts, thousands of bases, made by circularizing long fragments, and their reads face away from each other (RF orientation). The problem is the same with another orientation and another . The alias "mate pair mapping" uses that name loosely, since standard paired-end reads are not mate pairs.
- Unknown insert size. Mappers estimate and from a batch of pairs whose reads both map uniquely, using robust statistics such as quartiles so that pairs from structural variants do not distort the estimate.
- Hard bounds. Bowtie 2 takes a smallest and a largest fragment length,
-Iand-X, and calls a pair concordant only inside them, in place of a density . - Split and chimeric pairs. When the best alignment of a read is in two parts, the parts are written as a primary and a supplementary record, and only one part is paired with the mate.
Examples
Scoring the insert size. Take and . For a normal density ,
| penalty against in Phred units | ||
|---|---|---|
| 300 | 0 | |
| 350 | 6.0 | |
| 420 | 34.7 |
So a pair with costs as much as one mismatch at a base of quality 6, while , four standard deviations away, costs as much as a mismatch at a Q35 base.
A read in a repeat. Read maps uniquely on the forward strand at 1000. Read , of length 100, matches equally well on the reverse strand at 1251 and at 50001. The first placement gives , and the second gives , where is practically 0. So the pair goes to 1251, and gets a high mapping quality, although on its own its MAPQ would be 3 at best, the value of a two-way tie.
Mate rescue. Read has eight mismatches spaced evenly over its 100 bases, so no exact match of 19 or more bases survives (19 is the default smallest seed of BWA-MEM), and the seed search finds nothing. Its mate maps at 1000 on the forward strand. The rescue step aligns the reverse complement of to the reference window from 1080 to 1419, the window of the rule above with and , and finds the alignment at 1251 with eight mismatches.
Known algorithms
| mapper | single-read search | pairing |
|---|---|---|
| Maq | hashing of spaced seeds | pairs the hits within a maximal distance and gives a pair mapping quality |
BWA (BWA-backtrack, sampe) |
FM-index backtracking for each read | estimates the insert size from the data, pairs the hits, and rescues an unmapped mate by Smith-Waterman alignment in the window |
| BWA-MEM | maximal exact matches, chaining, extension | pair score with an insert size penalty; rescue near the mate |
| Bowtie 2 | FM-index seeds and dynamic programming | concordant pairs inside -I and -X, with search near the mate |
| minimap2 (short-read mode) | minimizer seeds and chaining | pairs the chains of the two reads |
All of these are heuristics: they look at a limited set of candidate places for each read, so they can miss the best pair.
Bounds
- Exact solution in polynomial time. With the semi-global alignment scores of each read at each position of on both strands, computed in time per read, the best FR pair is the maximum over of plus the best over the in the window allowed by . With a window of width , this costs , so the exact problem is polynomial but far too slow for genomes and pairs.
- Cost of mate rescue. One rescue is an alignment of bases against bases, which is time, independent of .
- Ambiguity. If both reads fall in a repeat longer than the insert, every copy gives the same pair score, and no method can tell them apart. Longer inserts make this rarer, which is one use of mate pair libraries.
Reductions
- To two read mapping instances and a join. Map each read on its own, keeping several candidate places, then join the two lists under the orientation and distance constraint. With the lists sorted by position, the join is a merge in time linear in their lengths plus the number of joined pairs.
- Mate rescue to local alignment. One rescue is a local or semi-global alignment in a window.
- From structural variant detection. Pairs that cannot be placed in the expected orientation and distance are the input of the discordant read pair method.
Applications
- Variant calling in repeats. Pairing gives many reads in repeats a usable mapping quality, so variant calling works in more of the genome.
- Structural variants. A pair whose distance or orientation does not fit points to a deletion, an insertion, an inversion or a translocation; see structural variant detection.
- Duplicate marking. Duplicate marking uses the 5' ends of both reads of a pair, which is more specific than one end.
- Library checks. The insert size distribution that the mapper estimates is itself a quality check of the library.
References
- Heng Li and Richard Durbin, Fast and accurate short read alignment with Burrows-Wheeler transform, Bioinformatics 25(14), 2009, pp. 1754 to 1760, Methods, the part on paired-end mapping (the insert size estimated from the data, the pairing of hits, and the Smith-Waterman search for an unmapped mate)
- Heng Li, Jue Ruan and Richard Durbin, Mapping short DNA sequencing reads and calling variants using mapping quality scores, Genome Research 18(11), 2008, pp. 1851 to 1858, Methods (paired-end reads in Maq and the mapping quality of a pair)
- Heng Li, Aligning sequence reads, clone sequences and assembly contigs with BWA-MEM, arXiv 1303.3997, 2013, Section 2, the part on paired-end mapping (the pair score with an insert size penalty and the mate rescue step)
- Ben Langmead and Steven L. Salzberg, Fast gapped-read alignment with Bowtie 2, Nature Methods 9(4), 2012, pp. 357 to 359 (paired-end alignment, concordant and discordant pairs)
- The SAM/BAM Format Specification, version 1.6, hts-specs, Section 1.4 (the FLAG bits of paired reads, RNEXT, PNEXT and TLEN)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 0K9R9Q Edit this page History Report an error Markdown