R6 class for splicing analysis in single-cell RNA-seq data. Provides a modern object-oriented interface to splikit functionality while maintaining backward compatibility with existing functions.
Details
The SplikitObject encapsulates the core data structures for splicing analysis:
m1: Inclusion matrix (sparse dgCMatrix)m2: Exclusion matrix (sparse dgCMatrix)eventData: Event metadata (data.table)geneExpression: Optional gene expression matrix
Public fields
m1Inclusion matrix (dgCMatrix). Rows are events, columns are cells.
m2Exclusion matrix (dgCMatrix). Same dimensions as m1.
eventDataEvent metadata (data.table). One row per event.
geneExpressionOptional gene expression matrix (dgCMatrix).
metadataList containing summary statistics and analysis results.
Methods
Method new()
Create a new SplikitObject.
Usage
SplikitObject$new(
junction_ab = NULL,
m1 = NULL,
m2 = NULL,
eventData = NULL,
min_counts = 1,
verbose = FALSE
)Arguments
junction_abA junction abundance object from
make_junction_ab(). If provided, m1 and eventData are computed automatically.m1An existing inclusion matrix (dgCMatrix).
m2An existing exclusion matrix (dgCMatrix).
eventDataA data.table with event metadata.
min_countsMinimum count threshold for filtering events (default: 1).
verbosePrint progress messages (default: FALSE).
Method makeM2()
Compute the M2 exclusion matrix from M1 and eventData.
Usage
SplikitObject$makeM2(
batch_size = 5000,
memory_threshold = 2e+09,
force_fast = FALSE,
multi_thread = FALSE,
n_threads = 1,
use_cpp = TRUE,
verbose = FALSE
)Arguments
batch_sizeNumber of groups per batch for memory management (default: 5000).
memory_thresholdMaximum rows before switching to batched processing.
force_fastForce fast processing regardless of size (default: FALSE).
multi_threadUse parallel processing for batched operations (default: FALSE).
n_threadsNumber of threads for C++ OpenMP parallelization (default: 1).
use_cppUse fast C++ implementation (default: TRUE).
verbosePrint progress messages (default: FALSE).
Method findVariableEvents()
Find highly variable splicing events.
Method findVariableGenes()
Find highly variable genes from gene expression data.
Method getPseudoCorrelation()
Compute pseudo-correlation between splicing and external data.
Usage
SplikitObject$getPseudoCorrelation(
ZDB_matrix,
metric = "CoxSnell",
suppress_warnings = TRUE
)Method subset()
Subset the object by events and/or cells.
Method summary()
Get a summary of the object.
Examples
if (FALSE) { # \dontrun{
# Create from junction abundance data
junction_ab <- load_toy_SJ_object()
obj <- SplikitObject$new(junction_ab = junction_ab)
# Compute M2 and find variable events
obj$makeM2()
hve <- obj$findVariableEvents(min_row_sum = 50)
# Or create from existing matrices
obj <- SplikitObject$new(m1 = my_m1, m2 = my_m2, eventData = my_eventdata)
# Chain operations
results <- obj$makeM2()$findVariableEvents()
} # }
