Mercurial > repos > mingchen0919 > rmarkdown_fastqc_site
comparison 05_per_base_sequence_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 sequence 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 sequence content | |
19 | |
20 ```{r 'Per base sequence content', fig.width=10} | |
21 ## reads 1 | |
22 pbsc_1 = extract_data_module('REPORT_DIR/reads_1_fastqc_data.txt', 'Per base sequence content') | |
23 pbsc_1$id = 1:length(pbsc_1$X.Base) | |
24 | |
25 melt_pbsc_1 = melt(pbsc_1, id=c('X.Base', 'id')) | |
26 melt_pbsc_1$trim = 'before' | |
27 | |
28 | |
29 ## reads 2 | |
30 pbsc_2 = extract_data_module('REPORT_DIR/reads_2_fastqc_data.txt', 'Per base sequence content') | |
31 pbsc_2$id = 1:length(pbsc_2$X.Base) | |
32 | |
33 melt_pbsc_2 = melt(pbsc_2, id=c('X.Base', 'id')) | |
34 melt_pbsc_2$trim = 'after' | |
35 | |
36 comb_pbsc = rbind(melt_pbsc_1, melt_pbsc_2) | |
37 comb_pbsc$trim = factor(levels = c('before', 'after'), comb_pbsc$trim) | |
38 | |
39 p = ggplot(data = comb_pbsc, aes(x = id, y = value, color = variable)) + | |
40 geom_line() + | |
41 facet_grid(. ~ trim) + | |
42 xlim(min(comb_pbsc$id), max(comb_pbsc$id)) + | |
43 ylim(0, 100) + | |
44 xlab('Position in read (bp)') + | |
45 ylab('') | |
46 ggplotly(p) | |
47 ``` |