-
Notifications
You must be signed in to change notification settings - Fork 2
/
static_plate_reader_plotting_and_html.Rmd
95 lines (64 loc) · 2.62 KB
/
static_plate_reader_plotting_and_html.Rmd
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
author: "Prashant Kalvapalle"
date: '`r format(Sys.time(), "%d %B, %Y")`'
output:
html_document:
theme: flatly
toc: TRUE
toc_float: TRUE
---
---
title: `r title_name`
---
```{r setup, include=FALSE}
library(knitr)
knitr::opts_chunk$set(echo = F, message = F, warning = F, fig.width = 5, fig.height = 4)
```
## Plotting
### all fluorescence (normalized)
```{r allfluor}
plt_all_fluor <- ggplot(data = long_fluor.normalized_processed,
mapping = aes(y = Samples, x = value)) +
geom_jitter(width = 0, height = .3) + # plot individual replicates
# plot mean as a vertical dash (for small point, use size = 0.5)
geom_point(data = long_unique.normalized_processed,
aes(x = mean), size = 5, shape = '|') +
# Indicate a light grey bar for the mean - to aid the eye
geom_bar(data = long_unique.normalized_processed,
aes(x = mean, y = Samples), alpha = 0.3, fill = 'gray', stat = 'identity',position = 'dodge') +
# facets
facet_grid(~ Measurement, space = 'free', scale = 'free') +
# geom_segment(aes(x = GFP_mean, xend = 0, yend = Samples), alpha = 0.1, colour = 'red') +
# Axis labels
xlab('Value') + ylab('') +
# Plot title and subtitle
ggtitle(str_c('Fluorescence measurement', if(MEFL_normalization) ' : in MEFL (uM)' else ' (a.u.)' ),
subtitle = 'Plasmids')
plt_all_fluor_annotated <-
{plt_all_fluor +
geom_text(data = long_unique.normalized_processed,
mapping = aes(x = mean, label = mean %>% round,
hjust = if_else(mean > max(mean)/2, 1.3, -0.3)))
} %>%
print()
# showing GFP/OD and RFP/OD with equal width
plt_all_fluor_annotated + facet_grid(~ Measurement, scale = 'free')
```
### Ordered: fluorescence and normalized
```{r rawgfp}
# Find all the fluoresce channels in the data (return as expression)
FPs <- colnames(processed.data) %>% str_subset('.FP$|OD$') %>% rlang::parse_exprs(.)
# Run the raw data plotter on each fluorescence : regular + interactive plot
map(FPs, plot_static_fluorescence)
```
``` {r child = if(run_dose_response_pipeline) 'dose_response_plots.Rmd'}
# child document format inspired from : https://bookdown.org/yihui/rmarkdown-cookbook/child-document.html
# `r if(run_dose_response_pipeline {"## Dose-response plots"})`
```
## Data tables
Baseline fluorescence that was subtracted before plotting
``` {r datadisplay}
# kable(processed.data, caption = 'full data') # format with colours etc for good visualization
kable(empty_cells_baseline) # show baseline data
```
check for processed data as a csv file in the `/plate reader data/processed` folder