Skip to contents

Typically called automatically by CreateMatisseObject; call directly only to recompute with different parameters (e.g. a different min_coverage).

Computes a Percent Spliced In (PSI) matrix for all splice events and stores it in the "psi" assay. Works in both junction mode and transcript mode. CreateMatisseObject calls this automatically by default; you only call it directly to recompute with different parameters (e.g. a different min_coverage) or after constructing with defer_psi = TRUE.

Usage

CalculatePSI(object, events = NULL, min_coverage = 5L, verbose = TRUE, ...)

# S4 method for class 'MatisseObject'
CalculatePSI(object, events = NULL, min_coverage = 5L, verbose = TRUE, ...)

# S4 method for class 'ANY'
CalculatePSI(object, events = NULL, min_coverage = 5L, verbose = TRUE, ...)

Arguments

object

A MatisseObject, or a sparse matrix (cells x junctions) when computing PSI outside the object.

events

A data.frame with columns event_id, inclusion_features, and exclusion_features. Defaults to the event annotation staged at construction time (object@misc[["event_data"]], populated by CreateMatisseObject).

min_coverage

Integer. Minimum total reads per cell per event to report a PSI value. Default: 5.

verbose

Logical. Print progress. Default: TRUE.

...

Additional arguments passed to the method.

Value

A MatisseObject (when given one) or a PSI matrix.

  • MatisseObject: the input object with the "psi" assay populated inside the embedded Seurat object.

  • matrix: a dense matrix (cells x events) of PSI values.

Details

For each cell \(c\) and event \(e\):

$$PSI_{c,e} = \frac{\sum \text{inclusion reads}} {\sum \text{inclusion reads} + \sum \text{exclusion reads}}$$

Results are stored inside the embedded Seurat object as Assay5("psi"), with:

  • "data" layer: PSI values in \([0,1]\) (events x cells).

  • "counts" layer: inclusion read counts (events x cells).

  • "exclusion" layer: exclusion read counts (events x cells).

Entries where total coverage falls below min_coverage are set to NA in the "data" layer.

nPercent_isoform is also written to cell metadata: the percentage of splice events with a non-NA PSI value in each cell.