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
)

Arguments

full_data

the full dataset, containing both absolute and relative abundances

rel_inds

the indices marking the relative abundance measurements in full_data

abs_inds

the indices marking the absolute abundance measurements in full_data

abs_plus_rel_inds

the indices that have both absolute and relative abundance measurements

regex_thr

the regular expression to identify absolute abundance threshold for each taxon-specific measurement (e.g., "_t" appended to each threshold)

regex_abs

the regular expression to identify absolute abundance measurement for each taxon-specific measurement (e.g., "_cps" appended to each measurement of copies per swab)

llod

the lower limit of detection for absolute abundance measurements

m_min

the minimum number of reads to consider

div_num

the number to divide absolute abundance measurements by (to create valid R integers for use in Stan)

Value

a list containing two matrices: one with the observed absolute abundances, and the other with the observed relative abundances.

Examples

# 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)