Description Usage Arguments Value Methods (by generic) Slots Examples
S4 class derived from SingleCellExperiment
that can store single-cell count matrix, gene and cell annotation
data frames, and factorization factors as well as quality measures
for rank determination.
1 2 | ## S4 method for signature 'scNMFSet,ANY'
plot(x)
|
x |
Object containing measure |
Object of class scNMFSet
NULL
plot: Plot measures of an object.
For quality measures derived from maximum likelihood inference,
dispersion and cophenetic will be plotted separately.
For measure derived from Bayesian inference, log evidence as a function of rank values will be plotted.
assaysNamed list for count matrix counts.
rowDataDataFrame for gene (feature)
names and annotations in columns.
colDataDataFrame for cell IDs and other
annotations in columns (e.g., barcodes, cell types).
ranksVector for rank values for which factorization has been performed.
basisList (of length equal to that of ranks) of
basis matrices W from factorization;
dimension nrow x rank,
where nrow is no. of rows in count.
coeffList (of length equal to that of ranks) of
coefficient matrices H from factorization;
dimension rank x ncol,
where ncol is no. of columns in count.
measureData frame of factorization quality measures for
each rank (likelihood and dispersion).
Other slots inherited from SingleCellExperiment class are
not explicitly used.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | library(S4Vectors)
# toy matrix
ngenes <- 8
ncells <- 5
mat <- matrix(rpois(n=ngenes*ncells,lambda=3),ngenes,ncells)
abc <- letters[seq_len(ngenes)]
ABC <- LETTERS[seq_len(ncells)]
genes <- DataFrame(gene_id=abc)
cells <- DataFrame(cell_id=ABC)
rownames(mat) <- rownames(genes) <- abc
colnames(mat) <- rownames(cells) <- ABC
# create scNMFSet object
s <- scNMFSet(count=mat,rowData=genes,colData=cells)
# alternative ways
s2 <- scNMFSet(count=mat)
s2 <- scNMFSet(assays=list(counts=mat))
# show dimensions
dim(s)
# show slots
rowData(s)
# modify slots
colData(s) <- DataFrame(cell_id=seq_len(ncells),
cell_type=c(rep('tissue1',2),
rep('tissue2',ncells-2)))
colData(s)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.