Return a list of features with the strongest contribution to a set of components

TopFeatures(
  object,
  dim = 1,
  nfeatures = 20,
  projected = FALSE,
  balanced = FALSE,
  ...
)

Arguments

object

DimReduc object

dim

Dimension to use

nfeatures

Number of features to return

projected

Use the projected feature loadings

balanced

Return an equal number of features with both + and - scores.

...

Extra parameters passed to Loadings

Value

Returns a vector of features

Examples

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
TopFeatures(object = pbmc_small[["pca"]], dim = 1)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"         
# After projection:
TopFeatures(object = pbmc_small[["pca"]], dim = 1,  projected = TRUE)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"