reportMissingValues: Four metrics to report missing values

View source: R/compute_metrics.R

reportMissingValuesR Documentation

Four metrics to report missing values

Description

The function computes four metrics to report missing values in single-cell proteomics.

Usage

reportMissingValues(object, i, by = NULL)

Arguments

object

An object of class QFeatures.

i

The index of the assay in object. The assay must contain an identification matrix, that is a matrix where an entry is TRUE if the value is observed and FALSE is the value is missing (see examples). i may be numeric, character or logical, but it must select only one assay.

by

A vector of length equal to the number of columns in assay i that defines groups for which the metrics should be computed separately. If missing, the metrics are computed for the complete assay.

Value

A data.frame with groups as rows and 5 columns:

  • LocalSensitivityMean: the average number of features per cell.

  • LocalSensitivitySd: the standard deviation of the local sensitivity.

  • TotalSensitivity: the total number of features found in the dataset.

  • Completeness: the proportion of values that are not missing in the data.

  • NumberCells: the number of cells in the dataset.

Examples


data("scp1")

## Define the identification matrix
peps <- scp1[["peptides"]]
assay(peps) <- !is.na(assay(peps))
scp1 <- addAssay(scp1, peps, "id")

## Report metrics 
reportMissingValues(scp1, "id")
## Report metrics by sample type
reportMissingValues(scp1, "id", scp1$SampleType)

data


UCLouvain-CBIO/scp documentation built on May 5, 2024, 1:17 a.m.