-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Hello!
I want to open discussion about adding a support for TreeSummarizedExperiment (TreeSE) object.
TreeSE is a extension to SingleCellExperiment (SCE) object by adding slots for row and column trees. These trees are especially relevant in microbiome field where species relations are illustrated as phylogeny trees (rowTree slot in TreeSE). You can find more info on microbiome data science and TreeSE class from here: https://microbiome.github.io/OMA/docs/devel/
In microbiome field, large population cohorts are rather common. For instance, Ruuskanen et al., studied large Finnish cohort on how microbiome relates to fatty liver disease. They also studied geographical regions.
There might not be as many applications for images as in spatial transcriptomics, and coordinates (or location groups) can be stored in colData. However, I think supporting also TreeSE might benefit both fields by allowing microbiome researchers to access tools used in spatial transcriptomics and vise versa. This might give us an additional synergy as it further extends the SummarizedExperiment ecosystem, ultimately reducing redundant efforts and enhancing collaboration.
Because TreeSE is SCE, we can already coarse TreeSE to SpatialExperiment, however, we lose TreeSE-specific slots.
library(TreeSummarizedExperiment)
library(ape)
library(SpatialExperiment)
assay_data <- rbind(rep(0, 4), matrix(1:20, nrow = 5))
colnames(assay_data) <- paste0("sample", 1:4)
rownames(assay_data) <- paste("entity", seq_len(6), sep = "")
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)
set.seed(12)
row_tree <- rtree(5)
tip_lab <- row_tree$tip.label
row_lab <- tip_lab[c(1, 1:5)]
tse <- TreeSummarizedExperiment(assays = list(Count = assay_data),
rowData = row_data,
rowTree = row_tree,
rowNodeLab = row_lab
)
tse
as(tse, "SpatialExperiment")
-Tuomas