-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinternal-barcodes.qmd
38 lines (26 loc) · 1.73 KB
/
internal-barcodes.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Internal barcodes not removed
![Sasha just can’t get any work done while the office keeps blasting 10 different songs at once! By Petra Korlević](assets/images/internal-barcodes/sasha.png){#fig-internal-barcodes height=400px}
```{r}
#| label: fig-internal-barcodes
#| fig-cap: Example of a smiley plot of a double stranded library with barcodes that were not removed prior mapping. Data taken from library GEN72 (ERR2112579) of [@Andrades_Valtuena2017-qr]. Damage data generated using [DamageProfiler](/intro.qmd) and plotted using R and tidyverse packages [@Wickham2019-ot].
#| echo: false
#| warning: false
#| error: false
library(readr)
library(tidyr)
library(dplyr)
library(ggplot2)
library(patchwork)
source("assets/src/R/style.r")
source("assets/src/R/damage-profiler.r")
type_colours <- type_colours_dp
raw_5p <- readr::read_tsv("assets/data/internal-barcodes/5p_freq_misincorporations.txt", comment = "#")
raw_3p <- readr::read_tsv("assets/data/internal-barcodes/3p_freq_misincorporations.txt", comment = "#")
long_5p <- pivot_longer_freqmisincorporat(raw_5p, reverse = FALSE, type_colours = type_colours)
long_3p <- pivot_longer_freqmisincorporat(raw_3p, reverse = TRUE, type_colours = type_colours)
smiley_5p <- plot_longer_freqmisincorporat(long_5p, reverse = FALSE, type_colours)
smiley_3p <- plot_longer_freqmisincorporat(long_3p, reverse = TRUE, type_colours)
smiley_5p + smiley_3p
```
In this case, this smiley plot is not very smiley as the mapped reads have not had 'internal barcode' removed prior mapping. As a side effect, you see a very spiky initial 'curve', and then the rest of the read being flat.
In this case, this library only has a single barcode on the 5p end, but some labs may add internal barcodes to both ends of molecules.