calcExprFreqs {muscat} | R Documentation

## calcExprFreqs

### Description

Calculates gene expression frequencies

### Usage

    calcExprFreqs(x, assay = "counts", th = 0)

### Arguments

`x` | a `SingleCellExperiment`.
`assay` | a character string specifying which assay to use.
`th` | numeric threshold value above which a gene should be considered to be expressed.

### Details

`calcExprFreq` computes, for each sample and group (in each cluster), the fraction of cells that express a given gene. Here, a gene is considered to be expressed when the specified measurement value (`assay`) lies above the specified threshold value (`th`).

### Value

a `SingleCellExperiment` containing, for each cluster, an assay of dimensions #genes x #samples giving the fraction of cells that express each gene in each sample. If `colData(x)` contains a `"group_id"` column, the fraction of expressing cells in each each group will be included as well.

### Author(s)

Helena L Crowell & Mark D Robinson

### Examples

    data(sce)
    library(SingleCellExperiment)

    frq <- calcExprFreqs(sce)

    # one assay per cluster
    assayNames(frq)

    # expression frequencies by
    # sample & group; 1st cluster:
    head(assay(frq))

[Package muscat version 1.0.1 Index]