plotNhoodSizeHist {miloR} | R 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)

[Package miloR version 1.2.0 Index]