R/objects.R
TopCells.Rd
Return a list of genes with the strongest contribution to a set of components
TopCells(object, dim = 1, ncells = 20, balanced = FALSE, ...)
DimReduc object
Dimension to use
Number of cells to return
Return an equal number of cells with both + and - scores.
Extra parameters passed to Embeddings
Returns a vector of cells
data("pbmc_small")
pbmc_small
#> An object of class Seurat
#> 230 features across 80 samples within 1 assay
#> Active assay: RNA (230 features, 20 variable features)
#> 3 layers present: counts, data, scale.data
#> 2 dimensional reductions calculated: pca, tsne
head(TopCells(object = pbmc_small[["pca"]]))
#> [1] "ACGTGATGCCATGA" "ATACCACTCTAAGC" "ATTGCACTTGCTTT" "CTAGGTGATGGTTG"
#> [5] "GACATTCTCCACCT" "ATAGGAGAAACAGA"
# Can specify which dimension and how many cells to return
TopCells(object = pbmc_small[["pca"]], dim = 2, ncells = 5)
#> [1] "ACAGGTACTGGTGT" "GTTGACGATATCGG" "GGCATATGCTTATC" "CTAACGGAACCGAT"
#> [5] "CATTACACCAACTG"