Mercurial > repos > mingchen0919 > rmarkdown_fastqc_site
comparison 07_per_base_n_content.Rmd @ 11:507eec497730 draft
update fastqc site
author | mingchen0919 |
---|---|
date | Tue, 07 Nov 2017 16:52:24 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
10:600c39b11913 | 11:507eec497730 |
---|---|
1 --- | |
2 title: 'Per base N content' | |
3 output: | |
4 html_document: | |
5 number_sections: true | |
6 toc: true | |
7 theme: cosmo | |
8 highlight: tango | |
9 --- | |
10 | |
11 ```{r setup, include=FALSE, warning=FALSE, message=FALSE} | |
12 knitr::opts_chunk$set( | |
13 echo = ECHO, | |
14 error = TRUE | |
15 ) | |
16 ``` | |
17 | |
18 ### Per base N content | |
19 | |
20 ```{r 'Per base N content', fig.width=10} | |
21 ## reads 1 | |
22 pbNc_1 = extract_data_module('REPORT_DIR/reads_1_fastqc_data.txt', 'Per base N content') | |
23 pbNc_1$id = 1:length(pbNc_1$X.Base) | |
24 pbNc_1$trim = 'before' | |
25 | |
26 ## reads 2 | |
27 pbNc_2 = extract_data_module('REPORT_DIR/reads_2_fastqc_data.txt', 'Per base N content') | |
28 pbNc_2$id = 1:length(pbNc_2$X.Base) | |
29 pbNc_2$trim = 'after' | |
30 | |
31 comb_pbNc = rbind(pbNc_1, pbNc_2) | |
32 comb_pbNc$trim = factor(levels = c('before', 'after'), comb_pbNc$trim) | |
33 | |
34 p = ggplot(data = comb_pbNc, aes(x = id, y = N.Count)) + | |
35 geom_line(color = 'red') + | |
36 scale_x_continuous(breaks = pbNc_2$id, labels = pbNc_2$X.Base) + | |
37 facet_grid(. ~ trim) + | |
38 ylim(0, 1) + | |
39 xlab('N-Count') + | |
40 ylab('') + | |
41 theme(axis.text.x = element_text(angle=45)) | |
42 ggplotly(p) | |
43 ``` |