calculate_metrics: Generate a dataframe with calculated metrics.

View source: R/calculate_metrics.R

calculate_metricsR Documentation

Generate a dataframe with calculated metrics.

Description

Uses functions from the "calculate" family of quicR functions to generate an analyzed dataframe.

Usage

calculate_metrics(
  data,
  meta,
  metrics = c("MPR", "MS", "TtT", "RAF"),
  transpose = FALSE,
  normalize = FALSE,
  start_col = 3L,
  MS_window = 3L,
  threshold = 2
)

Arguments

data

A dataframe containing the raw RT-QuIC data.

meta

A dataframe containing sample metadata. Should include at least the "Sample IDs" column.

metrics

An array containing the metrics which should be calculated.

transpose

Logical; should the raw data be transposed before performing the calculations?

normalize

Logical; should the raw data be normalized before performing the calculations?

start_col

Integer; column number denoting where the numeric data begins.

MS_window

Integer; width of the window applied in the calculation of max slope.

threshold

Float; the threshold applied to the calculation of time-to-threshold.

Value

A dataframe of calculated metrics.

Examples

file <- system.file(
  "extdata/input_files",
  file = "test4.xlsx",
  package = "quicR"
)

data <- quicR::get_real(file)[[1]] |>
  quicR::normalize_RFU()

meta <- quicR::organize_tables(file) |>
  quicR::convert_tables()

calculate_metrics(data, meta)


quicR documentation built on April 3, 2025, 11:20 p.m.