Pull meta-information about cells and dimensions for a given dimensional reduction; cell meta-information is stored as row meta-information (eg. nrow, rownames) and dimension meta-information is stored as column meta-information (eg. ncol, colnames)

# S3 method for DimReduc
dim(x)

# S3 method for DimReduc
dimnames(x)

# S3 method for DimReduc
length(x)

# S3 method for DimReduc
names(x)

Arguments

x

A DimReduc object

Value

dim: The number of cells (nrow) and dimensions (ncol)

dimnames: The cell (row) and dimension (column) names

length: The number of dimensions

names: The dimension identifiers

See also

Cells

Dimensional reduction object, validity, and interaction methods CreateDimReducObject(), DimReduc-class, DimReduc-validity, [.DimReduc(), [[.DimReduc(), merge.DimReduc(), print.DimReduc(), subset.DimReduc()

Examples

pca <- pbmc_small[["pca"]]
pca
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 1 
#> Positive:  SDPR, PF4, PPBP, TUBB1, CA2, TREML1, MYL9, PGRMC1, RUFY1, PARVB 
#> Negative:  HLA-DPB1, HLA-DQA1, S100A9, S100A8, GNLY, RP11-290F20.3, CD1C, AKR1C3, IGLL5, VDAC3 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 2 
#> Positive:  HLA-DPB1, HLA-DQA1, S100A8, S100A9, CD1C, RP11-290F20.3, PARVB, IGLL5, MYL9, SDPR 
#> Negative:  GNLY, AKR1C3, VDAC3, PGRMC1, TUBB1, PF4, TREML1, RUFY1, CA2, PPBP 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 3 
#> Positive:  S100A9, S100A8, RP11-290F20.3, AKR1C3, PARVB, GNLY, PPBP, PGRMC1, MYL9, TUBB1 
#> Negative:  HLA-DQA1, CD1C, IGLL5, HLA-DPB1, RUFY1, PF4, VDAC3, SDPR, TREML1, CA2 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 4 
#> Positive:  IGLL5, RP11-290F20.3, VDAC3, PPBP, TUBB1, TREML1, PF4, CA2, PARVB, MYL9 
#> Negative:  CD1C, AKR1C3, S100A8, GNLY, HLA-DPB1, HLA-DQA1, S100A9, PGRMC1, RUFY1, SDPR 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 5 
#> Positive:  MYL9, PARVB, IGLL5, TREML1, AKR1C3, PGRMC1, HLA-DPB1, S100A9, TUBB1, PF4 
#> Negative:  VDAC3, RP11-290F20.3, RUFY1, CD1C, HLA-DQA1, CA2, S100A8, PPBP, GNLY, SDPR 
dim(pca)
#> [1] 80 19

# nrow is number of cells
nrow(pca)
#> [1] 80

# rownames pulls cell names
head(rownames(pca))
#> [1] "ATGCCAGAACGACT" "CATGGCCTGTGCAT" "GAACCTGATGAACC" "TGACTGGATTCTCA"
#> [5] "AGTCAGACTGCACA" "TCTGATACACGTGT"

# ncol and length are number of dimensions
ncol(pca)
#> [1] 19
length(pca)
#> [1] 19

# colnames and names pull dimension identifiers
head(colnames(pca))
#> [1] "PC_1" "PC_2" "PC_3" "PC_4" "PC_5" "PC_6"
head(names(pca))
#> [1] "PC_1" "PC_2" "PC_3" "PC_4" "PC_5" "PC_6"