plotNhoodSizeHist: Plot histogram of neighbourhood sizes

View source: R/plotNhoods.R

plotNhoodSizeHistR Documentation

Plot histogram of neighbourhood sizes

Description

This function plots the histogram of the number of cells belonging to each neighbourhood

Usage

plotNhoodSizeHist(milo, bins = 50)

Arguments

milo

A Milo object with a non-empty nhoods slot.

bins

number of bins for geom_histogram

Value

A ggplot-class object

Author(s)

Emma Dann

Examples


require(igraph)
require(SingleCellExperiment)
ux.1 <- matrix(rpois(12000, 5), ncol=400)
ux.2 <- matrix(rpois(12000, 4), ncol=400)
ux <- rbind(ux.1, ux.2)
vx <- log2(ux + 1)
pca <- prcomp(t(vx))

sce <- SingleCellExperiment(assays=list(counts=ux, logcounts=vx),
                            reducedDims=SimpleList(PCA=pca$x))
colnames(sce) <- paste0("Cell", seq_len(ncol(sce)))
milo <- Milo(sce)
milo <- buildGraph(milo, k=20, d=10, transposed=TRUE)

milo <- makeNhoods(milo, d=10, prop=0.1)
plotNhoodSizeHist(milo)


MikeDMorgan/miloR documentation built on Feb. 29, 2024, 6:20 p.m.