Convert imputed metabolomics assay data to NA

convert_imputed_assays_to_na(
  se,
  measurement_assay_names = "area",
  impute_assay_name = "gap_fill_status",
  suffix = "_noimpute",
  impute_flags = c(8, 32),
  ...
)

Arguments

se

SummarizedExperiment object, or list of SummarizedExperiment objects. When a list is provided, each entry is iterated and processed, and a list is returned.

measurement_assay_names

character vector with one or more SummarizedExperiment::assayNames(se) for which the imputed data will be converted to NA values.

impute_assay_name

character string with one SummarizedExperiment::assayNames(se) entry that contains the impute flags. Only the first matching assay name is used.

suffix

character suffix appended to each value in measurement_assay_names to create a new assay name for the resulting data matrix.

When filtering by different impute criteria, it may be helpful to include the codes in the suffix, for example filtering by only impute_flags=8 may suggest suffix="_noimpute8".

impute_flags

numeric vector of flags indicating values in impute_assay_name assay data which represent imputed data.

The defaults:

  • 8: filled by trace area (imputed)

  • 32: filled by spectrum noise (imputed)

Other values:

  • 0: original ion used

  • 64: filled by matching ion

  • 128: filled by re-detected peak

...

additional arguments are ignored.

Value

SummarizedExperiment or when input se is a list

a list of SummarizedExperiment objects is returned.

Details

This function takes SummarizedExperiment data as input, which must contain at least two SummarizedExperiment::assayNames() entries:

  1. numeric assay measurements

  2. numeric impute flag data

The coordinates of cells in the impute flag data which match impute_flags are used to convert data in assay measurements to NA.