R/process_data.R
process_data.Rd
Return matrices of observed absolute and relative abundances, given a single dataset and a set of indices.
process_data(
full_data,
rel_inds,
abs_inds,
abs_plus_rel_inds,
regex_thr = "_t",
regex_abs = "_cps",
llod = 0,
m_min = 1000,
div_num = 100
)
the full dataset, containing both absolute and relative abundances
the indices marking the relative abundance measurements in full_data
the indices marking the absolute abundance measurements in full_data
the indices that have both absolute and relative abundance measurements
the regular expression to identify absolute abundance threshold for each taxon-specific measurement (e.g., "_t" appended to each threshold)
the regular expression to identify absolute abundance measurement for each taxon-specific measurement (e.g., "_cps" appended to each measurement of copies per swab)
the lower limit of detection for absolute abundance measurements
the minimum number of reads to consider
the number to divide absolute abundance measurements by (to create valid R integers for use in Stan)
a list containing two matrices: one with the observed absolute abundances, and the other with the observed relative abundances.
# load the package, read in example data
library("paramedic")
data(simple_example_data)
# process the example data
q <- 3
q_obs <- 2
processed_data <- paramedic::process_data(full_data = simple_example_data, rel_inds = 1:q,
abs_inds = (q + 1):(q + q_obs),
abs_plus_rel_inds = 1:q_obs,
regex_thr = "", regex_abs = "_cps", llod = 0,
m_min = 1000, div_num = 1)