countCells | R Documentation |
This function quantifies the number of cells in each neighbourhood according to an input experimental design. This forms the basis for the differential neighbourhood abundance testing.
countCells(x, samples, meta.data = NULL)
x |
A |
samples |
Either a string specifying which column of |
meta.data |
A cell X variable |
This function generates a counts matrix of nhoods
X samples,
and populates the nhoodCounts
slot of the input
Milo
object. This matrix is used down-stream for
differential abundance testing.
A Milo
object containing a counts matrix in the
nhoodCounts
slot.
Mike Morgan, Emma Dann
library(igraph) m <- matrix(rnorm(100000), ncol=100) milo <- buildGraph(t(m), k=20, d=10) milo <- makeNhoods(milo, k=20, d=10, prop=0.3) cond <- rep("A", nrow(m)) cond.a <- sample(seq_len(nrow(m)), size=floor(nrow(m)*0.25)) cond.b <- setdiff(seq_len(nrow(m)), cond.a) cond[cond.b] <- "B" meta.df <- data.frame(Condition=cond, Replicate=c(rep("R1", 330), rep("R2", 330), rep("R3", 340))) meta.df$SampID <- paste(meta.df$Condition, meta.df$Replicate, sep="_") milo <- countCells(milo, meta.data=meta.df, samples="SampID") milo
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.