measured_category {MatrixQCvis} | R Documentation |
The function 'measured_category' 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. 'measured_category' will return a 'tbl' where columns are the unique sample types and rows are the features as in 'assay(se)'.
measured_category(se, measured = TRUE, category = "type")
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)' |
'measured_category' is a helper function.
'tbl' with number of measured/mising features per 'category' type
## create se set.seed(1) a <- matrix(rnorm(100), nrow = 10, ncol = 10, dimnames = list(1:10, paste("sample", 1:10))) a[c(1, 5, 8), 1: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) measured_category(se, measured = TRUE, category = "type")