The purpose of this library is to process with the raw data from the Maverick M1 detection system (Genalyte, Inc., San Diego, CA) and output simple line graphs, bar charts, and box plots. The functions also generate companion csv files containning processed the prcoessed data for subsequent analysis. Additional functions are available to general calibration curves. The folder containing output from the M1 typically consists of:
- a csv file for each ring and
- a comments file the describes the experimental run
The comments file is not needed for this program. In addition to the csv files for each ring, a separate file containing the chip layout is required. An example of a chip layout file is provided in the sample data. To access this data, execute the following code:
library(biosensor)
dir <- setwd(system.file("extdata", "sampleChipLayout", package = "biosensor"))
example <- read.csv("groupNames_Example.csv")
View(example)
Note: This version of the software is optimized for the Bailey lab's HRP assay. See dx.doi.org/10.1021/acscentsci.5b00250 for a description. However, input variables can be altered to accomodate many alternative experiments.
To get started, follow these steps:
- If you have not already done so, download and install R and RStudio. There are many online tutorials available with instructions.
- Ensure all of your packages are up to date. To update all packages, run
update.packages()
in the Console in RStudio. - All files for this library are located
here. To install this library on
your local machine requires the
devtools
library. Run the following code to installdevtools
and thebiosensor
package.
# uncomment the line below if devtools is not installed
# install.packages("devtools")
devtools::install_github("BaileyLabUM/biosensor")
The functions within this library include:
analyzeBiosensorData
- This function processes raw data from a single biosensor experiment and outputs simple line graphs, bar charts, and box plots. In principle, this code should also work for any bionsensor data that ouputs Time in column one and Signal in column two. The function call also generates companion csv files containning processed the prcoessed data for subsequent analysis.calibrationStation
- This function processes a series of experiments using theanalyzeBiosensorData
function. Then, the data from each experiment is combined to generate a calibration curve for each target of interest.
-
Ensure the you have the necessary libraries installed and up to date.
-
Copy the chip layout file (e.g., "groupNames_XPP.csv") into the directory containing the raw ring data you wish to analyze. Note: This program has the highest chance of success if the directory only contains:
- raw ring data files (e.g., "03.csv", "04.csv", etc.) and
- the chip layout file (e.g., "groupNames_XPP.csv")
-
Set the working directory to the directory containing your raw data and chip layout file. See instructions on setting the working directory in R here. For example, if you are using a Windows machine and your ring data is on your
Desktop
folder, you could set your working directory by executing the following line in the console:setwd("C:/Users/USERNAME/Desktop/CHIPNAME_gaskGASKNAME_DATE")
. -
Execute the code by running the
analyzeBiosensorData
function. This function requires 13 input variables:- time1 - a number specifying the later time for net shift calculations
- time2 - a number specifying the earlier time for net shift calculations
- uchannel a logical value indicating if experiment is a U-channel
- filename - a string with the filename containing the chip layout
- loc - a string with directory name to save plots and data files
- fsr - a logical value indicating whether the data contains FSR shifts
- chkRings - a logical value indicating if rings should be removed
- plotData - a logical value indicating if data should be plotted, which will save a series of png files
- celebrate - a logical value, set it to TRUE for to be alerted when your script has finished
- netShifts - a logical value indicating if net shift values should be calculated and plotted
- getLayoutFile - a logical value indicating if the chip layout file should be downloaded from Github
- chopRun a logical value indicating if run should be subsetted
- startRun the numerical value on where to start the run, only used if chopRun is TRUE
Note: to calculate net shift measurements, the relative shift at time2 is subtracted from time1 (netshift = time1 - time2).
Here is an example of code to run:
library(biosensor)
setwd("C:/Users/USERNAME/Desktop/CHIPNAME_gaskGASKNAME_DATE")
# this will run with code defaults
analyzeBiosensorData()
To see an example with data provided as part of this library execute the following code:
library(biosensor)
dir <- system.file("extdata", "20171112_gaskTestData_MRR", package = "biosensor")
setwd(dir)
analyzeBiosensorData()
- Set the working directory to a directory containing experiments for your calibration curve. Note: Each experiment should be in its own subdirectory.
- Load the library and run the
calibrationStation
function. The function has a single input variable:- celebrate - a logical value, set it to TRUE for to be alerted when your script has finished
Here is an example of code to run:
library(biosensor)
setwd("C:/Users/USERNAME/Desktop/CalibrationData")
calibrationStation(celebrate = TRUE)