process_input {htrSPRanalysis}R Documentation

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 parallel::detectCores().

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 RU dataframe after baseline correction

keep_concentrations

A vector containing the indices of the columns from Time and correctedRU to be used in curve fitting

all_concentrations_values

A vector containing the concentration values corresponding to the columns of the Time and RU dataframes

incl_concentrations_values

A vector containing the concentration values corresponding to the Time and correctedRU columns chosen for curve fitting

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

n_fit_wells

The number of rows in the sample_info_fits dataframe

ftol

The ftol parameter passed to the nls.lm function

ptol

The ptol parameter passed to the nls.lm function

ptol

The ptol parameter passed to the nls.lm function

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)

[Package htrSPRanalysis version 0.1.0 Index]