Last updated: 2024-10-17

Checks: 6 1

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.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

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 14c1638. 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/

Unstaged changes:
    Modified:   analysis/ELISA_visualizations.Rmd

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
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

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 linear trend line
  labs(title = "Binding Percentage vs Weight, 4 groups",
       x = "Weight (mg)", y = "Binding Percentage") +
   scale_y_continuous(n.breaks = 10) +  
    geom_hline(yintercept = 50, linetype = "dashed", color = "gray", linewidth = 1) +  # Add horizontal line at y = 20
  theme_minimal()
`geom_smooth()` using formula = 'y ~ x'

# 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 linear trend line
  labs(title = "Binding Percentage vs Weight, by Buffer",
       x = "Weight (mg)", y = "Binding Percentage") +
   scale_y_continuous(n.breaks = 10) +  
    geom_hline(yintercept = 50, linetype = "dashed", color = "gray", linewidth = 1) +  # Add horizontal line at y = 20
  theme_minimal()
`geom_smooth()` using formula = 'y ~ x'

# 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 = "cyan4") +
  geom_smooth(method = "lm", se = FALSE, linewidth = 0.5, colour = "cyan3") +  # Add a linear trend line
  labs(title = "Binding Percentage vs Weight, by Spike",
       x = "Weight (mg)", y = "Binding Percentage") +
   scale_y_continuous(n.breaks = 10) +  
    geom_hline(yintercept = 50, linetype = "dashed", color = "gray", linewidth = 1) +  # Add horizontal line at y = 20
  theme_minimal()
`geom_smooth()` using formula = 'y ~ x'

Boxplots

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

Version Author Date
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() +
  labs(title = "Binding Percentage by Buffer",
       x = "Buffer (nl)", y = "Bindings Percentage") +
   scale_y_continuous(n.breaks = 10) +  
      geom_hline(yintercept = 50, linetype = "dashed", color = "gray", linewidth = 1) + 
  theme_minimal()

Version Author Date
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
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
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 a linear trend 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
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))
Sample Wells Raw.OD Binding.Perc Concentration_pg.ml Average_Conc_pg.ml CV.Perc SD SEM Weight_mg Buffer_nl Spike Failed_samples Binding_deviation
22 32 A11 0.656 50.0 1228 1197 3.690 44.20 31.30 37.1 250 0 NA 0.0
21 31 H9 0.701 51.2 1070 1149 9.750 112.00 79.20 21.2 60 0 NA 1.2
24 34 C11 0.687 51.7 1117 1124 0.867 9.74 6.89 35.5 250 0 NA 1.7
23 33 B11 0.696 52.3 1087 1100 1.730 19.10 13.50 33.8 250 0 NA 2.3
25 36 E11 0.695 53.2 1090 1062 3.680 39.10 27.60 31.2 250 0 NA 3.2
15 27 E9 0.610 46.0 1417 1393 2.430 33.80 23.90 21.6 60 0 NA 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) +  # Add a linear trend line
  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
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()

# 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") +  # Add a linear trend line
  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()

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
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       

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