Why use R?

I’ve found that using a software like R has been immensely helpful in lab. The way I see it, it comes with two big advantages to doing things by hand. First, it can drastically reduce the time to do things while simultaneously reducing the chances of making an error. There are inevitably going to be tasks that you find yourself doing over and over again (e.g. measuring DNA concentrations from samples with the plate reader). By investing some time up front to automate that process (and set it up well), you can then sit back and let the computer do the work and know that it won’t make any mistakes. The one caveat here is that it might take a lot of time to get your function to work and work reliably, so there’s a bit of a balance. Also, if you make a mistake in setting up your function, it will be carried through every time you use it later. The second big advantage is that since the files are all digital and most data analysis scripts are relatively small, you can essentially use your collection of scripts (that naturally come with timestamps) as a rough draft of a lab notebook. By making a new file for every new set of data you’re crunching, you have a digital record of what you’ve done.

An additional perk of using R is that by now, there are a wealth of packages out there that can let you do pretty much anything you will want with your data (except, notoriously, an easy way to make 3D plots). With the functions contained in this package, I’m hoping to further bridge the gap between lab-specific uses of R and the rest universe of data handling packages.

Helpful tools to get started

If you need to get started with R, there are a few helpful resources available on the web. In general, if you look up whatever you are having trouble with, plus “R stats” on Google, you should find a decent answer within the first few results. But for getting started from scratch, I’ll simply link to a couple of helpful resources I’ve come across. By no means are they the only ones available, and you might very well find another that is more helpful to you. One last very helpful resource is the “tidyverse”. It is a set of R packages that are meant to work with each other to simplify most of the steps along the data analysis pipeline from reading data in, manipulating the data, and plotting it. It was developed and maintianed by Hadley Wickham, the chief scientist of RStudio, which is another tool that you’ll want to get your hands on. From here on out, I’ll assume you have RStudio installed with the latest version of R (at least 3.4.4). With that in hand, we can go on and explore what this package has to offer.

Walkthrough of package functions

The purpose of this package is to put together a collection of (hopefully) broadly-applicable functions that can be used by some/most people in the lab. So what follows is a small description of each of the individual functions I’ve put into this package, and then some examples of workflows that utilize some or most of these functions.

To use this package, install it from bitbucket. You will first have to install the devtools package:

install.packages('devtools')

Then, you can use the devtools package to install the FaithLabTools package from bitbucket. We pass along the build_vignettes flag in order to ensure that this helpful guide is included in the package installation:

devtools::install_bitbucket('econtijoch/faithlabtools', build_vignettes = TRUE)

Next, you’ll have to load the FaithLabTools package:

Using either require() or library() works. To access this vignette within R, you can execute the following command: vignette("Introduction", package = "FaithLabTools").

If you have any issues getting the package to work, try installing the package with build_vignettes = FALSE. You can also compare your system setup by using sessionInfo().

sessionInfo()
#> R version 3.5.2 (2018-12-20)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Mojave 10.14.4
#> 
#> Matrix products: default
#> BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#>  [1] bindrcpp_0.2.2      FaithLabTools_0.1.0 forcats_0.3.0      
#>  [4] stringr_1.3.1       dplyr_0.7.8         purrr_0.2.5        
#>  [7] readr_1.3.1         tidyr_0.8.2         tibble_2.0.0       
#> [10] ggplot2_3.1.0       tidyverse_1.2.1     knitr_1.22         
#> [13] kableExtra_1.1.0   
#> 
#> loaded via a namespace (and not attached):
#>  [1] beeswarm_0.2.3    tidyselect_0.2.5  xfun_0.4         
#>  [4] haven_2.0.0       lattice_0.20-38   colorspace_1.3-2 
#>  [7] generics_0.0.2    viridisLite_0.3.0 htmltools_0.3.6  
#> [10] yaml_2.2.0        rlang_0.3.1       pillar_1.3.1     
#> [13] withr_2.1.2       glue_1.3.0        modelr_0.1.2     
#> [16] readxl_1.2.0      bindr_0.1.1       plyr_1.8.4       
#> [19] munsell_0.5.0     gtable_0.2.0      cellranger_1.1.0 
#> [22] rvest_0.3.2       evaluate_0.12     vipor_0.4.5      
#> [25] highr_0.7         broom_0.5.1       Rcpp_1.0.0       
#> [28] scales_1.0.0      backports_1.1.3   webshot_0.5.1    
#> [31] jsonlite_1.6      hms_0.4.2         digest_0.6.18    
#> [34] stringi_1.2.4     grid_3.5.2        cli_1.0.1        
#> [37] tools_3.5.2       magrittr_1.5      lazyeval_0.2.1   
#> [40] crayon_1.3.4      pkgconfig_2.0.2   xml2_1.2.0       
#> [43] ggbeeswarm_0.6.0  lubridate_1.7.4   assertthat_0.2.0 
#> [46] rmarkdown_1.11    httr_1.4.0        rstudioapi_0.9.0 
#> [49] R6_2.3.0          nlme_3.1-137      compiler_3.5.2

Generating example files to work with

If you don’t have any files to work with, or if you can’t figure out why something isn’t working, I’ve included a good number of files in this package that should be helpful. To generate these files in your computer, use the make_example_files() function. If you do not provide a directory, it will create the files in your current directory:

make_example_files(directory = '~/Desktop/example_directory')

I will refer to these files moving forward, so if you want to be able to replicate any of the steps, you can use these files as a guide.

Sample weighing using barcoded tubes

A key aspect of measuring microbiota density in fecal samples is to accurately mass each sample. To do this, we’ve developed a barcoding system to label and keep track of tubes as they are weighed using the digital scale. A key part of this is the LabelMaker Spreadsheet which makes barcodes for each sample. With these labels on the tubes, we can weigh each tube quickly and keep track of which tube is which. By weighing each tube before and after collecting a sample, we can calculate the mass of each sample. Since tubes can easily get shuffled around, the point of the mass_and_order() function is to use the barcodes to keep track of each sample, and to pair each full weight with the correct empty weight. We can use it to read in two sample mass files and get a sample mass output:

sample_weights <- mass_and_order(empty_weights = 'Example_empty_weights.txt', full_weights = 'Example_full_weights.txt')
TubeBarcode Full_Mass Full_Weight_Date Full_Weight_Time BarcodeID Empty_Mass Empty_Weight_Date Empty_Weight_Time SampleMass
0231322517 974.9 9/7/2017 10:34:58 SW_Abs|00000008a|083017|ZEOvr 936.2 8/15/17 17:06:56 38.7
0231322445 998.3 9/7/2017 10:35:06 SW_Abs|00000001a|090117|kmSFB 937.1 8/15/17 17:07:12 61.2
0231322462 968.1 9/7/2017 10:35:10 SW_Abs|00000001b|090117|vPhZA 936.1 8/15/17 17:07:21 32.0
0231322484 1023.5 9/7/2017 10:35:17 SW_Abs|00000002a|090117|VGBO5 934.7 8/15/17 17:07:26 88.8
0231322512 960.3 9/7/2017 10:35:21 SW_Abs|00000002b|090117|o0k9G 933.7 8/15/17 17:07:33 26.6
0231322487 1032.0 9/7/2017 10:35:25 SW_Abs|00000003a|090117|72BP4 934.1 8/15/17 17:07:39 97.9
0231322535 1024.4 9/7/2017 10:35:28 SW_Abs|00000003b|090117|3FTmt 943.2 8/15/17 17:07:44 81.2
0231322508 986.2 9/7/2017 10:35:32 SW_Abs|00000004a|090117|hNGut 933.6 8/15/17 17:07:50 52.6
0231322488 975.6 9/7/2017 10:35:36 SW_Abs|00000004b|090117|LhoYM 935.0 8/15/17 17:07:56 40.6
0231322467 987.9 9/7/2017 10:35:42 SW_Abs|00000005a|090117|xLH85 934.3 8/15/17 17:08:03 53.6
0231322491 1037.9 9/7/2017 10:35:46 SW_Abs|00000005b|090117|ETVjZ 935.3 8/15/17 17:08:09 102.6
0231322519 1026.6 9/7/2017 10:35:50 SW_Abs|00000005c|090117|WRTSc 942.1 8/15/17 17:08:14 84.5
0231322509 968.2 9/7/2017 10:35:59 SW_Abs|00000006a|090117|a5iyE 934.7 8/15/17 17:08:23 33.5
0231322486 1013.6 9/7/2017 10:36:07 SW_Abs|00000006b|090117|8NDro 939.8 8/15/17 17:08:32 73.8
0231322494 985.8 9/7/2017 10:36:14 SW_Abs|00000007a|090117|yrJ0D 934.6 8/15/17 17:08:38 51.2
0231322465 1019.7 9/7/2017 10:36:18 SW_Abs|00000007b|090117|Qt8e8 936.6 8/15/17 17:08:47 83.1
0231322471 965.5 9/7/2017 10:36:22 SW_Abs|00000008a|090117|w5Rnn 934.1 8/15/17 17:08:53 31.4
0231322460 971.2 9/7/2017 10:36:27 SW_Abs|00000008b|090117|p4HKp 933.7 8/15/17 17:09:00 37.5
0231322432 985.9 9/7/2017 10:36:31 SW_Abs|00000009a|090117|xBxcf 943.0 8/21/17 16:21:43 42.9
0231322384 969.2 9/7/2017 10:36:35 SW_Abs|00000009b|090117|ye8X5 935.2 8/21/17 16:21:52 34.0
0231322410 998.5 9/7/2017 10:36:38 SW_Abs|00000009c|090117|4Sg1U 936.9 8/21/17 16:22:00 61.6
0231322430 965.7 9/7/2017 10:36:42 SW_Abs|00000010a|090117|m6DQG 941.0 8/21/17 16:22:08 24.7
0231322429 972.9 9/7/2017 10:36:46 SW_Abs|00000010b|090117|Kz2xz 935.1 8/21/17 16:22:15 37.8
0231322354 955.7 9/7/2017 10:37:20 SW_Abs|00000010c|090117|svFv6 935.1 8/21/17 16:22:21 20.6
0231322493 1006.5 9/7/2017 10:37:27 SW_Abs|00000001a|090417|ZbnL7 934.6 8/15/17 17:09:05 71.9
0231322443 1040.7 9/7/2017 10:37:35 SW_Abs|00000001b|090417|GVb0b 933.9 8/15/17 17:09:11 106.8
0231322464 1012.1 9/7/2017 10:37:39 SW_Abs|00000002a|090417|DAlWJ 932.6 8/15/17 17:09:17 79.5
0231322447 973.8 9/7/2017 10:37:47 SW_Abs|00000002b|090417|JtYrO 935.0 8/15/17 17:09:23 38.8
0231322510 1040.2 9/7/2017 10:37:55 SW_Abs|00000003a|090417|cxWdT 932.9 8/15/17 17:09:28 107.3
0231322463 1074.3 9/7/2017 10:38:17 SW_Abs|00000003b|090417|OJctK 933.9 8/15/17 17:09:34 140.4
0231322461 1004.5 9/7/2017 10:38:21 SW_Abs|00000004a|090417|2G2Cl 935.8 8/15/17 17:09:42 68.7
0231322468 963.7 9/7/2017 10:38:26 SW_Abs|00000004b|090417|8006q 936.5 8/15/17 17:09:47 27.2
0231322513 988.3 9/7/2017 10:38:31 SW_Abs|00000005a|090417|zP23h 932.6 8/15/17 17:09:53 55.7
0231322470 1043.1 9/7/2017 10:38:35 SW_Abs|00000005b|090417|ldbvB 933.3 8/15/17 17:09:59 109.8
0231322515 1025.2 9/7/2017 10:38:39 SW_Abs|00000005c|090417|4fjWS 935.6 8/15/17 17:10:12 89.6
0231322408 1026.0 9/7/2017 10:38:43 SW_Abs|00000006a|090417|bpR8I 938.8 8/15/17 17:10:24 87.2
0231322401 1014.4 9/7/2017 10:38:47 SW_Abs|00000006b|090417|8GaEB 934.7 8/15/17 17:10:37 79.7
0231322385 972.4 9/7/2017 10:38:51 SW_Abs|00000007a|090417|ybchq 936.9 8/15/17 17:10:44 35.5
0231322406 990.3 9/7/2017 10:38:55 SW_Abs|00000007b|090417|DwEiY 934.7 8/15/17 17:10:50 55.6
0231322427 983.4 9/7/2017 10:38:58 SW_Abs|00000008a|090417|L2foA 932.6 8/15/17 17:10:56 50.8
0231322409 999.5 9/7/2017 10:39:02 SW_Abs|00000008b|090417|WlJGO 936.2 8/15/17 17:11:04 63.3
0231323126 972.7 9/7/2017 10:39:06 SW_Abs|00000009a|090417|1tzfu 932.6 8/21/17 16:22:28 40.1
0231323169 1009.2 9/7/2017 10:39:10 SW_Abs|00000009b|090417|UslDO 936.0 8/21/17 16:22:33 73.2
0231323155 967.2 9/7/2017 10:39:14 SW_Abs|00000009c|090417|rRbhx 935.9 8/21/17 16:22:41 31.3
0231323125 986.0 9/7/2017 10:39:17 SW_Abs|00000010a|090417|0OjHe 935.6 8/21/17 16:22:48 50.4
0231323151 971.2 9/7/2017 10:39:21 SW_Abs|00000010b|090417|4iUnW 937.1 8/21/17 16:22:54 34.1
0231323123 969.8 9/7/2017 10:39:25 SW_Abs|00000010c|090417|l2jQs 936.3 8/21/17 16:23:03 33.5
0231322379 985.2 9/7/2017 10:39:30 SW_Abs|00000001a|090617|vdQ5q 935.4 8/15/17 17:11:10 49.8
0231322376 1028.4 9/7/2017 10:39:34 SW_Abs|00000001b|090617|IrSgE 932.3 8/15/17 17:11:15 96.1
0231322382 1017.9 9/7/2017 10:39:38 SW_Abs|00000002a|090617|Jq1oc 932.7 8/15/17 17:11:20 85.2
0231322425 994.5 9/7/2017 10:39:43 SW_Abs|00000002b|090617|FACJc 933.8 8/15/17 17:11:26 60.7
0231322360 961.6 9/7/2017 10:39:46 SW_Abs|00000003a|090617|KgXvM 937.0 8/15/17 17:11:32 24.6
0231322352 965.0 9/7/2017 10:39:50 SW_Abs|00000003b|090617|YEimc 941.1 8/15/17 17:11:38 23.9
0231322435 1047.6 9/7/2017 10:39:53 SW_Abs|00000004a|090617|kOLT7 935.8 8/15/17 17:11:46 111.8
0231322407 993.5 9/7/2017 10:39:58 SW_Abs|00000004b|090617|8JUUY 941.9 8/15/17 17:11:52 51.6
0231322386 996.4 9/7/2017 10:40:01 SW_Abs|00000005a|090617|X7Iq6 937.0 8/15/17 17:11:59 59.4
0231322387 1036.5 9/7/2017 10:40:05 SW_Abs|00000005b|090617|stEgL 935.1 8/15/17 17:12:07 101.4
0231322356 984.8 9/7/2017 10:40:09 SW_Abs|00000005c|090617|PZ18p 933.6 8/15/17 17:12:14 51.2
0231322411 987.8 9/7/2017 10:40:12 SW_Abs|00000006a|090617|OVx3O 932.9 8/15/17 17:12:21 54.9
0231322358 978.6 9/7/2017 10:40:16 SW_Abs|00000006b|090617|oZKSX 937.7 8/15/17 17:12:28 40.9
0231322404 996.4 9/7/2017 10:40:20 SW_Abs|00000007a|090617|SKa47 947.8 8/15/17 17:12:34 48.6
0231322359 971.7 9/7/2017 10:40:24 SW_Abs|00000007b|090617|MzlpK 936.9 8/15/17 17:12:40 34.8
0231322400 981.6 9/7/2017 10:40:30 SW_Abs|00000008a|090617|ZoWcN 935.3 8/15/17 17:12:49 46.3
0231322378 980.8 9/7/2017 10:40:33 SW_Abs|00000008b|090617|ru86B 934.0 8/15/17 17:12:56 46.8
0231323146 977.8 9/7/2017 10:40:37 SW_Abs|00000009a|090617|gJnIA 933.8 8/21/17 16:23:11 44.0
0231323153 976.1 9/7/2017 10:40:40 SW_Abs|00000009b|090617|Nr5zQ 932.9 8/21/17 16:23:34 43.2
0231323176 987.2 9/7/2017 10:40:45 SW_Abs|00000009c|090617|QxmFP 934.1 8/21/17 16:23:40 53.1
0231323192 965.3 9/7/2017 10:40:48 SW_Abs|00000010a|090617|3W8PU 936.2 8/21/17 16:23:46 29.1
0231323145 974.9 9/7/2017 10:40:52 SW_Abs|00000010b|090617|TuasK 934.3 8/21/17 16:23:54 40.6
0231323148 976.9 9/7/2017 10:40:56 SW_Abs|00000010c|090617|E9ejh 935.5 8/21/17 16:24:02 41.4
0231323120 1014.2 9/7/2017 10:41:00 SW_Abs|0001a-I.1|090617|rXarl 935.8 9/6/2017 13:33:29 78.4
0231323174 1053.6 9/7/2017 10:41:04 SW_Abs|0001a-I.2|090617|buTga 935.7 9/6/2017 13:33:35 117.9
0231323193 991.6 9/7/2017 10:41:14 SW_Abs|0001b-I.1|090617|95l0w 936.4 9/6/2017 13:33:43 55.2
0231323198 993.1 9/7/2017 10:41:19 SW_Abs|0001b-I.2|090617|c8b5a 933.4 9/6/2017 13:33:49 59.7
0231323202 1001.5 9/7/2017 10:41:24 SW_Abs|0002a-I.1|090617|10ced 933.7 9/6/2017 13:33:56 67.8
0231323201 1127.6 9/7/2017 10:41:28 SW_Abs|0002a-I.2|090617|IJflm 935.9 9/6/2017 13:34:04 191.7
0231323194 1040.2 9/7/2017 10:41:32 SW_Abs|0002b-I.1|090617|yzcsK 935.2 9/6/2017 13:34:12 105.0
0231323149 1031.8 9/7/2017 10:41:36 SW_Abs|0002b-I.2|090617|E1znm 933.6 9/6/2017 13:34:20 98.2
0231323203 1039.1 9/7/2017 10:41:40 SW_Abs|0003a-I.1|090617|3BLJs 945.0 9/6/2017 13:34:30 94.1
0231323129 1040.6 9/7/2017 10:41:44 SW_Abs|0003a-I.2|090617|EyPKx 940.1 9/6/2017 13:34:36 100.5
0231323121 1057.7 9/7/2017 10:41:48 SW_Abs|0003b-I.1|090617|EtpGL 936.0 9/6/2017 13:35:10 121.7
0231323127 1021.0 9/7/2017 10:41:53 SW_Abs|0003b-I.2|090617|mTU61 932.8 9/6/2017 13:35:15 88.2
0231323196 1017.5 9/7/2017 10:41:58 SW_Abs|0009a-I.1|090617|cMzRk 934.5 9/6/2017 13:35:23 83.0
0231323168 988.7 9/7/2017 10:42:02 SW_Abs|0009a-I.2|090617|Rly9M 932.2 9/6/2017 13:35:30 56.5
0231323124 991.3 9/7/2017 10:42:06 SW_Abs|0009b-I.1|090617|Y6psq 933.3 9/6/2017 13:35:35 58.0
0231323150 974.2 9/7/2017 10:42:09 SW_Abs|0009b-I.2|090617|6NAHa 944.5 9/6/2017 13:35:46 29.7
0231323178 1028.0 9/7/2017 10:42:13 SW_Abs|0009c-I.1|090617|bkgd2 932.8 9/6/2017 13:35:54 95.2
0231323173 998.7 9/7/2017 10:42:16 SW_Abs|0009c-I.2|090617|9pkBt 935.3 9/6/2017 13:35:59 63.4
0231323171 1028.7 9/7/2017 10:42:19 SW_Abs|0010a-I.1|090617|A6rDN 938.9 9/6/2017 13:36:04 89.8
0231323172 993.2 9/7/2017 10:42:23 SW_Abs|0010a-I.2|090617|kVF9O 936.5 9/6/2017 13:36:09 56.7
0231323177 985.1 9/7/2017 10:42:27 SW_Abs|0010b-I.1|090617|zusYi 944.8 9/6/2017 13:36:15 40.3
0231323197 998.7 9/7/2017 10:42:31 SW_Abs|0010b-I.2|090617|S2ljj 937.9 9/6/2017 13:36:21 60.8
0231323170 1013.0 9/7/2017 10:42:34 SW_Abs|0010c-I.1|090617|kjVnA 932.4 9/6/2017 13:36:29 80.6
0231323152 982.7 9/7/2017 10:42:37 SW_Abs|0010c-I.2|090617|YXkrk 938.3 9/6/2017 13:36:36 44.4

If you take a look at the example weight files (Example_empty_weights.txt and Example_full_weights.txt) you’ll notice that in one of the two files, I have scanned BOTH the tube barcodes that are physically on the bottoms of the matrix tubes, as well as the LabelMaker-generated barcodes (which may be printed on the labels). By containing this information in either one of the empty or full barcode files, we can patch together that information so we can then add more meaningful information about our samples to our sample masses.

Another feature of this function is that by default, samples are put into the data frame in the order provided by the file containing full weights. This way, if you weigh your samples in the order in which you add them to a rack, you will have the samples in the correct order after using this function.

To get an even better sense of where each individual tube is, we can use the plate scanner from the Cho lab to give each of our samples a location within the 96-tube rack. If you have your samples in the Matrix tubes, and within the Matrix rack, you can scan your rack and export the .csv file to be used in this same function. By adding this file to our function, we can get a data frame that also includes sample location information:

sample_weights_and_location <- mass_and_order(empty_weights = 'Example_empty_weights.txt', full_weights = 'Example_full_weights.txt', order = 'Example_matrix_plate_scan.csv', plate_name = 'Example Plate')
PlateID SampleWell TubeBarcode Full_Mass Full_Weight_Date Full_Weight_Time BarcodeID Empty_Mass Empty_Weight_Date Empty_Weight_Time SampleMass
Example Plate A01 0231322517 974.9 9/7/2017 10:34:58 SW_Abs|00000008a|083017|ZEOvr 936.2000 8/15/17 17:06:56 38.7
Example Plate A02 0231322445 998.3 9/7/2017 10:35:06 SW_Abs|00000001a|090117|kmSFB 937.1000 8/15/17 17:07:12 61.2
Example Plate A03 0231322462 968.1 9/7/2017 10:35:10 SW_Abs|00000001b|090117|vPhZA 936.1000 8/15/17 17:07:21 32.0
Example Plate A04 0231322484 1023.5 9/7/2017 10:35:17 SW_Abs|00000002a|090117|VGBO5 934.7000 8/15/17 17:07:26 88.8
Example Plate A05 0231322512 960.3 9/7/2017 10:35:21 SW_Abs|00000002b|090117|o0k9G 933.7000 8/15/17 17:07:33 26.6
Example Plate A06 0231322487 1032.0 9/7/2017 10:35:25 SW_Abs|00000003a|090117|72BP4 934.1000 8/15/17 17:07:39 97.9
Example Plate A07 0231322535 1024.4 9/7/2017 10:35:28 SW_Abs|00000003b|090117|3FTmt 943.2000 8/15/17 17:07:44 81.2
Example Plate A08 0231322508 986.2 9/7/2017 10:35:32 SW_Abs|00000004a|090117|hNGut 933.6000 8/15/17 17:07:50 52.6
Example Plate A09 0231322488 975.6 9/7/2017 10:35:36 SW_Abs|00000004b|090117|LhoYM 935.0000 8/15/17 17:07:56 40.6
Example Plate A10 0231322467 987.9 9/7/2017 10:35:42 SW_Abs|00000005a|090117|xLH85 934.3000 8/15/17 17:08:03 53.6
Example Plate A11 0231322491 1037.9 9/7/2017 10:35:46 SW_Abs|00000005b|090117|ETVjZ 935.3000 8/15/17 17:08:09 102.6
Example Plate A12 0231322519 1026.6 9/7/2017 10:35:50 SW_Abs|00000005c|090117|WRTSc 942.1000 8/15/17 17:08:14 84.5
Example Plate B01 0231322509 968.2 9/7/2017 10:35:59 SW_Abs|00000006a|090117|a5iyE 934.7000 8/15/17 17:08:23 33.5
Example Plate B02 0231322486 1013.6 9/7/2017 10:36:07 SW_Abs|00000006b|090117|8NDro 939.8000 8/15/17 17:08:32 73.8
Example Plate B03 0231322494 985.8 9/7/2017 10:36:14 SW_Abs|00000007a|090117|yrJ0D 934.6000 8/15/17 17:08:38 51.2
Example Plate B04 0231322465 1019.7 9/7/2017 10:36:18 SW_Abs|00000007b|090117|Qt8e8 936.6000 8/15/17 17:08:47 83.1
Example Plate B05 0231322471 965.5 9/7/2017 10:36:22 SW_Abs|00000008a|090117|w5Rnn 934.1000 8/15/17 17:08:53 31.4
Example Plate B06 0231322460 971.2 9/7/2017 10:36:27 SW_Abs|00000008b|090117|p4HKp 933.7000 8/15/17 17:09:00 37.5
Example Plate B07 0231322432 985.9 9/7/2017 10:36:31 SW_Abs|00000009a|090117|xBxcf 943.0000 8/21/17 16:21:43 42.9
Example Plate B08 0231322384 969.2 9/7/2017 10:36:35 SW_Abs|00000009b|090117|ye8X5 935.2000 8/21/17 16:21:52 34.0
Example Plate B09 0231322410 998.5 9/7/2017 10:36:38 SW_Abs|00000009c|090117|4Sg1U 936.9000 8/21/17 16:22:00 61.6
Example Plate B10 0231322430 965.7 9/7/2017 10:36:42 SW_Abs|00000010a|090117|m6DQG 941.0000 8/21/17 16:22:08 24.7
Example Plate B11 0231322429 972.9 9/7/2017 10:36:46 SW_Abs|00000010b|090117|Kz2xz 935.1000 8/21/17 16:22:15 37.8
Example Plate B12 0231322354 955.7 9/7/2017 10:37:20 SW_Abs|00000010c|090117|svFv6 935.1000 8/21/17 16:22:21 20.6
Example Plate C01 0231322493 1006.5 9/7/2017 10:37:27 SW_Abs|00000001a|090417|ZbnL7 934.6000 8/15/17 17:09:05 71.9
Example Plate C02 0231322443 1040.7 9/7/2017 10:37:35 SW_Abs|00000001b|090417|GVb0b 933.9000 8/15/17 17:09:11 106.8
Example Plate C03 0231322464 1012.1 9/7/2017 10:37:39 SW_Abs|00000002a|090417|DAlWJ 932.6000 8/15/17 17:09:17 79.5
Example Plate C04 0231322447 973.8 9/7/2017 10:37:47 SW_Abs|00000002b|090417|JtYrO 935.0000 8/15/17 17:09:23 38.8
Example Plate C05 0231322510 1040.2 9/7/2017 10:37:55 SW_Abs|00000003a|090417|cxWdT 932.9000 8/15/17 17:09:28 107.3
Example Plate C06 0231322463 1074.3 9/7/2017 10:38:17 SW_Abs|00000003b|090417|OJctK 933.9000 8/15/17 17:09:34 140.4
Example Plate C07 0231322461 1004.5 9/7/2017 10:38:21 SW_Abs|00000004a|090417|2G2Cl 935.8000 8/15/17 17:09:42 68.7
Example Plate C08 0231322468 963.7 9/7/2017 10:38:26 SW_Abs|00000004b|090417|8006q 936.5000 8/15/17 17:09:47 27.2
Example Plate C09 0231322513 988.3 9/7/2017 10:38:31 SW_Abs|00000005a|090417|zP23h 932.6000 8/15/17 17:09:53 55.7
Example Plate C10 0231322470 1043.1 9/7/2017 10:38:35 SW_Abs|00000005b|090417|ldbvB 933.3000 8/15/17 17:09:59 109.8
Example Plate C11 0231322515 1025.2 9/7/2017 10:38:39 SW_Abs|00000005c|090417|4fjWS 935.6000 8/15/17 17:10:12 89.6
Example Plate C12 0231322408 1026.0 9/7/2017 10:38:43 SW_Abs|00000006a|090417|bpR8I 938.8000 8/15/17 17:10:24 87.2
Example Plate D01 0231322401 1014.4 9/7/2017 10:38:47 SW_Abs|00000006b|090417|8GaEB 934.7000 8/15/17 17:10:37 79.7
Example Plate D02 0231322385 972.4 9/7/2017 10:38:51 SW_Abs|00000007a|090417|ybchq 936.9000 8/15/17 17:10:44 35.5
Example Plate D03 0231322406 990.3 9/7/2017 10:38:55 SW_Abs|00000007b|090417|DwEiY 934.7000 8/15/17 17:10:50 55.6
Example Plate D04 0231322427 983.4 9/7/2017 10:38:58 SW_Abs|00000008a|090417|L2foA 932.6000 8/15/17 17:10:56 50.8
Example Plate D05 0231322409 999.5 9/7/2017 10:39:02 SW_Abs|00000008b|090417|WlJGO 936.2000 8/15/17 17:11:04 63.3
Example Plate D06 0231323126 972.7 9/7/2017 10:39:06 SW_Abs|00000009a|090417|1tzfu 932.6000 8/21/17 16:22:28 40.1
Example Plate D07 0231323169 1009.2 9/7/2017 10:39:10 SW_Abs|00000009b|090417|UslDO 936.0000 8/21/17 16:22:33 73.2
Example Plate D08 0231323155 967.2 9/7/2017 10:39:14 SW_Abs|00000009c|090417|rRbhx 935.9000 8/21/17 16:22:41 31.3
Example Plate D09 0231323125 986.0 9/7/2017 10:39:17 SW_Abs|00000010a|090417|0OjHe 935.6000 8/21/17 16:22:48 50.4
Example Plate D10 0231323151 971.2 9/7/2017 10:39:21 SW_Abs|00000010b|090417|4iUnW 937.1000 8/21/17 16:22:54 34.1
Example Plate D11 0231323123 969.8 9/7/2017 10:39:25 SW_Abs|00000010c|090417|l2jQs 936.3000 8/21/17 16:23:03 33.5
Example Plate D12 0231322379 985.2 9/7/2017 10:39:30 SW_Abs|00000001a|090617|vdQ5q 935.4000 8/15/17 17:11:10 49.8
Example Plate E01 0231322376 1028.4 9/7/2017 10:39:34 SW_Abs|00000001b|090617|IrSgE 932.3000 8/15/17 17:11:15 96.1
Example Plate E02 0231322382 1017.9 9/7/2017 10:39:38 SW_Abs|00000002a|090617|Jq1oc 932.7000 8/15/17 17:11:20 85.2
Example Plate E03 0231322425 994.5 9/7/2017 10:39:43 SW_Abs|00000002b|090617|FACJc 933.8000 8/15/17 17:11:26 60.7
Example Plate E04 0231322360 961.6 9/7/2017 10:39:46 SW_Abs|00000003a|090617|KgXvM 937.0000 8/15/17 17:11:32 24.6
Example Plate E05 0231322352 965.0 9/7/2017 10:39:50 SW_Abs|00000003b|090617|YEimc 941.1000 8/15/17 17:11:38 23.9
Example Plate E06 0231322435 1047.6 9/7/2017 10:39:53 SW_Abs|00000004a|090617|kOLT7 935.8000 8/15/17 17:11:46 111.8
Example Plate E07 0231322407 993.5 9/7/2017 10:39:58 SW_Abs|00000004b|090617|8JUUY 941.9000 8/15/17 17:11:52 51.6
Example Plate E08 0231322386 996.4 9/7/2017 10:40:01 SW_Abs|00000005a|090617|X7Iq6 937.0000 8/15/17 17:11:59 59.4
Example Plate E09 0231322387 1036.5 9/7/2017 10:40:05 SW_Abs|00000005b|090617|stEgL 935.1000 8/15/17 17:12:07 101.4
Example Plate E10 0231322356 984.8 9/7/2017 10:40:09 SW_Abs|00000005c|090617|PZ18p 933.6000 8/15/17 17:12:14 51.2
Example Plate E11 0231322411 987.8 9/7/2017 10:40:12 SW_Abs|00000006a|090617|OVx3O 932.9000 8/15/17 17:12:21 54.9
Example Plate E12 0231322358 978.6 9/7/2017 10:40:16 SW_Abs|00000006b|090617|oZKSX 937.7000 8/15/17 17:12:28 40.9
Example Plate F01 0231322404 996.4 9/7/2017 10:40:20 SW_Abs|00000007a|090617|SKa47 947.8000 8/15/17 17:12:34 48.6
Example Plate F02 0231322359 971.7 9/7/2017 10:40:24 SW_Abs|00000007b|090617|MzlpK 936.9000 8/15/17 17:12:40 34.8
Example Plate F03 0231322400 981.6 9/7/2017 10:40:30 SW_Abs|00000008a|090617|ZoWcN 935.3000 8/15/17 17:12:49 46.3
Example Plate F04 0231322378 980.8 9/7/2017 10:40:33 SW_Abs|00000008b|090617|ru86B 934.0000 8/15/17 17:12:56 46.8
Example Plate F05 0231323146 977.8 9/7/2017 10:40:37 SW_Abs|00000009a|090617|gJnIA 933.8000 8/21/17 16:23:11 44.0
Example Plate F06 0231323153 976.1 9/7/2017 10:40:40 SW_Abs|00000009b|090617|Nr5zQ 932.9000 8/21/17 16:23:34 43.2
Example Plate F07 0231323176 987.2 9/7/2017 10:40:45 SW_Abs|00000009c|090617|QxmFP 934.1000 8/21/17 16:23:40 53.1
Example Plate F08 0231323192 965.3 9/7/2017 10:40:48 SW_Abs|00000010a|090617|3W8PU 936.2000 8/21/17 16:23:46 29.1
Example Plate F09 0231323145 974.9 9/7/2017 10:40:52 SW_Abs|00000010b|090617|TuasK 934.3000 8/21/17 16:23:54 40.6
Example Plate F10 0231323148 976.9 9/7/2017 10:40:56 SW_Abs|00000010c|090617|E9ejh 935.5000 8/21/17 16:24:02 41.4
Example Plate F11 No Tube NA NA NA NA 935.9723 NA NA
Example Plate F12 No Tube NA NA NA NA 935.9723 NA NA
Example Plate G01 0231323120 1014.2 9/7/2017 10:41:00 SW_Abs|0001a-I.1|090617|rXarl 935.8000 9/6/2017 13:33:29 78.4
Example Plate G02 0231323174 1053.6 9/7/2017 10:41:04 SW_Abs|0001a-I.2|090617|buTga 935.7000 9/6/2017 13:33:35 117.9
Example Plate G03 0231323193 991.6 9/7/2017 10:41:14 SW_Abs|0001b-I.1|090617|95l0w 936.4000 9/6/2017 13:33:43 55.2
Example Plate G04 0231323198 993.1 9/7/2017 10:41:19 SW_Abs|0001b-I.2|090617|c8b5a 933.4000 9/6/2017 13:33:49 59.7
Example Plate G05 0231323202 1001.5 9/7/2017 10:41:24 SW_Abs|0002a-I.1|090617|10ced 933.7000 9/6/2017 13:33:56 67.8
Example Plate G06 0231323201 1127.6 9/7/2017 10:41:28 SW_Abs|0002a-I.2|090617|IJflm 935.9000 9/6/2017 13:34:04 191.7
Example Plate G07 0231323194 1040.2 9/7/2017 10:41:32 SW_Abs|0002b-I.1|090617|yzcsK 935.2000 9/6/2017 13:34:12 105.0
Example Plate G08 0231323149 1031.8 9/7/2017 10:41:36 SW_Abs|0002b-I.2|090617|E1znm 933.6000 9/6/2017 13:34:20 98.2
Example Plate G09 0231323203 1039.1 9/7/2017 10:41:40 SW_Abs|0003a-I.1|090617|3BLJs 945.0000 9/6/2017 13:34:30 94.1
Example Plate G10 0231323129 1040.6 9/7/2017 10:41:44 SW_Abs|0003a-I.2|090617|EyPKx 940.1000 9/6/2017 13:34:36 100.5
Example Plate G11 0231323121 1057.7 9/7/2017 10:41:48 SW_Abs|0003b-I.1|090617|EtpGL 936.0000 9/6/2017 13:35:10 121.7
Example Plate G12 0231323127 1021.0 9/7/2017 10:41:53 SW_Abs|0003b-I.2|090617|mTU61 932.8000 9/6/2017 13:35:15 88.2
Example Plate H01 0231323196 1017.5 9/7/2017 10:41:58 SW_Abs|0009a-I.1|090617|cMzRk 934.5000 9/6/2017 13:35:23 83.0
Example Plate H02 0231323168 988.7 9/7/2017 10:42:02 SW_Abs|0009a-I.2|090617|Rly9M 932.2000 9/6/2017 13:35:30 56.5
Example Plate H03 0231323124 991.3 9/7/2017 10:42:06 SW_Abs|0009b-I.1|090617|Y6psq 933.3000 9/6/2017 13:35:35 58.0
Example Plate H04 0231323150 974.2 9/7/2017 10:42:09 SW_Abs|0009b-I.2|090617|6NAHa 944.5000 9/6/2017 13:35:46 29.7
Example Plate H05 0231323178 1028.0 9/7/2017 10:42:13 SW_Abs|0009c-I.1|090617|bkgd2 932.8000 9/6/2017 13:35:54 95.2
Example Plate H06 0231323173 998.7 9/7/2017 10:42:16 SW_Abs|0009c-I.2|090617|9pkBt 935.3000 9/6/2017 13:35:59 63.4
Example Plate H07 0231323171 1028.7 9/7/2017 10:42:19 SW_Abs|0010a-I.1|090617|A6rDN 938.9000 9/6/2017 13:36:04 89.8
Example Plate H08 0231323172 993.2 9/7/2017 10:42:23 SW_Abs|0010a-I.2|090617|kVF9O 936.5000 9/6/2017 13:36:09 56.7
Example Plate H09 0231323177 985.1 9/7/2017 10:42:27 SW_Abs|0010b-I.1|090617|zusYi 944.8000 9/6/2017 13:36:15 40.3
Example Plate H10 0231323197 998.7 9/7/2017 10:42:31 SW_Abs|0010b-I.2|090617|S2ljj 937.9000 9/6/2017 13:36:21 60.8
Example Plate H11 0231323170 1013.0 9/7/2017 10:42:34 SW_Abs|0010c-I.1|090617|kjVnA 932.4000 9/6/2017 13:36:29 80.6
Example Plate H12 0231323152 982.7 9/7/2017 10:42:37 SW_Abs|0010c-I.2|090617|YXkrk 938.3000 9/6/2017 13:36:36 44.4

If you do not provide a plate name, it will return the plate name given from the plate scanner.

Reading in files with sample information

If you have a file that contains more sample information that what is contained in the barcode, you can also read it in and join it with any other data. To do so, you can use the read_sample_info() function, which was written to be able to take in any type of tabular data (.csv OR excel), and load it into R. You can then join the data using the dplyr package join functions which should be loaded with the FaithLabTools package. It is important to note that at least one column must be shared between your sample information and the data you want to join it to - otherwise it will be impossible to combine the right information and sample.

sample_information <- read_sample_info('Example_sampleInfo.csv')

annotated_data <- left_join(sample_weights_and_location, sample_information) %>% mutate(ReaderWell = SampleWell)
PlateID SampleWell TubeBarcode Full_Mass Full_Weight_Date Full_Weight_Time BarcodeID Empty_Mass Empty_Weight_Date Empty_Weight_Time SampleMass Experiment Date Cage Animal Timepoint Sex Condition Sample Replicate ReaderWell
Example Plate A01 0231322517 974.9 9/7/2017 10:34:58 SW_Abs|00000008a|083017|ZEOvr 936.2000 8/15/17 17:06:56 38.7 SW_Abs1 30-Aug 8 8a 2 Female 1001262B+AVNC FP NA A01
Example Plate A02 0231322445 998.3 9/7/2017 10:35:06 SW_Abs|00000001a|090117|kmSFB 937.1000 8/15/17 17:07:12 61.2 SW_Abs1 31-Aug 1 1a 3 Male AS4413 FP NA A02
Example Plate A03 0231322462 968.1 9/7/2017 10:35:10 SW_Abs|00000001b|090117|vPhZA 936.1000 8/15/17 17:07:21 32.0 SW_Abs1 31-Aug 1 1b 3 Male AS4413 FP NA A03
Example Plate A04 0231322484 1023.5 9/7/2017 10:35:17 SW_Abs|00000002a|090117|VGBO5 934.7000 8/15/17 17:07:26 88.8 SW_Abs1 31-Aug 2 2a 3 Male NB71813 FP NA A04
Example Plate A05 0231322512 960.3 9/7/2017 10:35:21 SW_Abs|00000002b|090117|o0k9G 933.7000 8/15/17 17:07:33 26.6 SW_Abs1 31-Aug 2 2b 3 Male NB71813 FP NA A05
Example Plate A06 0231322487 1032.0 9/7/2017 10:35:25 SW_Abs|00000003a|090117|72BP4 934.1000 8/15/17 17:07:39 97.9 SW_Abs1 31-Aug 3 3a 3 Male GZ35-1 FP NA A06
Example Plate A07 0231322535 1024.4 9/7/2017 10:35:28 SW_Abs|00000003b|090117|3FTmt 943.2000 8/15/17 17:07:44 81.2 SW_Abs1 31-Aug 3 3b 3 Male GZ35-1 FP NA A07
Example Plate A08 0231322508 986.2 9/7/2017 10:35:32 SW_Abs|00000004a|090117|hNGut 933.6000 8/15/17 17:07:50 52.6 SW_Abs1 31-Aug 4 4a 3 Female 1001095A+1001099B FP NA A08
Example Plate A09 0231322488 975.6 9/7/2017 10:35:36 SW_Abs|00000004b|090117|LhoYM 935.0000 8/15/17 17:07:56 40.6 SW_Abs1 31-Aug 4 4b 3 Female 1001095A+1001099B FP NA A09
Example Plate A10 0231322467 987.9 9/7/2017 10:35:42 SW_Abs|00000005a|090117|xLH85 934.3000 8/15/17 17:08:03 53.6 SW_Abs1 31-Aug 5 5a 3 Male 1001095A+1001099B FP NA A10
Example Plate A11 0231322491 1037.9 9/7/2017 10:35:46 SW_Abs|00000005b|090117|ETVjZ 935.3000 8/15/17 17:08:09 102.6 SW_Abs1 31-Aug 5 5b 3 Male 1001095A+1001099B FP NA A11
Example Plate A12 0231322519 1026.6 9/7/2017 10:35:50 SW_Abs|00000005c|090117|WRTSc 942.1000 8/15/17 17:08:14 84.5 SW_Abs1 31-Aug 5 5c 3 Male 1001095A+1001099B FP NA A12
Example Plate B01 0231322509 968.2 9/7/2017 10:35:59 SW_Abs|00000006a|090117|a5iyE 934.7000 8/15/17 17:08:23 33.5 SW_Abs1 31-Aug 6 6a 3 Male 1001254A+1001262B FP NA B01
Example Plate B02 0231322486 1013.6 9/7/2017 10:36:07 SW_Abs|00000006b|090117|8NDro 939.8000 8/15/17 17:08:32 73.8 SW_Abs1 31-Aug 6 6b 3 Male 1001254A+1001262B FP NA B02
Example Plate B03 0231322494 985.8 9/7/2017 10:36:14 SW_Abs|00000007a|090117|yrJ0D 934.6000 8/15/17 17:08:38 51.2 SW_Abs1 31-Aug 7 7a 3 Male 1001099B+AVNC FP NA B03
Example Plate B04 0231322465 1019.7 9/7/2017 10:36:18 SW_Abs|00000007b|090117|Qt8e8 936.6000 8/15/17 17:08:47 83.1 SW_Abs1 31-Aug 7 7b 3 Male 1001099B+AVNC FP NA B04
Example Plate B05 0231322471 965.5 9/7/2017 10:36:22 SW_Abs|00000008a|090117|w5Rnn 934.1000 8/15/17 17:08:53 31.4 SW_Abs1 31-Aug 8 8a 3 Female 1001262B+AVNC FP NA B05
Example Plate B06 0231322460 971.2 9/7/2017 10:36:27 SW_Abs|00000008b|090117|p4HKp 933.7000 8/15/17 17:09:00 37.5 SW_Abs1 31-Aug 8 8b 3 Female 1001262B+AVNC FP NA B06
Example Plate B07 0231322432 985.9 9/7/2017 10:36:31 SW_Abs|00000009a|090117|xBxcf 943.0000 8/21/17 16:21:43 42.9 SW_Abs1 31-Aug 9 9a 7 Male Conventional FP NA B07
Example Plate B08 0231322384 969.2 9/7/2017 10:36:35 SW_Abs|00000009b|090117|ye8X5 935.2000 8/21/17 16:21:52 34.0 SW_Abs1 31-Aug 9 9b 7 Male Conventional FP NA B08
Example Plate B09 0231322410 998.5 9/7/2017 10:36:38 SW_Abs|00000009c|090117|4Sg1U 936.9000 8/21/17 16:22:00 61.6 SW_Abs1 31-Aug 9 9c 7 Male Conventional FP NA B09
Example Plate B10 0231322430 965.7 9/7/2017 10:36:42 SW_Abs|00000010a|090117|m6DQG 941.0000 8/21/17 16:22:08 24.7 SW_Abs1 31-Aug 10 10a 7 Female Conventional FP NA B10
Example Plate B11 0231322429 972.9 9/7/2017 10:36:46 SW_Abs|00000010b|090117|Kz2xz 935.1000 8/21/17 16:22:15 37.8 SW_Abs1 31-Aug 10 10b 7 Female Conventional FP NA B11
Example Plate B12 0231322354 955.7 9/7/2017 10:37:20 SW_Abs|00000010c|090117|svFv6 935.1000 8/21/17 16:22:21 20.6 SW_Abs1 31-Aug 10 10c 7 Female Conventional FP NA B12
Example Plate C01 0231322493 1006.5 9/7/2017 10:37:27 SW_Abs|00000001a|090417|ZbnL7 934.6000 8/15/17 17:09:05 71.9 SW_Abs1 5-Sep 1 1a 8 Male AS4413 FP NA C01
Example Plate C02 0231322443 1040.7 9/7/2017 10:37:35 SW_Abs|00000001b|090417|GVb0b 933.9000 8/15/17 17:09:11 106.8 SW_Abs1 5-Sep 1 1b 8 Male AS4413 FP NA C02
Example Plate C03 0231322464 1012.1 9/7/2017 10:37:39 SW_Abs|00000002a|090417|DAlWJ 932.6000 8/15/17 17:09:17 79.5 SW_Abs1 5-Sep 2 2a 8 Male NB71813 FP NA C03
Example Plate C04 0231322447 973.8 9/7/2017 10:37:47 SW_Abs|00000002b|090417|JtYrO 935.0000 8/15/17 17:09:23 38.8 SW_Abs1 5-Sep 2 2b 8 Male NB71813 FP NA C04
Example Plate C05 0231322510 1040.2 9/7/2017 10:37:55 SW_Abs|00000003a|090417|cxWdT 932.9000 8/15/17 17:09:28 107.3 SW_Abs1 5-Sep 3 3a 8 Male GZ35-1 FP NA C05
Example Plate C06 0231322463 1074.3 9/7/2017 10:38:17 SW_Abs|00000003b|090417|OJctK 933.9000 8/15/17 17:09:34 140.4 SW_Abs1 5-Sep 3 3b 8 Male GZ35-1 FP NA C06
Example Plate C07 0231322461 1004.5 9/7/2017 10:38:21 SW_Abs|00000004a|090417|2G2Cl 935.8000 8/15/17 17:09:42 68.7 SW_Abs1 5-Sep 4 4a 8 Female 1001095A+1001099B FP NA C07
Example Plate C08 0231322468 963.7 9/7/2017 10:38:26 SW_Abs|00000004b|090417|8006q 936.5000 8/15/17 17:09:47 27.2 SW_Abs1 5-Sep 4 4b 8 Female 1001095A+1001099B FP NA C08
Example Plate C09 0231322513 988.3 9/7/2017 10:38:31 SW_Abs|00000005a|090417|zP23h 932.6000 8/15/17 17:09:53 55.7 SW_Abs1 5-Sep 5 5a 8 Male 1001095A+1001099B FP NA C09
Example Plate C10 0231322470 1043.1 9/7/2017 10:38:35 SW_Abs|00000005b|090417|ldbvB 933.3000 8/15/17 17:09:59 109.8 SW_Abs1 5-Sep 5 5b 8 Male 1001095A+1001099B FP NA C10
Example Plate C11 0231322515 1025.2 9/7/2017 10:38:39 SW_Abs|00000005c|090417|4fjWS 935.6000 8/15/17 17:10:12 89.6 SW_Abs1 5-Sep 5 5c 8 Male 1001095A+1001099B FP NA C11
Example Plate C12 0231322408 1026.0 9/7/2017 10:38:43 SW_Abs|00000006a|090417|bpR8I 938.8000 8/15/17 17:10:24 87.2 SW_Abs1 5-Sep 6 6a 8 Male 1001254A+1001262B FP NA C12
Example Plate D01 0231322401 1014.4 9/7/2017 10:38:47 SW_Abs|00000006b|090417|8GaEB 934.7000 8/15/17 17:10:37 79.7 SW_Abs1 5-Sep 6 6b 8 Male 1001254A+1001262B FP NA D01
Example Plate D02 0231322385 972.4 9/7/2017 10:38:51 SW_Abs|00000007a|090417|ybchq 936.9000 8/15/17 17:10:44 35.5 SW_Abs1 5-Sep 7 7a 8 Male 1001099B_AVNC_Recovery FP NA D02
Example Plate D03 0231322406 990.3 9/7/2017 10:38:55 SW_Abs|00000007b|090417|DwEiY 934.7000 8/15/17 17:10:50 55.6 SW_Abs1 5-Sep 7 7b 8 Male 1001099B_AVNC_Recovery FP NA D03
Example Plate D04 0231322427 983.4 9/7/2017 10:38:58 SW_Abs|00000008a|090417|L2foA 932.6000 8/15/17 17:10:56 50.8 SW_Abs1 5-Sep 8 8a 8 Female 1001262B_AVNC_Recovery FP NA D04
Example Plate D05 0231322409 999.5 9/7/2017 10:39:02 SW_Abs|00000008b|090417|WlJGO 936.2000 8/15/17 17:11:04 63.3 SW_Abs1 5-Sep 8 8b 8 Female 1001262B_AVNC_Recovery FP NA D05
Example Plate D06 0231323126 972.7 9/7/2017 10:39:06 SW_Abs|00000009a|090417|1tzfu 932.6000 8/21/17 16:22:28 40.1 SW_Abs1 5-Sep 9 9a 12 Male Conventional FP NA D06
Example Plate D07 0231323169 1009.2 9/7/2017 10:39:10 SW_Abs|00000009b|090417|UslDO 936.0000 8/21/17 16:22:33 73.2 SW_Abs1 5-Sep 9 9b 12 Male Conventional FP NA D07
Example Plate D08 0231323155 967.2 9/7/2017 10:39:14 SW_Abs|00000009c|090417|rRbhx 935.9000 8/21/17 16:22:41 31.3 SW_Abs1 5-Sep 9 9c 12 Male Conventional FP NA D08
Example Plate D09 0231323125 986.0 9/7/2017 10:39:17 SW_Abs|00000010a|090417|0OjHe 935.6000 8/21/17 16:22:48 50.4 SW_Abs1 5-Sep 10 10a 12 Female Conventional FP NA D09
Example Plate D10 0231323151 971.2 9/7/2017 10:39:21 SW_Abs|00000010b|090417|4iUnW 937.1000 8/21/17 16:22:54 34.1 SW_Abs1 5-Sep 10 10b 12 Female Conventional FP NA D10
Example Plate D11 0231323123 969.8 9/7/2017 10:39:25 SW_Abs|00000010c|090417|l2jQs 936.3000 8/21/17 16:23:03 33.5 SW_Abs1 5-Sep 10 10c 12 Female Conventional FP NA D11
Example Plate D12 0231322379 985.2 9/7/2017 10:39:30 SW_Abs|00000001a|090617|vdQ5q 935.4000 8/15/17 17:11:10 49.8 SW_Abs1 6-Sep 1 1a 9 Male AS4413 FP NA D12
Example Plate E01 0231322376 1028.4 9/7/2017 10:39:34 SW_Abs|00000001b|090617|IrSgE 932.3000 8/15/17 17:11:15 96.1 SW_Abs1 6-Sep 1 1b 9 Male AS4413 FP NA E01
Example Plate E02 0231322382 1017.9 9/7/2017 10:39:38 SW_Abs|00000002a|090617|Jq1oc 932.7000 8/15/17 17:11:20 85.2 SW_Abs1 6-Sep 2 2a 9 Male NB71813 FP NA E02
Example Plate E03 0231322425 994.5 9/7/2017 10:39:43 SW_Abs|00000002b|090617|FACJc 933.8000 8/15/17 17:11:26 60.7 SW_Abs1 6-Sep 2 2b 9 Male NB71813 FP NA E03
Example Plate E04 0231322360 961.6 9/7/2017 10:39:46 SW_Abs|00000003a|090617|KgXvM 937.0000 8/15/17 17:11:32 24.6 SW_Abs1 6-Sep 3 3a 9 Male GZ35-1 FP NA E04
Example Plate E05 0231322352 965.0 9/7/2017 10:39:50 SW_Abs|00000003b|090617|YEimc 941.1000 8/15/17 17:11:38 23.9 SW_Abs1 6-Sep 3 3b 9 Male GZ35-1 FP NA E05
Example Plate E06 0231322435 1047.6 9/7/2017 10:39:53 SW_Abs|00000004a|090617|kOLT7 935.8000 8/15/17 17:11:46 111.8 SW_Abs1 6-Sep 4 4a 9 Female 1001095A+1001099B FP NA E06
Example Plate E07 0231322407 993.5 9/7/2017 10:39:58 SW_Abs|00000004b|090617|8JUUY 941.9000 8/15/17 17:11:52 51.6 SW_Abs1 6-Sep 4 4b 9 Female 1001095A+1001099B FP NA E07
Example Plate E08 0231322386 996.4 9/7/2017 10:40:01 SW_Abs|00000005a|090617|X7Iq6 937.0000 8/15/17 17:11:59 59.4 SW_Abs1 6-Sep 5 5a 9 Male 1001095A+1001099B FP NA E08
Example Plate E09 0231322387 1036.5 9/7/2017 10:40:05 SW_Abs|00000005b|090617|stEgL 935.1000 8/15/17 17:12:07 101.4 SW_Abs1 6-Sep 5 5b 9 Male 1001095A+1001099B FP NA E09
Example Plate E10 0231322356 984.8 9/7/2017 10:40:09 SW_Abs|00000005c|090617|PZ18p 933.6000 8/15/17 17:12:14 51.2 SW_Abs1 6-Sep 5 5c 9 Male 1001095A+1001099B FP NA E10
Example Plate E11 0231322411 987.8 9/7/2017 10:40:12 SW_Abs|00000006a|090617|OVx3O 932.9000 8/15/17 17:12:21 54.9 SW_Abs1 6-Sep 6 6a 9 Male 1001254A+1001262B FP NA E11
Example Plate E12 0231322358 978.6 9/7/2017 10:40:16 SW_Abs|00000006b|090617|oZKSX 937.7000 8/15/17 17:12:28 40.9 SW_Abs1 6-Sep 6 6b 9 Male 1001254A+1001262B FP NA E12
Example Plate F01 0231322404 996.4 9/7/2017 10:40:20 SW_Abs|00000007a|090617|SKa47 947.8000 8/15/17 17:12:34 48.6 SW_Abs1 6-Sep 7 7a 9 Male 1001099B_AVNC_Recovery FP NA F01
Example Plate F02 0231322359 971.7 9/7/2017 10:40:24 SW_Abs|00000007b|090617|MzlpK 936.9000 8/15/17 17:12:40 34.8 SW_Abs1 6-Sep 7 7b 9 Male 1001099B_AVNC_Recovery FP NA F02
Example Plate F03 0231322400 981.6 9/7/2017 10:40:30 SW_Abs|00000008a|090617|ZoWcN 935.3000 8/15/17 17:12:49 46.3 SW_Abs1 6-Sep 8 8a 9 Female 1001262B_AVNC_Recovery FP NA F03
Example Plate F04 0231322378 980.8 9/7/2017 10:40:33 SW_Abs|00000008b|090617|ru86B 934.0000 8/15/17 17:12:56 46.8 SW_Abs1 6-Sep 8 8b 9 Female 1001262B_AVNC_Recovery FP NA F04
Example Plate F05 0231323146 977.8 9/7/2017 10:40:37 SW_Abs|00000009a|090617|gJnIA 933.8000 8/21/17 16:23:11 44.0 SW_Abs1 6-Sep 9 9a 13 Male Conventional FP NA F05
Example Plate F06 0231323153 976.1 9/7/2017 10:40:40 SW_Abs|00000009b|090617|Nr5zQ 932.9000 8/21/17 16:23:34 43.2 SW_Abs1 6-Sep 9 9b 13 Male Conventional FP NA F06
Example Plate F07 0231323176 987.2 9/7/2017 10:40:45 SW_Abs|00000009c|090617|QxmFP 934.1000 8/21/17 16:23:40 53.1 SW_Abs1 6-Sep 9 9c 13 Male Conventional FP NA F07
Example Plate F08 0231323192 965.3 9/7/2017 10:40:48 SW_Abs|00000010a|090617|3W8PU 936.2000 8/21/17 16:23:46 29.1 SW_Abs1 6-Sep 10 10a 13 Female Conventional FP NA F08
Example Plate F09 0231323145 974.9 9/7/2017 10:40:52 SW_Abs|00000010b|090617|TuasK 934.3000 8/21/17 16:23:54 40.6 SW_Abs1 6-Sep 10 10b 13 Female Conventional FP NA F09
Example Plate F10 0231323148 976.9 9/7/2017 10:40:56 SW_Abs|00000010c|090617|E9ejh 935.5000 8/21/17 16:24:02 41.4 SW_Abs1 6-Sep 10 10c 13 Female Conventional FP NA F10
Example Plate F11 No Tube NA NA NA NA 935.9723 NA NA NA NA NA NA NA NA NA NA NA F11
Example Plate F12 No Tube NA NA NA NA 935.9723 NA NA NA NA NA NA NA NA NA NA NA F12
Example Plate G01 0231323120 1014.2 9/7/2017 10:41:00 SW_Abs|0001a-I.1|090617|rXarl 935.8000 9/6/2017 13:33:29 78.4 SW_Abs1 6-Sep 1 1a 9 Male AS4413 Ileum 1 G01
Example Plate G02 0231323174 1053.6 9/7/2017 10:41:04 SW_Abs|0001a-I.2|090617|buTga 935.7000 9/6/2017 13:33:35 117.9 SW_Abs1 6-Sep 1 1a 9 Male AS4413 Ileum 2 G02
Example Plate G03 0231323193 991.6 9/7/2017 10:41:14 SW_Abs|0001b-I.1|090617|95l0w 936.4000 9/6/2017 13:33:43 55.2 SW_Abs1 6-Sep 1 1b 9 Male AS4413 Ileum 1 G03
Example Plate G04 0231323198 993.1 9/7/2017 10:41:19 SW_Abs|0001b-I.2|090617|c8b5a 933.4000 9/6/2017 13:33:49 59.7 SW_Abs1 6-Sep 1 1b 9 Male AS4413 Ileum 2 G04
Example Plate G05 0231323202 1001.5 9/7/2017 10:41:24 SW_Abs|0002a-I.1|090617|10ced 933.7000 9/6/2017 13:33:56 67.8 SW_Abs1 6-Sep 2 2a 9 Male NB71813 Ileum 1 G05
Example Plate G06 0231323201 1127.6 9/7/2017 10:41:28 SW_Abs|0002a-I.2|090617|IJflm 935.9000 9/6/2017 13:34:04 191.7 SW_Abs1 6-Sep 2 2a 9 Male NB71813 Ileum 2 G06
Example Plate G07 0231323194 1040.2 9/7/2017 10:41:32 SW_Abs|0002b-I.1|090617|yzcsK 935.2000 9/6/2017 13:34:12 105.0 SW_Abs1 6-Sep 2 2b 9 Male NB71813 Ileum 1 G07
Example Plate G08 0231323149 1031.8 9/7/2017 10:41:36 SW_Abs|0002b-I.2|090617|E1znm 933.6000 9/6/2017 13:34:20 98.2 SW_Abs1 6-Sep 2 2b 9 Male NB71813 Ileum 2 G08
Example Plate G09 0231323203 1039.1 9/7/2017 10:41:40 SW_Abs|0003a-I.1|090617|3BLJs 945.0000 9/6/2017 13:34:30 94.1 SW_Abs1 6-Sep 3 3a 9 Male GZ35-1 Ileum 1 G09
Example Plate G10 0231323129 1040.6 9/7/2017 10:41:44 SW_Abs|0003a-I.2|090617|EyPKx 940.1000 9/6/2017 13:34:36 100.5 SW_Abs1 6-Sep 3 3a 9 Male GZ35-1 Ileum 2 G10
Example Plate G11 0231323121 1057.7 9/7/2017 10:41:48 SW_Abs|0003b-I.1|090617|EtpGL 936.0000 9/6/2017 13:35:10 121.7 SW_Abs1 6-Sep 3 3b 9 Male GZ35-1 Ileum 1 G11
Example Plate G12 0231323127 1021.0 9/7/2017 10:41:53 SW_Abs|0003b-I.2|090617|mTU61 932.8000 9/6/2017 13:35:15 88.2 SW_Abs1 6-Sep 3 3b 9 Male GZ35-1 Ileum 2 G12
Example Plate H01 0231323196 1017.5 9/7/2017 10:41:58 SW_Abs|0009a-I.1|090617|cMzRk 934.5000 9/6/2017 13:35:23 83.0 SW_Abs1 6-Sep 9 9a 13 Male Conventional Ileum 1 H01
Example Plate H02 0231323168 988.7 9/7/2017 10:42:02 SW_Abs|0009a-I.2|090617|Rly9M 932.2000 9/6/2017 13:35:30 56.5 SW_Abs1 6-Sep 9 9a 13 Male Conventional Ileum 2 H02
Example Plate H03 0231323124 991.3 9/7/2017 10:42:06 SW_Abs|0009b-I.1|090617|Y6psq 933.3000 9/6/2017 13:35:35 58.0 SW_Abs1 6-Sep 9 9b 13 Male Conventional Ileum 1 H03
Example Plate H04 0231323150 974.2 9/7/2017 10:42:09 SW_Abs|0009b-I.2|090617|6NAHa 944.5000 9/6/2017 13:35:46 29.7 SW_Abs1 6-Sep 9 9b 13 Male Conventional Ileum 2 H04
Example Plate H05 0231323178 1028.0 9/7/2017 10:42:13 SW_Abs|0009c-I.1|090617|bkgd2 932.8000 9/6/2017 13:35:54 95.2 SW_Abs1 6-Sep 9 9c 13 Male Conventional Ileum 1 H05
Example Plate H06 0231323173 998.7 9/7/2017 10:42:16 SW_Abs|0009c-I.2|090617|9pkBt 935.3000 9/6/2017 13:35:59 63.4 SW_Abs1 6-Sep 9 9c 13 Male Conventional Ileum 2 H06
Example Plate H07 0231323171 1028.7 9/7/2017 10:42:19 SW_Abs|0010a-I.1|090617|A6rDN 938.9000 9/6/2017 13:36:04 89.8 SW_Abs1 6-Sep 10 10a 13 Female Conventional Ileum 1 H07
Example Plate H08 0231323172 993.2 9/7/2017 10:42:23 SW_Abs|0010a-I.2|090617|kVF9O 936.5000 9/6/2017 13:36:09 56.7 SW_Abs1 6-Sep 10 10a 13 Female Conventional Ileum 2 H08
Example Plate H09 0231323177 985.1 9/7/2017 10:42:27 SW_Abs|0010b-I.1|090617|zusYi 944.8000 9/6/2017 13:36:15 40.3 SW_Abs1 6-Sep 10 10b 13 Female Conventional Ileum 1 H09
Example Plate H10 0231323197 998.7 9/7/2017 10:42:31 SW_Abs|0010b-I.2|090617|S2ljj 937.9000 9/6/2017 13:36:21 60.8 SW_Abs1 6-Sep 10 10b 13 Female Conventional Ileum 2 H10
Example Plate H11 0231323170 1013.0 9/7/2017 10:42:34 SW_Abs|0010c-I.1|090617|kjVnA 932.4000 9/6/2017 13:36:29 80.6 SW_Abs1 6-Sep 10 10c 13 Female Conventional Ileum 1 H11
Example Plate H12 0231323152 982.7 9/7/2017 10:42:37 SW_Abs|0010c-I.2|090617|YXkrk 938.3000 9/6/2017 13:36:36 44.4 SW_Abs1 6-Sep 10 10c 13 Female Conventional Ileum 2 H12

This data can now be used to join with other data sources and to plot data according to any number of variables included in the sample information.

Reading plate reader files

Whether you are using the plate reader to read an ELISA or DNA concentrations, you can use the general read_plate() function. The function is intended to read files from the plate reader directly (the raw excel file that it produces), and expects that the plate reader only makes one measurement per well:

plate_reader_data <- read_plate(plate_reader_file = 'Example_BR_raw.xlsx', plate_name = 'Example Plate')
#> New names:
#> * `` -> `..1`
#> * `` -> `..2`
#> * `` -> `..3`
#> * `` -> `..4`
#> * `` -> `..5`
#> * … and 10 more
ReaderPlate ReaderWell Measurement
Example Plate A01 58
Example Plate A02 194
Example Plate A03 103
Example Plate A04 349
Example Plate A05 86
Example Plate A06 474
Example Plate A07 302
Example Plate A08 476
Example Plate A09 377
Example Plate A10 1636
Example Plate A11 1443
Example Plate A12 1151
Example Plate B01 592
Example Plate B02 1773
Example Plate B03 124
Example Plate B04 213
Example Plate B05 70
Example Plate B06 87
Example Plate B07 1225
Example Plate B08 422
Example Plate B09 687
Example Plate B10 173
Example Plate B11 210
Example Plate B12 244
Example Plate C01 388
Example Plate C02 398
Example Plate C03 446
Example Plate C04 202
Example Plate C05 124
Example Plate C06 92
Example Plate C07 515
Example Plate C08 342
Example Plate C09 451
Example Plate C10 1127
Example Plate C11 1512
Example Plate C12 1476
Example Plate D01 1409
Example Plate D02 345
Example Plate D03 620
Example Plate D04 229
Example Plate D05 335
Example Plate D06 618
Example Plate D07 1058
Example Plate D08 411
Example Plate D09 635
Example Plate D10 380
Example Plate D11 394
Example Plate D12 250
Example Plate E01 434
Example Plate E02 503
Example Plate E03 254
Example Plate E04 157
Example Plate E05 208
Example Plate E06 1026
Example Plate E07 824
Example Plate E08 903
Example Plate E09 528
Example Plate E10 469
Example Plate E11 1752
Example Plate E12 1262
Example Plate F01 689
Example Plate F02 1263
Example Plate F03 1780
Example Plate F04 693
Example Plate F05 914
Example Plate F06 794
Example Plate F07 1258
Example Plate F08 307
Example Plate F09 1012
Example Plate F10 799
Example Plate F11 37
Example Plate F12 40
Example Plate G01 771
Example Plate G02 148
Example Plate G03 103
Example Plate G04 617
Example Plate G05 81
Example Plate G06 153
Example Plate G07 76
Example Plate G08 478
Example Plate G09 573
Example Plate G10 58
Example Plate G11 267
Example Plate G12 74
Example Plate H01 90
Example Plate H02 1118
Example Plate H03 366
Example Plate H04 555
Example Plate H05 752
Example Plate H06 945
Example Plate H07 124
Example Plate H08 270
Example Plate H09 975
Example Plate H10 68
Example Plate H11 115
Example Plate H12 889

The function also allows you to specify if you are using a 384-well plate by changing the size parameter, but I haven’t worked much with 384-well plates and the plate reader so it isn’t as well tested as using a 96-well plate.

Measuring DNA concentrations

For the specific case of measuring DNA concentrations using the qubit dyes (HS or BR), I’ve put together a function that will read in the plate reader file, compute a standard curve, and generate DNA concentrations for each sample. The measure_dna_concentration() function requires a lot more inputs than the previous ones, so I will describe them more in full:

  • plate_reader_file - path to the raw file from the plate reader
  • standards_plate_reader_file - path to the raw file from the plate reader that contains the standards information. If the standards are on the same plate that you want to measure, you can leave this out, since it defaults to the plate_reader_file.
  • standard_wells - a vector of the wells that contain the standards, in increasing concentration order. These need to be in the 2-digit format (e.g. “A01”, “B07”, and NOT “A1”, “B7”).
  • dye_used - specify whether you measured DNA with the HS or BR dye. Must be wrapped in quotes.
  • qubit_volume - indicate how much DNA was used to measure the DNA (default = 2 uL)
  • elution_volume - indicate how much EB was used to elute the DNA (default = 100 uL)
  • plate_size - indicate plate size (default = 96, and honestly I haven’t tried 384)
  • plate_name - a name for the plate, similar to examples above
  • print_standard_curve - TRUE or FALSE to indicate whether or not to print a plot of the standard curve
sample_HS_dna <- measure_dna_concentration(plate_reader_file = 'Example_HS_raw.xlsx', standards_plate_reader_file = 'Example_standards_raw.xlsx', standard_wells = c("A01", "A02", "A03", "A04", "A05", "A06", "A07", "A08"), dye_used = "HS", qubit_volume = 2, elution_volume = 100, plate_size = 96, plate_name = 'Example Plate', print_standard_curve = TRUE)
sample_BR_dna <- measure_dna_concentration(plate_reader_file = 'Example_BR_raw.xlsx', standards_plate_reader_file = 'Example_standards_raw.xlsx', standard_wells = c("B01", "B02", "B03", "B04", "B05", "B06", "B07", "B08"), dye_used = "BR", qubit_volume = 2, elution_volume = 100, plate_size = 96, plate_name = 'Example Plate', print_standard_curve = TRUE)

The output of these functions looks like:

ReaderPlate ReaderWell Measurement Qubit_Volume DNA_Concentration Elution_Volume Total_DNA
Example Plate A01 58 2 -2.7590202 100 -0.2759020
Example Plate A02 194 2 6.4977908 100 0.6497791
Example Plate A03 103 2 0.3038952 100 0.0303895
Example Plate A04 349 2 17.0478328 100 1.7047833
Example Plate A05 86 2 -0.8532062 100 -0.0853206
Example Plate A06 474 2 25.5559311 100 2.5555931
Example Plate A07 302 2 13.8487878 100 1.3848788
Example Plate A08 476 2 25.6920607 100 2.5692061
Example Plate A09 377 2 18.9536468 100 1.8953647
Example Plate A10 1636 2 104.6472136 100 10.4647214
Example Plate A11 1443 2 91.5107097 100 9.1510710
Example Plate A12 1151 2 71.6357919 100 7.1635792
Example Plate B01 592 2 33.5875760 100 3.3587576
Example Plate B02 1773 2 113.9720894 100 11.3972089
Example Plate B03 124 2 1.7332557 100 0.1733256
Example Plate B04 213 2 7.7910217 100 0.7791022
Example Plate B05 70 2 -1.9422428 100 -0.1942243
Example Plate B06 87 2 -0.7851414 100 -0.0785141
Example Plate B07 1225 2 76.6725862 100 7.6672586
Example Plate B08 422 2 22.0165622 100 2.2016562
Example Plate B09 687 2 40.0537308 100 4.0053731
Example Plate B10 173 2 5.0684303 100 0.5068430
Example Plate B11 210 2 7.5868274 100 0.7586827
Example Plate B12 244 2 9.9010301 100 0.9901030
Example Plate C01 388 2 19.7023595 100 1.9702359
Example Plate C02 398 2 20.3830073 100 2.0383007
Example Plate C03 446 2 23.6501171 100 2.3650117
Example Plate C04 202 2 7.0423091 100 0.7042309
Example Plate C05 124 2 1.7332557 100 0.1733256
Example Plate C06 92 2 -0.4448175 100 -0.0444817
Example Plate C07 515 2 28.3465874 100 2.8346587
Example Plate C08 342 2 16.5713793 100 1.6571379
Example Plate C09 451 2 23.9904410 100 2.3990441
Example Plate C10 1127 2 70.0022370 100 7.0002237
Example Plate C11 1512 2 96.2071800 100 9.6207180
Example Plate C12 1476 2 93.7568477 100 9.3756848
Example Plate D01 1409 2 89.1965070 100 8.9196507
Example Plate D02 345 2 16.7755736 100 1.6775574
Example Plate D03 620 2 35.4933900 100 3.5493390
Example Plate D04 229 2 8.8800583 100 0.8880058
Example Plate D05 335 2 16.0949257 100 1.6094926
Example Plate D06 618 2 35.3572605 100 3.5357260
Example Plate D07 1058 2 65.3057667 100 6.5305767
Example Plate D08 411 2 21.2678496 100 2.1267850
Example Plate D09 635 2 36.5143618 100 3.6514362
Example Plate D10 380 2 19.1578412 100 1.9157841
Example Plate D11 394 2 20.1107482 100 2.0110748
Example Plate D12 250 2 10.3094189 100 1.0309419
Example Plate E01 434 2 22.8333397 100 2.2833340
Example Plate E02 503 2 27.5298100 100 2.7529810
Example Plate E03 254 2 10.5816780 100 1.0581678
Example Plate E04 157 2 3.9793937 100 0.3979394
Example Plate E05 208 2 7.4506978 100 0.7450698
Example Plate E06 1026 2 63.1276936 100 6.3127694
Example Plate E07 824 2 49.3786066 100 4.9378607
Example Plate E08 903 2 54.7557248 100 5.4755725
Example Plate E09 528 2 29.2314296 100 2.9231430
Example Plate E10 469 2 25.2156072 100 2.5215607
Example Plate E11 1752 2 112.5427289 100 11.2542729
Example Plate E12 1262 2 79.1909833 100 7.9190983
Example Plate F01 689 2 40.1898603 100 4.0189860
Example Plate F02 1263 2 79.2590481 100 7.9259048
Example Plate F03 1780 2 114.4485430 100 11.4448543
Example Plate F04 693 2 40.4621195 100 4.0462119
Example Plate F05 914 2 55.5044374 100 5.5504437
Example Plate F06 794 2 47.3366630 100 4.7336663
Example Plate F07 1258 2 78.9187241 100 7.8918724
Example Plate F08 307 2 14.1891117 100 1.4189112
Example Plate F09 1012 2 62.1747865 100 6.2174787
Example Plate F10 799 2 47.6769869 100 4.7676987
Example Plate F11 37 2 -4.1883808 100 -0.4188381
Example Plate F12 40 2 -3.9841864 100 -0.3984186
Example Plate G01 771 2 45.7711729 100 4.5771173
Example Plate G02 148 2 3.3668106 100 0.3366811
Example Plate G03 103 2 0.3038952 100 0.0303895
Example Plate G04 617 2 35.2891957 100 3.5289196
Example Plate G05 81 2 -1.1935301 100 -0.1193530
Example Plate G06 153 2 3.7071345 100 0.3707135
Example Plate G07 76 2 -1.5338541 100 -0.1533854
Example Plate G08 478 2 25.8281903 100 2.5828190
Example Plate G09 573 2 32.2943451 100 3.2294345
Example Plate G10 58 2 -2.7590202 100 -0.2759020
Example Plate G11 267 2 11.4665202 100 1.1466520
Example Plate G12 74 2 -1.6699837 100 -0.1669984
Example Plate H01 90 2 -0.5809471 100 -0.0580947
Example Plate H02 1118 2 69.3896540 100 6.9389654
Example Plate H03 366 2 18.2049341 100 1.8204934
Example Plate H04 555 2 31.0691789 100 3.1069179
Example Plate H05 752 2 44.4779419 100 4.4477942
Example Plate H06 945 2 57.6144458 100 5.7614446
Example Plate H07 124 2 1.7332557 100 0.1733256
Example Plate H08 270 2 11.6707146 100 1.1670715
Example Plate H09 975 2 59.6563894 100 5.9656389
Example Plate H10 68 2 -2.0783724 100 -0.2078372
Example Plate H11 115 2 1.1206726 100 0.1120673
Example Plate H12 889 2 53.8028177 100 5.3802818

If you are measuring the same sample with both the BR and HS dyes, you may want to combine the data from these two measurements. As in the example above, it is not uncommon for samples with low concentration of DNA to produce negative values if you measure only with the BR dye (e.g. sample in well A01 above). The qubit_merger() function helps stitch together measurements of samples with both dyes by selecting the DNA concentration according to the following rules:

  • If the HS DNA concentration is less than 75 ng/uL and the BR DNA concentration is less than 50 ng/uL, use the HS DNA concentration.
  • If the HS concentration is greater than 75 ng/uL and the BR DNA concentration is greater than 50 ng/uL, use the BR DNA concentration.
  • For all other cases, average the HS and BR DNA concentrations.

By doing this, we try to keep the DNA concentration measurements in the more reliable ranges of the Qubit dyes.

sample_dna_combined <- qubit_merger(hs_data = sample_HS_dna, br_data = sample_BR_dna) %>% mutate(PlateID = 'Example Plate', SampleWell = ReaderWell)

This produces a data table that contains both of the individual measured concentrations and the “final” concentration:

ReaderWell Elution_Volume HS_Measurement HS_dna_concentration BR_Measurement BR_dna_concentration DNA_Concentration Qubit_Dye_Used Total_DNA PlateID SampleWell
A01 100 300 2.0551490 58 -2.7590202 2.0551490 HS 0.2055149 Example Plate A01
A02 100 2257 17.1812908 194 6.4977908 17.1812908 HS 1.7181291 Example Plate A02
A03 100 922 6.8627423 103 0.3038952 6.8627423 HS 0.6862742 Example Plate A03
A04 100 4862 37.3159864 349 17.0478328 37.3159864 HS 3.7315986 Example Plate A04
A05 100 865 6.4221751 86 -0.8532062 6.4221751 HS 0.6422175 Example Plate A05
A06 100 5263 40.4154156 474 25.5559311 40.4154156 HS 4.0415416 Example Plate A06
A07 100 3762 28.8138117 302 13.8487878 28.8138117 HS 2.8813812 Example Plate A07
A08 100 5775 44.3727915 476 25.6920607 44.3727915 HS 4.4372791 Example Plate A08
A09 100 4570 35.0590455 377 18.9536468 35.0590455 HS 3.5059045 Example Plate A09
A10 100 8750 67.3673095 1636 104.6472136 86.0072616 Average 8.6007262 Example Plate A10
A11 100 8484 65.3113291 1443 91.5107097 78.4110194 Average 7.8411019 Example Plate A11
A12 100 7947 61.1607220 1151 71.6357919 66.3982570 Average 6.6398257 Example Plate A12
B01 100 4437 34.0310553 592 33.5875760 34.0310553 HS 3.4031055 Example Plate B01
B02 100 9663 74.4241146 1773 113.9720894 94.1981020 Average 9.4198102 Example Plate B02
B03 100 1137 8.5245310 124 1.7332557 8.5245310 HS 0.8524531 Example Plate B03
B04 100 2380 18.1319885 213 7.7910217 18.1319885 HS 1.8131988 Example Plate B04
B05 100 179 1.1199097 70 -1.9422428 1.1199097 HS 0.1119910 Example Plate B05
B06 100 297 2.0319612 87 -0.7851414 2.0319612 HS 0.2031961 Example Plate B06
B07 100 5690 43.7158052 1225 76.6725862 60.1941957 Average 6.0194196 Example Plate B07
B08 100 4130 31.6581756 422 22.0165622 31.6581756 HS 3.1658176 Example Plate B08
B09 100 4974 38.1816624 687 40.0537308 38.1816624 HS 3.8181662 Example Plate B09
B10 100 1461 11.0288079 173 5.0684303 11.0288079 HS 1.1028808 Example Plate B10
B11 100 1938 14.7156601 210 7.5868274 14.7156601 HS 1.4715660 Example Plate B11
B12 100 1489 11.2452269 244 9.9010301 11.2452269 HS 1.1245227 Example Plate B12
C01 100 4358 33.4204445 388 19.7023595 33.4204445 HS 3.3420445 Example Plate C01
C02 100 5231 40.1680796 398 20.3830073 40.1680796 HS 4.0168080 Example Plate C02
C03 100 5163 39.6424906 446 23.6501171 39.6424906 HS 3.9642491 Example Plate C03
C04 100 2695 20.5667022 202 7.0423091 20.5667022 HS 2.0566702 Example Plate C04
C05 100 901 6.7004281 124 1.7332557 6.7004281 HS 0.6700428 Example Plate C05
C06 100 976 7.2801218 92 -0.4448175 7.2801218 HS 0.7280122 Example Plate C06
C07 100 5921 45.5012619 515 28.3465874 45.5012619 HS 4.5501262 Example Plate C07
C08 100 2125 16.1610298 342 16.5713793 16.1610298 HS 1.6161030 Example Plate C08
C09 100 4769 36.5971662 451 23.9904410 36.5971662 HS 3.6597166 Example Plate C09
C10 100 7379 56.7705081 1127 70.0022370 63.3863726 Average 6.3386373 Example Plate C10
C11 100 7982 61.4312457 1512 96.2071800 78.8192129 Average 7.8819213 Example Plate C11
C12 100 8548 65.8060011 1476 93.7568477 79.7814244 Average 7.9781424 Example Plate C12
D01 100 9261 71.3169562 1409 89.1965070 80.2567316 Average 8.0256732 Example Plate D01
D02 100 4122 31.5963416 345 16.7755736 31.5963416 HS 3.1596342 Example Plate D02
D03 100 6361 48.9021318 620 35.4933900 48.9021318 HS 4.8902132 Example Plate D03
D04 100 2594 19.7860479 229 8.8800583 19.7860479 HS 1.9786048 Example Plate D04
D05 100 3597 27.5384855 335 16.0949257 27.5384855 HS 2.7538485 Example Plate D05
D06 100 6259 48.1137484 618 35.3572605 48.1137484 HS 4.8113748 Example Plate D06
D07 100 8214 63.2244317 1058 65.3057667 64.2650992 Average 6.4265099 Example Plate D07
D08 100 4084 31.3026301 411 21.2678496 31.3026301 HS 3.1302630 Example Plate D08
D09 100 6464 49.6982446 635 36.5143618 49.6982446 HS 4.9698245 Example Plate D09
D10 100 4223 32.3769958 380 19.1578412 32.3769958 HS 3.2376996 Example Plate D10
D11 100 3960 30.3442031 394 20.1107482 30.3442031 HS 3.0344203 Example Plate D11
D12 100 3262 24.9491868 250 10.3094189 24.9491868 HS 2.4949187 Example Plate D12
E01 100 5386 41.3661133 434 22.8333397 41.3661133 HS 4.1366113 Example Plate E01
E02 100 6671 51.2981993 503 27.5298100 51.2981993 HS 5.1298199 Example Plate E02
E03 100 4073 31.2176083 254 10.5816780 31.2176083 HS 3.1217608 Example Plate E03
E04 100 1427 10.7660134 157 3.9793937 10.7660134 HS 1.0766013 Example Plate E04
E05 100 1479 11.1679344 208 7.4506978 11.1679344 HS 1.1167934 Example Plate E05
E06 100 8228 63.3326412 1026 63.1276936 63.2301674 Average 6.3230167 Example Plate E06
E07 100 7039 54.1425632 824 49.3786066 54.1425632 HS 5.4142563 Example Plate E07
E08 100 7907 60.8515520 903 54.7557248 57.8036384 Average 5.7803638 Example Plate E08
E09 100 5600 43.0201728 528 29.2314296 43.0201728 HS 4.3020173 Example Plate E09
E10 100 5153 39.5651981 469 25.2156072 39.5651981 HS 3.9565198 Example Plate E10
E11 100 8393 64.6079674 1752 112.5427289 88.5753481 Average 8.8575348 Example Plate E11
E12 100 8170 62.8843447 1262 79.1909833 71.0376640 Average 7.1037664 Example Plate E12
F01 100 5817 44.6974200 689 40.1898603 44.6974200 HS 4.4697420 Example Plate F01
F02 100 6912 53.1609485 1263 79.2590481 66.2099983 Average 6.6209998 Example Plate F02
F03 100 8769 67.5141653 1780 114.4485430 90.9813541 Average 9.0981354 Example Plate F03
F04 100 3384 25.8921553 693 40.4621195 25.8921553 HS 2.5892155 Example Plate F04
F05 100 7156 55.0468854 914 55.5044374 55.2756614 Average 5.5275661 Example Plate F05
F06 100 5788 44.4732717 794 47.3366630 44.4732717 HS 4.4473272 Example Plate F06
F07 100 8180 62.9616372 1258 78.9187241 70.9401807 Average 7.0940181 Example Plate F07
F08 100 3052 23.3260443 307 14.1891117 23.3260443 HS 2.3326044 Example Plate F08
F09 100 7615 58.5946110 1012 62.1747865 60.3846988 Average 6.0384699 Example Plate F09
F10 100 6587 50.6489423 799 47.6769869 50.6489423 HS 5.0648942 Example Plate F10
F11 100 19 -0.1167702 37 -4.1883808 -0.1167702 HS -0.0116770 Example Plate F11
F12 100 17 -0.1322287 40 -3.9841864 -0.1322287 HS -0.0132229 Example Plate F12
G01 100 7057 54.2816897 771 45.7711729 54.2816897 HS 5.4281690 Example Plate G01
G02 100 3349 25.6216315 148 3.3668106 25.6216315 HS 2.5621632 Example Plate G02
G03 100 707 5.2009536 103 0.3038952 5.2009536 HS 0.5200954 Example Plate G03
G04 100 5957 45.7795149 617 35.2891957 45.7795149 HS 4.5779515 Example Plate G04
G05 100 749 5.5255821 81 -1.1935301 5.5255821 HS 0.5525582 Example Plate G05
G06 100 3487 26.6882680 153 3.7071345 26.6882680 HS 2.6688268 Example Plate G06
G07 100 2574 19.6314629 76 -1.5338541 19.6314629 HS 1.9631463 Example Plate G07
G08 100 5118 39.2946744 478 25.8281903 39.2946744 HS 3.9294674 Example Plate G08
G09 100 5294 40.6550223 573 32.2943451 40.6550223 HS 4.0655022 Example Plate G09
G10 100 1371 10.3331755 58 -2.7590202 10.3331755 HS 1.0333175 Example Plate G10
G11 100 3613 27.6621535 267 11.4665202 27.6621535 HS 2.7662153 Example Plate G11
G12 100 749 5.5255821 74 -1.6699837 5.5255821 HS 0.5525582 Example Plate G12
H01 100 3823 29.2852959 90 -0.5809471 29.2852959 HS 2.9285296 Example Plate H01
H02 100 6348 48.8016516 1118 69.3896540 59.0956528 Average 5.9095653 Example Plate H02
H03 100 4361 33.4436323 366 18.2049341 33.4436323 HS 3.3443632 Example Plate H03
H04 100 3729 28.5587464 555 31.0691789 28.5587464 HS 2.8558746 Example Plate H04
H05 100 4473 34.3093083 752 44.4779419 34.3093083 HS 3.4309308 Example Plate H05
H06 100 5890 45.2616552 945 57.6144458 51.4380505 Average 5.1438050 Example Plate H06
H07 100 2847 21.7415481 124 1.7332557 21.7415481 HS 2.1741548 Example Plate H07
H08 100 2824 21.5637754 270 11.6707146 21.5637754 HS 2.1563775 Example Plate H08
H09 100 7493 57.6516426 975 59.6563894 58.6540160 Average 5.8654016 Example Plate H09
H10 100 1374 10.3563632 68 -2.0783724 10.3563632 HS 1.0356363 Example Plate H10
H11 100 1511 11.4152704 115 1.1206726 11.4152704 HS 1.1415270 Example Plate H11
H12 100 7049 54.2198557 889 53.8028177 54.0113367 Average 5.4011337 Example Plate H12

Joining, filtering, and computing new columns

To demonstrate a couple of examples of how to filter rows from your table, and how to add new columns to your data, I’ll walk through a “manual” version of computing microbiota density from samples. All of the pieces are in place if you follow the functions outlined above, we just need to do some division, and clean up our data.

The DNA measurement functions will produce a table containing DNA concentrations based on all the samples in the plate that are not standards (so either 88 or 96 samples, for most uses). If there are wells that were empty, they will be carried over using these functions. To eliminate them, we can filter out individual wells using something like filtered_table <- filter(unfiltered_table, !(SampleWell %in% c("F11", "F12", "G04"))). We can employ a variation of this to filter our samples based on some of the fields in our annotated sample information above. If you have used the Matrix plate scanner, you can simply filter out any samples that have a “No Tube” in the TubeBarcode field. Another filter that you can use commonly is to remove any samples whose mass is less than 10 mg. These are often empty tubes, or samples for which the fecal sample was too small, and so any errors in the DNA extraction are exacerbated when you calculate things like microbiota density.

As a side note, I use the pipe function (%>%) from the magrittr package that really helps make the code much more readable by passing along the results of any computations/data performed on the left of the pipe to the functions to the right of the pipe.

sample_dna_annotated <- left_join(annotated_data, sample_dna_combined) %>% 
  filter(SampleMass > 10, TubeBarcode != "No Tube")
PlateID SampleWell TubeBarcode Full_Mass Full_Weight_Date Full_Weight_Time BarcodeID Empty_Mass Empty_Weight_Date Empty_Weight_Time SampleMass Experiment Date Cage Animal Timepoint Sex Condition Sample Replicate ReaderWell Elution_Volume HS_Measurement HS_dna_concentration BR_Measurement BR_dna_concentration DNA_Concentration Qubit_Dye_Used Total_DNA
Example Plate A01 0231322517 974.9 9/7/2017 10:34:58 SW_Abs|00000008a|083017|ZEOvr 936.2 8/15/17 17:06:56 38.7 SW_Abs1 30-Aug 8 8a 2 Female 1001262B+AVNC FP NA A01 100 300 2.055149 58 -2.7590202 2.055149 HS 0.2055149
Example Plate A02 0231322445 998.3 9/7/2017 10:35:06 SW_Abs|00000001a|090117|kmSFB 937.1 8/15/17 17:07:12 61.2 SW_Abs1 31-Aug 1 1a 3 Male AS4413 FP NA A02 100 2257 17.181291 194 6.4977908 17.181291 HS 1.7181291
Example Plate A03 0231322462 968.1 9/7/2017 10:35:10 SW_Abs|00000001b|090117|vPhZA 936.1 8/15/17 17:07:21 32.0 SW_Abs1 31-Aug 1 1b 3 Male AS4413 FP NA A03 100 922 6.862742 103 0.3038952 6.862742 HS 0.6862742
Example Plate A04 0231322484 1023.5 9/7/2017 10:35:17 SW_Abs|00000002a|090117|VGBO5 934.7 8/15/17 17:07:26 88.8 SW_Abs1 31-Aug 2 2a 3 Male NB71813 FP NA A04 100 4862 37.315986 349 17.0478328 37.315986 HS 3.7315986
Example Plate A05 0231322512 960.3 9/7/2017 10:35:21 SW_Abs|00000002b|090117|o0k9G 933.7 8/15/17 17:07:33 26.6 SW_Abs1 31-Aug 2 2b 3 Male NB71813 FP NA A05 100 865 6.422175 86 -0.8532062 6.422175 HS 0.6422175
Example Plate A06 0231322487 1032.0 9/7/2017 10:35:25 SW_Abs|00000003a|090117|72BP4 934.1 8/15/17 17:07:39 97.9 SW_Abs1 31-Aug 3 3a 3 Male GZ35-1 FP NA A06 100 5263 40.415416 474 25.5559311 40.415416 HS 4.0415416
Example Plate A07 0231322535 1024.4 9/7/2017 10:35:28 SW_Abs|00000003b|090117|3FTmt 943.2 8/15/17 17:07:44 81.2 SW_Abs1 31-Aug