Type: | Package |
Title: | Analysis of Surface Plasmon Resonance Data |
Version: | 0.1.0 |
Description: | Analysis of Surface Plasmon Resonance (SPR) and Biolayer Interferometry data, with automations for high-throughput SPR. This version of the package fits the 1: 1 binding model, with and without bulkshift. It offers optional local or global Rmax fitting. The user must provide a sample sheet and a Carterra output file in Carterra's current format. There is a utility function to convert from Carterra's old output format. The user may run a custom pipeline or use the provided 'Runscript', which will produce a pdf file containing fitted Rmax, ka, kd and standard errors, a plot of the sensorgram and fits, and a plot of residuals. The script will also produce a .csv file with all of the relevant parameters for each spot on the SPR chip. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Suggests: | knitr, rmarkdown, markdown, qpdf |
Imports: | magrittr, readxl, openxlsx, minpack.lm, zoo, stats, gridExtra, grid, parallel, readr, rlang, dplyr, stringr, tidyselect, ggplot2, purrr, forcats, tibble, tidyr |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2024-08-20 20:42:26 UTC; janice |
Author: | Janice McCarthy Developer [aut, cre, cph], Kan Li Dev [aut], S. Moses Dennison [aut], Georgia D. Tomaras [aut] |
Maintainer: | Janice McCarthy Developer <janice.mccarthy@duke.edu> |
Repository: | CRAN |
Date/Publication: | 2024-08-26 15:50:06 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling rhs(lhs)
.
Create csv file with all fit parameters.
Description
Create csv file with all fit parameters.
Usage
create_csv(processed_input, fits_list)
Arguments
processed_input |
Processed_input as returned by |
fits_list |
List of fits as returned by |
Value
a data frame with the fit parameters and errors. A csv file is also created using the path name supplied to process_input
Create pdf file with sensorgrams with fitted curves, residuals, table of fit parameters, and response curves.
Description
Create pdf file with sensorgrams with fitted curves, residuals, table of fit parameters, and response curves.
Usage
create_pdf(processed_input, fits_list, rc_list, plot_list, ...)
Arguments
processed_input |
Processed_input as returned by |
fits_list |
List of fits as returned by |
rc_list |
List of response curves as returned by |
plot_list |
List of plots as returned by |
... |
Arguments passed to the |
Value
NULL
A pdf file is created using the path name supplied to process_input
Get fits of all selected sensorgrams as indicated in the sample information.
Description
Get fits of all selected sensorgrams as indicated in the sample information.
Usage
get_fits(processed_input)
Arguments
processed_input |
The processed_input object returned by the function |
Value
A list of all fits. The fits are performed using the safely
function, so that the list has a $result
entry
and a $error
entry for each item. If $error
is NULL
, the sensorgram was fit succesfully.
Plot fitted sensorgras and raw data.
Description
Plot fitted sensorgras and raw data.
Usage
get_fitted_plots(processed_input, fits_list)
Arguments
processed_input |
processed_input as returned by |
fits_list |
List of fits as returned by |
Value
list of plots of sensorgrams and fits
Plot all raw data that has been selected to be processed (via the Incl.
column in the sample information). No
adjustments are made to the data.
Description
Plot all raw data that has been selected to be processed (via the Incl.
column in the sample information). No
adjustments are made to the data.
Usage
get_plots_before_baseline(processed_input)
Arguments
processed_input |
The list file that is output from the |
Value
A list of all plots that have been selected via the Incl.
column in sample information
Plot response curve. Average RU versus log10 of concentration. Color coded for concentrations selected for fitting.
Description
Plot response curve. Average RU versus log10 of concentration. Color coded for concentrations selected for fitting.
Usage
get_rc_plots(processed_input)
Arguments
processed_input |
Processed input object as returned from |
Value
list of plots of response curves, indicating the concentrations chosen for fitting
Process user input files and obtain options for fitting.
Description
Performs all functions selected in sample information, such as automated dissociation window detection, automated concentration range, automated bulk shift detection and returns a list object with the titration time series, processed sample information, all user inputs directing file outputs and fitting options
Usage
process_input(
sample_sheet_path = NULL,
data_file_path = NULL,
output_file_path = NULL,
output_pdf = NULL,
output_csv = NULL,
error_pdf = NULL,
num_cores = NULL,
min_allowed_kd = 10^(-5),
max_iterations = 1000,
ptol = 10^(-10),
ftol = 10^(-10),
min_RU_tol = 20,
max_RU_tol = 300
)
Arguments
sample_sheet_path |
The full path to the sample information file. |
data_file_path |
The full path to the titration data file. |
output_file_path |
The full path where output should be stored. This directory needs to exist. |
output_pdf |
The name of the file for the pdf output. |
output_csv |
The name of the file for the csv output. |
error_pdf |
The name of the file for error output. |
num_cores |
The number of cores to use for parallel processing. The default is( the number of cores detected by |
min_allowed_kd |
The minimum value for the dissociation constant. The default is 10^(-5). |
max_iterations |
The maximum number of iterations for curve fitting. The default is 1000. |
ptol |
Curve fitting parameter. If the proposed changes in parameters is smaller than this value, the optimization is considered converged. The default is 10^(-10) |
ftol |
Curve fitting parameter. If the squared error between observed and predicted values is smaller than ftol, the optimization is considered converged. The default is 10^(-10) |
min_RU_tol |
Minimum RU required for dissociation window detection |
max_RU_tol |
Maximum RU required for dissociation window detection. Also used in curve fitting. |
Value
A list object containing the following
expanded_sample_sheet |
The sample sheet expanded to include all spots that are represented, expanding the short-hand entries for Position/Block/Channel |
sample_info |
The expanded sample sheet with only the rows that are to be fit |
sample_info_fits |
The sample_info without rows that have encountered errors in initial processing |
Time |
The dataframe whose columns are the Time values for the input titration data. This only includes columns selected for analysis. |
RU |
The dataframe whose columns are the RU values for the input titration data. Only the columns for the samples to be analyzed are included |
correctedRU |
The |
keep_concentrations |
A vector containing the indices of the columns from |
all_concentrations_values |
A vector containing the concentration values corresponding to the columns of the |
incl_concentrations_values |
A vector containing the concentration values corresponding to the |
n_time_points |
The maximum length of titration time series |
max_RU_tol |
The maximum RU for dissociation window trimming to be automated |
min_RU_tol |
The minimum RU for dissociation window trimming to be automated |
min_RU_tol |
The minimum RU for dissociation window trimming to be automated |
nwells |
The number of rows in the |
n_fit_wells |
The number of rows in the |
ftol |
The ftol parameter passed to the |
ptol |
The ptol parameter passed to the |
ptol |
The ptol parameter passed to the |
output_pdf |
The full pathname for the output pdf file |
output_csv |
The full pathname for the output csv file |
error_pdf |
The full pathname for the pdf error file. This is where errors in processing can be found. |
error_idx_concentrations |
If there is an issue in determining the concentration window for some spots, they will be logged here |
Examples
# set up file paths for example
sample_sheet_path <- system.file("extdata",
"sample_sheet.xlsx", package="htrSPRanalysis")
fn <- paste0("https://gitlab.oit.duke.edu/janice/htrspranalysis/",
"-/raw/master/inst/extdata/titration_data.xlsx?ref_type=heads")
download.file(fn,
destfile = paste0(tempdir(),"/titration_data.xlsx"),
mode = "wb")
data_file_path <- paste0(tempdir(), "/titration_data.xlsx")
# process the input
processed_input <- process_input(sample_sheet_path = sample_sheet_path,
data_file_path = data_file_path,
num_cores = 2)