|
| 1 | +--- |
| 2 | +title: Qualimap bamqc |
| 3 | +description: The bamqc outputs RustQC produces, how Qualimap's coverage differs from every other tool here, and which figures are not reproduced. |
| 4 | +--- |
| 5 | + |
| 6 | +import { Aside } from "@astrojs/starlight/components"; |
| 7 | + |
| 8 | +<Aside type="note" title="About Qualimap"> |
| 9 | +Qualimap examines alignment data to detect biases in sequencing and mapping, |
| 10 | +and reports them as tables and plots. |
| 11 | + |
| 12 | +[Documentation](http://qualimap.conesalab.org/) | Okonechnikov K, Conesa A, García-Alcalde F. *Bioinformatics*. 2016;32(2):292-294. |
| 13 | +</Aside> |
| 14 | + |
| 15 | +RustQC writes `qualimap/genome_results.txt`, the |
| 16 | +`raw_data_qualimapReport/` tables and an HTML summary. |
| 17 | + |
| 18 | +<Aside type="caution" title="Qualimap's coverage is not the others' coverage"> |
| 19 | +Qualimap counts every primary mapped record with no duplicate, mapping quality |
| 20 | +or base quality filtering, counts deletions as covered, and does **not** |
| 21 | +correct mate overlaps. On the project's test data it reports a mean coverage of |
| 22 | +16.77 where mosdepth reports 6.20 and `CollectWgsMetrics` reports 3.53. All |
| 23 | +three are right about different questions. Do not compare them to each other. |
| 24 | +</Aside> |
| 25 | + |
| 26 | +## Two figures that surprise people |
| 27 | + |
| 28 | +**Mean mapping quality reads about 2.4, not about 60.** It is the mean of the |
| 29 | +per-window means, and a window with no reads contributes zero. On a targeted or |
| 30 | +low-coverage library, most windows are empty, so the figure is closer to the |
| 31 | +fraction of the genome covered than to the quality of the alignments. The |
| 32 | +per-position histogram, which only counts covered positions, is the one to read |
| 33 | +for that. |
| 34 | + |
| 35 | +**Base composition is reported in reference orientation.** Reverse-strand reads |
| 36 | +are reverse-complemented before counting, so the A and T columns are not the |
| 37 | +counts of A and T in the sequencer's output. |
| 38 | + |
| 39 | +## What matches Qualimap and what does not |
| 40 | + |
| 41 | +`genome_results.txt` matches on every line but four, and three of the raw |
| 42 | +tables match byte for byte. The residuals, each with its cause: |
| 43 | + |
| 44 | +| Figure | Difference | |
| 45 | +| --- | --- | |
| 46 | +| `mean mapping quality` | fourth decimal; 393 of 397 windows match exactly | |
| 47 | +| `std coverageData` | fourth decimal, same cause | |
| 48 | +| `homopolymer indels` | differs outright, see below | |
| 49 | +| coverage histogram and what derives from it | about five reference positions of 40001 sit one deeper | |
| 50 | +| `genome_fraction_coverage` | last two digits of the double, Qualimap accumulates per window | |
| 51 | +| `insert_size_histogram` | one extra row: Qualimap trims the largest insert from the plotted table while still counting it in the statistics | |
| 52 | + |
| 53 | +Qualimap classifies an indel as a homopolymer indel against a reference context |
| 54 | +RustQC does not reconstruct. It reports two polyC indels on the test data, and |
| 55 | +no rule derived from the read alone produces them, because the deleted bases |
| 56 | +are not in the read. RustQC uses a run-of-four rule instead, so this one figure |
| 57 | +will differ. |
| 58 | + |
| 59 | +Qualimap's GC content distribution and duplication rate histogram are not |
| 60 | +written at all. The first is computed over a 679-read subsample whose selection |
| 61 | +rule is not documented; the second uses a definition that does not match a |
| 62 | +read-start-position count. Emitting tables under those names with different |
| 63 | +numbers would be worse than leaving them out. |
| 64 | + |
| 65 | +## The HTML report |
| 66 | + |
| 67 | +RustQC writes its own summary page rather than a copy of Qualimap's, which |
| 68 | +ships a bundle of images, CSS and JavaScript. It carries the same numbers as |
| 69 | +`genome_results.txt`; the raw tables remain the machine-readable source. |
0 commit comments