Last updated: 2024-10-18

Checks: 7 0

Knit directory: test-3/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20241016) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version a327e87. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/ELISA_visualizations.Rmd) and HTML (docs/ELISA_visualizations.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd a327e87 Paloma 2024-10-18 wflow_publish("./analysis/ELISA_visualizations.Rmd")
Rmd a59d14d Paloma 2024-10-18 visualizations-updated
html a59d14d Paloma 2024-10-18 visualizations-updated
html 8e3a655 Paloma 2024-10-17 update plots
Rmd de44ed6 Paloma 2024-10-17 wflow_publish("./analysis/ELISA_visualizations.Rmd")
html 98024d2 Paloma 2024-10-16 Build site.
Rmd 1953f30 Paloma 2024-10-16 wflow_publish("./analysis/ELISA_visualizations.Rmd")
html b08a78b Paloma 2024-10-16 Build site.
Rmd 0d06b46 Paloma 2024-10-16 wflow_publish("./analysis/ELISA_visualizations.Rmd")
Rmd b03e143 Paloma 2024-10-16 creating plots
html b03e143 Paloma 2024-10-16 creating plots
Rmd 2cbdcc9 Paloma 2024-10-16 merged data, cleaned, visualized some results
html 2cbdcc9 Paloma 2024-10-16 merged data, cleaned, visualized some results

Introduction

Here I use results from ELISA test-3. I removed the samples that have a Coef of variation higher than 15%.

Binding percentage

Scatterplots

# Scatter plot of Binding Percentage vs Weight, 4 groups

ggplot(data, aes(x = Weight_mg, 
                 y = Binding.Perc, 
                 color = factor(Spike), 
                 shape = factor(Buffer_nl))) +
  geom_point(size = 3) +
  geom_smooth(method = "lm", se = FALSE, linewidth = 0.5) +  # Add a trend line
  geom_hline(yintercept = 50, linetype = "dashed", 
             color = "gray", linewidth = 1) +  # Add horizontal line
  labs(title = "Binding Percentage vs Weight, 4 groups",
       x = "Weight (mg)", 
       y = "Binding Percentage") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
# Scatter plot of Binding Percentage vs Weight, 2 groups (Buffer)

ggplot(data, aes(x = Weight_mg, 
                 y = Binding.Perc, 
                 color = factor(Buffer_nl))) +
  geom_point(size = 3) +
  geom_smooth(method = "lm", se = FALSE, linewidth = 0.5) +  # Add a trend line
  geom_hline(yintercept = 50, linetype = "dashed", 
             color = "gray", linewidth = 1) +  # Add horizontal line 
  labs(title = "Binding Percentage vs Weight, by Buffer",
       x = "Weight (mg)", y = "Binding Percentage") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
# Scatter plot of Binding Percentage vs Weight, 2 groups (Spike)

ggplot(data, aes(x = Weight_mg, 
                 y = Binding.Perc, 
                 shape = factor(Spike))) +
  geom_point(size = 3, colour = "brown") +
  geom_smooth(method = "lm", se = FALSE, linewidth = 0.5, 
              colour = "cyan3") +  # Add a linear trend line
  geom_hline(yintercept = 50, linetype = "dashed",
             color = "gray", linewidth = 1) +  # Add horizontal line at y = 20
  labs(title = "Binding Percentage vs Weight, by Spike",
       x = "Weight (mg)", y = "Binding Percentage") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18

Boxplots

# Boxplot of Binding Percentage vs Buffer & Spike

ggplot(data, aes(x = factor(Buffer_nl), 
                 y = Binding.Perc, 
                 fill = factor(Spike))) +
  geom_boxplot() +
  geom_hline(yintercept = 50, linetype = "dashed", color = "gray", linewidth = 1) + 
  labs(title = "Binding Percentage by Buffer and Spike",
       x = "Buffer (nl)", y = "Binding Percentage") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
8e3a655 Paloma 2024-10-17
b08a78b Paloma 2024-10-16
b03e143 Paloma 2024-10-16
# Boxplot of Binding Percentage vs Buffer

ggplot(data, aes(x = factor(Buffer_nl), 
                 y = Binding.Perc, 
                 fill = factor(Buffer_nl))) +
  geom_boxplot() +
  geom_hline(yintercept = 50, linetype = "dashed", color = "gray", linewidth = 1) + 
  labs(title = "Binding Percentage by Buffer",
       x = "Buffer (nl)", y = "Bindings Percentage") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
8e3a655 Paloma 2024-10-17
b08a78b Paloma 2024-10-16
b03e143 Paloma 2024-10-16
# Boxplot of Binding Percentage vs Spike

ggplot(data, aes(x = factor(Spike), y = Binding.Perc, fill = Spike)) +
  geom_boxplot() +
  labs(title = "Binding Percentage by Spike",
       x = "Spike", y = "Binding Percentage") +
  scale_y_continuous(n.breaks = 10) +  
  geom_hline(yintercept = 50, linetype = "dashed", color = "gray", linewidth = 1) +
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
8e3a655 Paloma 2024-10-17
b08a78b Paloma 2024-10-16
b03e143 Paloma 2024-10-16

Coef. of variation percentage

Boxplot

# Boxplot of CV Percentage vs Buffer & Spike

ggplot(data, aes(x = factor(Buffer_nl), 
                 y = CV.Perc, 
                 fill = factor(Spike))) +
  geom_boxplot() +
  labs(title = "Coef. of variation by Buffer and Spike",
       x = "Buffer (nl)", y = "Coef of variation %") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
8e3a655 Paloma 2024-10-17
b08a78b Paloma 2024-10-16

Scatterplot

# Scatterplot CV Percentage vs Weight, 4 groups

ggplot(data, aes(x = Weight_mg, 
                 y = CV.Perc, 
                 color = factor(Spike), 
                 shape = factor(Buffer_nl))) +
  geom_point(size = 3) +
  geom_smooth(method = "lm", se = FALSE, linewidth = 0.5) +  # Add line
  labs(title = "Coef. of variation vs Weight, 4 groups",
       x = "Weight (mg)", y = "Coef of variation %") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()
`geom_smooth()` using formula = 'y ~ x'

Version Author Date
a59d14d Paloma 2024-10-18
8e3a655 Paloma 2024-10-17
b08a78b Paloma 2024-10-16

Deviation from 50% binding

Calculating deviation from 50% binding

Over 80% and under 20% bindings are considered not reliable. Here I calculate a “binding” deviation, or a distance from what I should aim for: 50% binding.

data$Binding_deviation <- abs(data$Binding.Perc - 50)
sorted_data <- data[order(data$Binding_deviation), ]

dim(sorted_data)
[1] 32 14
# View top results (closest to 50% Binding Percentage)

kable(head(sorted_data[,c("Sample", "Wells", "Binding.Perc", "Binding_deviation")]))
Sample Wells Binding.Perc Binding_deviation
22 32 A11 50.0 0.0
21 31 H9 51.2 1.2
24 34 C11 51.7 1.7
23 33 B11 52.3 2.3
25 36 E11 53.2 3.2
15 27 E9 46.0 4.0

Scatterplots

# Scatter plot of Binding Deviation vs Weight, 4 groups

ggplot(data, aes(x = Weight_mg, 
                 y = Binding_deviation, 
                 color = factor(Spike), 
                 shape = factor(Buffer_nl))) +
  geom_point(size = 3) +
  geom_smooth(method = "lm", se = FALSE, linewidth = 0.5) + 
  labs(title = "Binding Deviation vs Weight, 4 groups",
       x = "Weight (mg)", y = "Binding Deviation") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
8e3a655 Paloma 2024-10-17
b08a78b Paloma 2024-10-16
# Scatter plot of Binding Deviation vs Weight, colored by Buffer

ggplot(data, aes(x = Weight_mg, 
                 y = Binding_deviation, 
                 color = factor(Buffer_nl))) +
  geom_point(size = 3) +
  geom_smooth(method = "lm", se = FALSE) +  # Add a linear trend line
  labs(title = "Binding Deviation vs Weight, by Buffer, 2 groups",
       x = "Weight (mg)", y = "Binding Percentage") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
# Scatter plot of Binding Deviation vs Weight, shape by Spike

ggplot(data, aes(x = Weight_mg, 
                 y = Binding_deviation, 
                 shape = factor(Spike))) +
  geom_point(size = 3, colour = "cyan4") + 
  geom_smooth(method = "lm", se = FALSE, linewidth = 0.5, colour = "cyan3") +  
  labs(title = "Binding Deviation vs Weight, shape by Spike, 2 groups",
       x = "Weight (mg)", y = "Binding Deviation") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18

Boxplot

# Box plot to visualize distribution of Binding deviation by Buffer and Spike

ggplot(data, aes(x = factor(Buffer_nl),
                 y = Binding_deviation, 
                 fill = factor(Spike))) +
  geom_boxplot() +
  labs(title = "Binding deviation by Buffer and Spike",
       x = "Buffer (nl)", y = "Binding deviation") +
  scale_y_continuous(n.breaks = 10) +  
  theme_minimal()

Version Author Date
a59d14d Paloma 2024-10-18
8e3a655 Paloma 2024-10-17
b08a78b Paloma 2024-10-16

sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RColorBrewer_1.1-3 ggplot2_3.5.1      knitr_1.48         dplyr_1.1.2       
[5] workflowr_1.7.1   

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.0  xfun_0.47         bslib_0.8.0       splines_4.1.0    
 [5] lattice_0.20-44   colorspace_2.1-0  vctrs_0.6.5       generics_0.1.3   
 [9] htmltools_0.5.8.1 yaml_2.3.7        mgcv_1.8-35       utf8_1.2.3       
[13] rlang_1.1.0       jquerylib_0.1.4   later_1.3.0       pillar_1.9.0     
[17] glue_1.6.2        withr_3.0.1       lifecycle_1.0.4   stringr_1.5.1    
[21] munsell_0.5.1     gtable_0.3.5      evaluate_1.0.0    labeling_0.4.3   
[25] callr_3.7.6       fastmap_1.1.1     httpuv_1.6.9      ps_1.7.5         
[29] fansi_1.0.4       highr_0.11        Rcpp_1.0.10       promises_1.2.0.1 
[33] scales_1.3.0      cachem_1.0.7      jsonlite_1.8.9    farver_2.1.1     
[37] fs_1.5.2          digest_0.6.31     stringi_1.7.12    processx_3.8.1   
[41] getPass_0.2-2     rprojroot_2.0.4   grid_4.1.0        cli_3.6.1        
[45] tools_4.1.0       magrittr_2.0.3    sass_0.4.9        tibble_3.2.1     
[49] whisker_0.4.1     pkgconfig_2.0.3   Matrix_1.3-3      rmarkdown_2.28   
[53] httr_1.4.7        rstudioapi_0.16.0 R6_2.5.1          nlme_3.1-152     
[57] git2r_0.31.0      compiler_4.1.0