Process NIEHS compounds output files (internal)

process_metab_compounds_file(
  x,
  nsmall_mz = 4,
  nsmall_rt = 2,
  assay_names_extra = c("Area", "Gap Fill Status", "Peak Rating"),
  mz_colname = "m/z",
  rt_colname = "RT [min]",
  type = c("pos", "neg"),
  se_list = NULL,
  ...
)

Arguments

x

data.frame after reading compound_pos.txt or compound_neg.txt

nsmall_mz

numeric argument passed to format() to define the number of decimal positions to retain in the output label from column "m/z".

nsmall_rt

numeric argument passed to format() to define the number of decimal positions to retain in the output label from column "RT [min]".

assay_names_extra

character vector with prefix values expected in column names, for example where "Area" is expected to form a prefix to column names: "Area: sample_a", "Area: sample_b"; and "Gap Fill Status" would form column names "Gap Fill Status: sample_a", "Gap Fill Status: sample_b".

mz_colname, rt_colname

character string to indicate the appropriate column name containing "m/z" (mass/charge) and "RT [min]" (retention time in minutes) as used to format a unique identifier for each row.

type

character string indicating whether data represents positive "pos" or negative "neg" ionization. Mainly used when se_list is also provided.

se_list

optional list of SummarizedExperiment objects, named with "pos" or "neg" in the name. When provided, the se output of this function is merged into the se_list with matching type, adding assay_names into the corresponding se_list object.

...

additional arguments are ignored.

Value

SummarizedExperiment object with assays defined by matching column names in x. When no column names meet the assay_names_extra

criteria, this function returns NULL.

Details

This function produces SummarizedExperiment object with assays defined by the assay_names_extra patterns below. Each assay name is the lowercase value, with spaces replaced with underscore "_". For example "Gap Fill Status" will become assay name "gap_fill_status".