measuredCategory: Obtain the number of measured intensities per sample type

View source: R/tab_measuredvalues_missingvalues.R

measuredCategoryR Documentation

Obtain the number of measured intensities per sample type

Description

The function measuredCategory creates a tbl with the number of measured values per feature. 0 means that there were only missing values (NA) for the feature and sample type. measuredCategory will return a tbl where columns are the unique sample types and rows are the features as in assay(se).

Usage

measuredCategory(se, measured = TRUE, category = "type")

Arguments

se

SummarizedExperiment

measured

logical, should the measured values (measured = TRUE) or missing values (measured = FALSE) be taken

category

character, corresponds to a column name in colData(se)

Details

measuredCategory is a helper function.

Value

matrix with number of measured/missing features per category type

Examples

## create se
set.seed(1)
a <- matrix(rnorm(100), nrow = 10, ncol = 10,
            dimnames = list(seq_len(10), paste("sample", seq_len(10))))
a[c(1, 5, 8), seq_len(5)] <- NA
cD <- data.frame(name = colnames(a), type = c(rep("1", 5), rep("2", 5)))
rD <- data.frame(spectra = rownames(a))
se <- SummarizedExperiment::SummarizedExperiment(assay = a,
    rowData = rD, colData = cD)

measuredCategory(se, measured = TRUE, category = "type")


tnaake/MatrixQCvis documentation built on Nov. 4, 2024, 7:42 a.m.