when there is NA in sample or feature names, the constructor throws an error which is hard to interpret.
library(SingleCellExperiment)
assay_data <- rbind(rep(0, 4), matrix(1:20, nrow = 5))
colnames(assay_data) <- paste0("sample", 1:4)
rownames(assay_data) <- paste0("entity", seq_len(6))
row_data <- data.frame(Kingdom = "A",
Phylum = rep(c("B1", "B2"), c(2, 4)),
Class = rep(c("C1", "C2", "C3"), each = 2),
OTU = paste0("D", 1:6),
row.names = rownames(assay_data),
stringsAsFactors = FALSE)
col_data <- data.frame(gg = c(1, 2, 3, 3),
group = rep(LETTERS[1:2], each = 2),
row.names = colnames(assay_data),
stringsAsFactors = FALSE)
# Works!
sce <- SingleCellExperiment(assays = SimpleList(counts = assay_data),
rowData = row_data,
colData = col_data)
# Manipulate sample names in assay
assay_data_mod <- assay_data
colnames(assay_data_mod)[1] <- NA
# Intenal error (This happens if one ore more sample or feature names are NA)
sce <- SingleCellExperiment(assays = SimpleList(counts = assay_data_mod),
rowData = row_data,
colData = col_data)
Hi,
when there is NA in sample or feature names, the constructor throws an error which is hard to interpret.
Error in if (!ok) { : missing value where TRUE/FALSE neededSession info