scNMFSet-class {ccfindR} | R Documentation

## Class `scNMFSet` for storing input data and results

### Description

`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.

### Usage

    ## S4 method for signature 'scNMFSet,ANY'
    plot(x)

### Arguments

`x` | Object containing measure

### Value

Object of class `scNMFSet`

`NULL`

### Methods (by generic)

- `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.

### Slots

`assays`

  Named list for count matrix `counts`.

`rowData`

  `DataFrame` for gene (feature) names and annotations in columns.

`colData`

  `DataFrame` for cell IDs and other annotations in columns (e.g., barcodes, cell types).

`ranks`

  Vector for rank values for which factorization has been performed.

`basis`

  List (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`.

`coeff`

  List (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`.

`measure`

  Data frame of factorization quality measures for each rank (`likelihood` and `dispersion`).

  Other slots inherited from `SingleCellExperiment` class are not explicitly used.

### Examples

    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)

[Package ccfindR version 1.6.0 Index]