The single constructor for MatisseObject. Combines a
Seurat object with isoform-resolved splicing data. The operating
mode is detected automatically from the inputs you supply:
Usage
CreateMatisseObject(
seurat,
junction_counts = NULL,
transcript_counts = NULL,
ioe_files = NULL,
event_data = NULL,
junction_data = NULL,
min_coverage = 5L,
verbose = TRUE
)Arguments
- seurat
A
Seuratobject. Required.- junction_counts
A sparse matrix (dgCMatrix, cells x junctions) of raw per-junction read counts. Row names must match
colnames(seurat). Triggers junction mode. Default:NULL.- transcript_counts
A matrix or sparse matrix (transcripts x cells) of raw transcript-level counts. Stored as
Assay5("transcript")in the Seurat object. Column names must overlap withcolnames(seurat). Default:NULL.- ioe_files
Character vector of paths to SUPPA2
.ioefiles. When supplied together withtranscript_counts, triggers event mode and PSI is computed at construction. Default:NULL.- event_data
A
data.framedefining splice events (junction mode only). Required columns:event_id,gene_id,chr,strand,event_type,inclusion_junctions,exclusion_junctions. Default:NULL.- junction_data
A
data.frameof junction annotations. Required columns:junction_id,chr,start,end,strand,gene_id. Default:NULL.- min_coverage
Integer. Minimum total transcript counts per cell per event to report a PSI value (event mode only). Default:
5.- verbose
Logical. Print construction progress. Default:
TRUE.
Details
Junction mode (short-read): pass
junction_counts. Junction counts are stored asAssay5("junction")inside the Seurat object. CallCalculatePSIafterwards to compute PSI values.Event mode (long-read): pass
transcript_countsandioe_files. Transcript counts are stored asAssay5("transcript")and PSI is computed immediately from the supplied SUPPA2.ioeevent definitions, stored asAssay5("psi").
You can also pass transcript_counts alone (without ioe_files)
to store the transcript assay without computing PSI – for example, when you
want to run SCTransform on transcript-level counts and compute
PSI separately.
Examples
if (FALSE) { # \dontrun{
library(Seurat)
counts <- matrix(rpois(200, 5), nrow = 20,
dimnames = list(paste0("Gene", 1:20),
paste0("Cell", 1:10)))
seu <- CreateSeuratObject(counts)
# Junction mode
jxn <- make_junction_counts()
obj <- CreateMatisseObject(seurat = seu, junction_counts = jxn)
# Event mode
tx <- make_transcript_counts()
obj <- CreateMatisseObject(seurat = seu, transcript_counts = tx,
ioe_files = "path/to/events.ioe")
} # }