annotate fastqc_report_ori.Rmd @ 14:2efa46ce2c4c draft

upgrade fastqc_report
author mingchen0919
date Wed, 18 Oct 2017 22:06:39 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
1 ---
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
2 title: "Fastqc report: short reads quality evaluation"
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
3 author: "Ming Chen"
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
4 output: html_document
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
5 ---
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
6
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
7 ```{r setup, include=FALSE}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
8 knitr::opts_chunk$set(echo=ECHO, warning=FALSE, message=FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
9 library(plyr)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
10 library(stringr)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
11 library(dplyr)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
12 library(highcharter)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
13 library(DT)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
14 library(reshape2)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
15 library(plotly)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
16 library(formattable)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
17 library(htmltools)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
18 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
19
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
20
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
21 ```{bash 'create output directory', echo=FALSE}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
22 # create extra files directory. very important!
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
23 mkdir REPORT_OUTPUT_DIR
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
24 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
25
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
26 # Fastqc analysis
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
27 ```{bash 'copy data to working directory', echo=FALSE}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
28 # Copy uploaded data to the working directory
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
29 for f in $(echo READS | sed "s/,/ /g")
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
30 do
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
31 cp $f ./
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
32 done
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
33 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
34
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
35
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
36 ```{bash 'run fastqc', echo=FALSE}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
37 for r in $(ls *.dat)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
38 do
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
39 fastqc -o REPORT_OUTPUT_DIR $r > /dev/null 2>&1
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
40 done
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
41 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
42
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
43 ## Fastqc html reports
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
44
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
45 Below are links to ***Fastqc*** original html reports.
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
46 ```{r 'html report links'}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
47 html_report_list = list()
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
48 html_files = list.files('REPORT_OUTPUT_DIR', pattern = '.*html')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
49 for (i in html_files) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
50 html_report_list[[i]] = tags$li(tags$a(href=i, i))
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
51 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
52 tags$ul(html_report_list)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
53 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
54
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
55
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
56 ## Parsing fastqc data
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
57
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
58 ```{bash echo=FALSE}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
59 ##==== copy fastqc generated zip files from report output directory to job work directory ==
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
60 cp -r REPORT_OUTPUT_DIR/*zip ./
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
61
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
62 # create a file to store data file paths
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
63 echo "sample_id,file_path" > PWF_file_paths.txt # Pass, Warning, Fail
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
64 echo "sample_id,file_path" > PBQS_file_paths.txt # Per Base Quality Score
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
65 echo "sample_id,file_path" > PSQS_file_paths.txt # Per Sequence Quality Score
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
66 echo "sample_id,file_path" > PSGC_file_paths.txt # Per Sequence GC Content
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
67 echo "sample_id,file_path" > PBSC_file_paths.txt # Per Base Sequence Content
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
68 echo "sample_id,file_path" > PBNC_file_paths.txt # Per Base N Content
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
69 echo "sample_id,file_path" > SDL_file_paths.txt # Sequence Duplication Level
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
70 echo "sample_id,file_path" > SLD_file_paths.txt # Sequence Length Distribution
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
71 echo "sample_id,file_path" > KMC_file_paths.txt # Kmer Content
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
72
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
73 for i in $(ls *.zip)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
74 do
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
75 BASE=$(echo $i | sed 's/\(.*\)\.zip/\1/g')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
76 echo $BASE
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
77 unzip ${BASE}.zip > /dev/null 2>&1
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
78
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
79 ##====== pass,warning,fail (WSF) =============
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
80 awk '/^>>/ {print}' "$BASE"/fastqc_data.txt | grep -v 'END_MODULE' | sed 's/>>//' > "$BASE"-PWF.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
81 echo "${BASE},${BASE}-PWF.txt" >> PWF_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
82
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
83 ##====== per base quality scores (PBQS) ======
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
84 awk '/^>>Per base sequence quality/ {flag=1; next} /END_MODULE/ {flag=0} flag' "$BASE"/fastqc_data.txt >"$BASE"-PBQS.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
85 echo "${BASE},${BASE}-PBQS.txt" >> PBQS_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
86
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
87 ##====== per sequence quality scores (PSQS)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
88 awk '/^>>Per sequence quality scores/ {flag=1; next} /END_MODULE/ {flag=0} flag' "$BASE"/fastqc_data.txt >"$BASE"-PSQS.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
89 echo "${BASE},${BASE}-PSQS.txt" >> PSQS_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
90
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
91 ##====== Per sequence GC content (PSGC)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
92 awk '/^>>Per sequence GC content/ {flag=1; next} /END_MODULE/ {flag=0} flag' "$BASE"/fastqc_data.txt >"$BASE"-PSGC.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
93 echo "${BASE},${BASE}-PSGC.txt" >> PSGC_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
94
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
95 ##====== Per Base Sequence Content (PBSC)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
96 awk '/^>>Per base sequence content/ {flag=1; next} /END_MODULE/ {flag=0} flag' "$BASE"/fastqc_data.txt >"$BASE"-PBSC.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
97 echo "${BASE},${BASE}-PBSC.txt" >> PBSC_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
98
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
99 ##====== Per Base N Content (PBNC)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
100 awk '/^>>Per base N content/ {flag=1; next} /END_MODULE/ {flag=0} flag' "$BASE"/fastqc_data.txt >"$BASE"-PBNC.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
101 echo "${BASE},${BASE}-PBNC.txt" >> PBNC_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
102
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
103 ##====== Sequence Duplication Level (SDL)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
104 awk '/^>>Sequence Duplication Levels/ {flag=1; next} /END_MODULE/ {flag=0} flag' "$BASE"/fastqc_data.txt >"$BASE"-SDL.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
105 echo "${BASE},${BASE}-SDL.txt" >> SDL_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
106
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
107 ##====== Sequence Length Distribution (SLD)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
108 awk '/^>>Sequence Length Distribution/ {flag=1; next} /END_MODULE/ {flag=0} flag' "$BASE"/fastqc_data.txt >"$BASE"-SLD.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
109 echo "${BASE},${BASE}-SLD.txt" >> SLD_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
110
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
111 ##====== Kmer Content ============
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
112 awk '/^>>Kmer Content/ {flag=1; next} /END_MODULE/ {flag=0} flag' "$BASE"/fastqc_data.txt >"$BASE"-KMC.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
113 echo "${BASE},${BASE}-KMC.txt" >> KMC_file_paths.txt
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
114
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
115 done
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
116 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
117
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
118
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
119 ## Evaluation Overview
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
120
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
121 ```{r 'overview'}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
122 PWF_file_paths = read.csv('PWF_file_paths.txt',
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
123 header = TRUE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
124 rm('PWF_df')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
125 for(i in 1:nrow(PWF_file_paths)) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
126 file_path = PWF_file_paths[i,2]
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
127 pwf_df = read.csv(file_path,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
128 sep='\t', header=FALSE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
129 colnames(pwf_df) = c('item', PWF_file_paths[i,1])
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
130 if (!exists('PWF_df')) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
131 PWF_df = pwf_df
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
132 } else {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
133 PWF_df = cbind(PWF_df, pwf_df[,2,drop=FALSE])
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
134 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
135 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
136 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
137
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
138 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
139 my_icon = c('ok', 'remove', 'star')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
140 names(my_icon) = c('pass', 'fail', 'warn')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
141 evaluate_list = list()
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
142 for (i in colnames(PWF_df)[-1]) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
143 evaluate_list[[i]] = formatter(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
144 "span",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
145 style = x ~ style("background-color" = ifelse(x =='pass', '#9CD027', ifelse(x == 'fail', '#CC0000', '#FF4E00')),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
146 "color" = "white",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
147 "width" = "50px",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
148 "float" = "left",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
149 "padding-right" = "5px")
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
150 )
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
151 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
152
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
153 formattable(PWF_df, evaluate_list)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
154 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
155
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
156
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
157 ## Per Base Quality Scores
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
158
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
159 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
160 PBQS_df = data.frame()
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
161 PBQS_file_paths = read.csv('PBQS_file_paths.txt',
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
162 header = TRUE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
163 for(i in 1:nrow(PBQS_file_paths)) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
164 # file_path = paste0('REPORT_OUTPUT_DIR/', PBQS_file_paths[i,2])
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
165 file_path = PBQS_file_paths[i,2]
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
166 pbqs_df = read.csv(file_path,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
167 sep='\t', header=TRUE, stringsAsFactors = FALSE) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
168 mutate(Base1=as.numeric(str_split_fixed(X.Base, '-', 2)[,1]),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
169 Base2=as.numeric(str_split_fixed(X.Base, '-', 2)[,2])) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
170 (function (df) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
171 df1 = select(df, -Base2)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
172 df2 = select(df, -Base1) %>% filter(Base2 != '')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
173 colnames(df1) = c(colnames(df1)[1:7], 'Base')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
174 colnames(df2) = c(colnames(df2)[1:7], 'Base')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
175 res = rbind(df1, df2) %>% arrange(Base)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
176 return(res)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
177 })
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
178 pbqs_df$sample_id = rep(PBQS_file_paths[i,1], nrow(pbqs_df))
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
179 PBQS_df = rbind(PBQS_df, pbqs_df)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
180 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
181 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
182
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
183
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
184 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
185 # datatable(PBQS_df)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
186 max_phred = max(PBQS_df$Mean) + 10
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
187 hchart(PBQS_df, "line", hcaes(x = Base, y = Mean, group = sample_id)) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
188 hc_title(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
189 text = "Per Base Quality Score"
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
190 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
191 hc_yAxis(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
192 title = list(text = "Mean Base Quality Score"),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
193 min = 0,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
194 max = max_phred,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
195 plotLines = list(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
196 list(label = list(text = "Phred Score = 27"),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
197 width = 2,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
198 dashStyle = "dash",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
199 color = "green",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
200 value = 27),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
201 list(label = list(text = "Phred Score = 20"),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
202 width = 2,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
203 color = "red",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
204 value = 20)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
205 )
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
206 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
207 hc_exporting(enabled = TRUE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
208 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
209
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
210
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
211 ## Per Base N Content
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
212
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
213 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
214 PBNC_df = data.frame()
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
215 PBNC_file_paths = read.csv('PBNC_file_paths.txt',
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
216 header = TRUE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
217 for(i in 1:nrow(PBNC_file_paths)) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
218 # file_path = paste0('REPORT_OUTPUT_DIR/', PBNC_file_paths[i,2])
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
219 file_path = PBNC_file_paths[i,2]
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
220 pbnc_df = read.csv(file_path,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
221 sep='\t', header=TRUE, stringsAsFactors = FALSE) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
222 mutate(Base1=as.numeric(str_split_fixed(X.Base, '-', 2)[,1]),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
223 Base2=as.numeric(str_split_fixed(X.Base, '-', 2)[,2])) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
224 (function (df) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
225 df1 = select(df, -Base2)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
226 df2 = select(df, -Base1) %>% filter(Base2 != '')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
227 colnames(df1) = c(colnames(df1)[1:2], 'Base')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
228 colnames(df2) = c(colnames(df2)[1:2], 'Base')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
229 res = rbind(df1, df2) %>% arrange(Base)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
230 return(res)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
231 })
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
232 pbnc_df$sample_id = rep(PBNC_file_paths[i,1], nrow(pbnc_df))
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
233 PBNC_df = rbind(PBNC_df, pbnc_df)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
234 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
235 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
236
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
237
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
238 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
239 PBNC_df$N.Count = PBNC_df$N.Count * 100
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
240 max_phred = max(PBNC_df$N.Count) + 5
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
241 hchart(PBNC_df, "line", hcaes(x = as.character(Base), y = N.Count, group = sample_id)) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
242 hc_title(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
243 text = "Per Base N Content"
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
244 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
245 hc_xAxis(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
246 title = list(text = "Base Position")
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
247 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
248 hc_yAxis(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
249 title = list(text = "N %"),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
250 plotLines = list(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
251 list(label = list(text = "N = 5%"),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
252 width = 2,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
253 dashStyle = "dash",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
254 color = "red",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
255 value = 5)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
256 )
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
257 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
258 hc_exporting(enabled = TRUE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
259 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
260
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
261
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
262
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
263
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
264 ## Per Sequence Quality Scores
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
265
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
266 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
267 PSQS_df = data.frame()
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
268 PSQS_file_paths = read.csv('PSQS_file_paths.txt',
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
269 header = TRUE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
270 for(i in 1:nrow(PSQS_file_paths)) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
271 # file_path = paste0('REPORT_OUTPUT_DIR/', PSQS_file_paths[i,2])
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
272 file_path = PSQS_file_paths[i,2]
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
273 psqs_df = read.csv(file_path,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
274 sep='\t', header=TRUE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
275 psqs_df$sample_id = rep(PSQS_file_paths[i,1], nrow(psqs_df))
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
276 PSQS_df = rbind(PSQS_df, psqs_df)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
277 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
278 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
279
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
280
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
281 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
282 max_phred = max(PSQS_df$X.Quality) + 5
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
283 hchart(PSQS_df, "line", hcaes(x = X.Quality, y = Count, group = sample_id)) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
284 hc_title(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
285 text = "Per Sequence Quality Score"
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
286 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
287 hc_xAxis(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
288 title = list(text = "Mean Sequence Quality Score"),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
289 min = 0,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
290 max = max_phred,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
291 plotLines = list(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
292 list(label = list(text = "Phred Score = 27"),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
293 width = 2,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
294 dashStyle = "dash",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
295 color = "green",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
296 value = 27),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
297 list(label = list(text = "Phred Score = 20"),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
298 width = 2,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
299 color = "red",
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
300 value = 20)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
301 )
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
302 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
303 hc_exporting(enabled = TRUE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
304 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
305
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
306
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
307 ## Per Sequence GC Content
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
308
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
309
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
310 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
311 PSGC_df = data.frame()
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
312 PSGC_file_paths = read.csv('PSGC_file_paths.txt',
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
313 header = TRUE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
314 for(i in 1:nrow(PSGC_file_paths)) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
315 # file_path = paste0('REPORT_OUTPUT_DIR/', PSGC_file_paths[i,2])
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
316 file_path = PSGC_file_paths[i,2]
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
317 psgc_df = read.csv(file_path,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
318 sep='\t', header=TRUE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
319 psgc_df$sample_id = rep(PSGC_file_paths[i,1], nrow(psgc_df))
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
320 PSGC_df = rbind(PSGC_df, psgc_df)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
321 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
322 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
323
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
324
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
325 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
326 max_phred = max(PSGC_df$Count) + 5
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
327 hchart(PSGC_df, "line", hcaes(x = X.GC.Content, y = Count, group = sample_id)) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
328 hc_title(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
329 text = "Per Sequence GC Content"
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
330 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
331 hc_xAxis(
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
332 title = list(text = "% GC")
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
333 ) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
334 hc_exporting(enabled = TRUE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
335 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
336
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
337
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
338 ## Per Base Sequence Content
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
339
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
340 ```{r}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
341 PBSC_df = data.frame()
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
342 PBSC_file_paths = read.csv('PBSC_file_paths.txt',
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
343 header = TRUE, stringsAsFactors = FALSE)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
344 for(i in 1:nrow(PBSC_file_paths)) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
345 # file_path = paste0('REPORT_OUTPUT_DIR/', PBSC_file_paths[i,2])
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
346 file_path = PBSC_file_paths[i,2]
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
347 pbsc_df = read.csv(file_path,
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
348 sep='\t', header=TRUE, stringsAsFactors = FALSE) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
349 mutate(Base1=as.numeric(str_split_fixed(X.Base, '-', 2)[,1]),
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
350 Base2=as.numeric(str_split_fixed(X.Base, '-', 2)[,2])) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
351 (function (df) {
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
352 df1 = select(df, -Base2)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
353 df2 = select(df, -Base1) %>% filter(Base2 != '')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
354 colnames(df1) = c(colnames(df1)[1:5], 'Base')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
355 colnames(df2) = c(colnames(df2)[1:5], 'Base')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
356 res = rbind(df1, df2) %>% arrange(Base)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
357 return(res)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
358 })
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
359 pbsc_df$sample_id = rep(PBSC_file_paths[i,1], nrow(pbsc_df))
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
360 PBSC_df = rbind(PBSC_df, pbsc_df)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
361 }
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
362 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
363
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
364
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
365 ```{r out.width="100%"}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
366 PBSC_df_2 = select(PBSC_df, -X.Base) %>%
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
367 melt(id = c('Base', 'sample_id'), value.name = 'base_percentage')
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
368 p = ggplot(data = PBSC_df_2, aes(x = Base, y = base_percentage, group = variable, color = variable)) +
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
369 geom_line() +
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
370 facet_wrap(~ sample_id)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
371 ggplotly(p)
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
372 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
373
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
374
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
375 # Session Info
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
376
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
377 ```{r 'session info'}
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
378 sessionInfo()
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
379 ```
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
380
2efa46ce2c4c upgrade fastqc_report
mingchen0919
parents:
diff changeset
381