mts_patternDetection: Predict Gene Dependency Relationship Patterns, including...

View source: R/mts_patternDetection.R

mts_patternDetectionR Documentation

Predict Gene Dependency Relationship Patterns, including Synthetic Lethality

Description

Enumerates different types of gene dependency relationships (GDRs). Can optionally detect SL where there is a depletion of samples in the bottom left cell of the contingency table (if low-scoring values indicate a reduction or loss of gene function). Performs statistical analysis of depletion with the binomial test. The expected proportion of samples in each contingency table cell is calculated with reference to the size of the clusters.

Usage

mts_patternDetection(
  genepairs = NULL, 
  mixModelClusters1, 
  mixModelClusters2 = NULL, 
  SyntheticLethalityPrediction = TRUE, 
  p_adjustMethod = c("BY","BH"),
  qVal, 
  effectsize = TRUE,  
  effectsize_threshold = NULL, 
  include_reverse_pairs = FALSE,
  directionality = c("depletion", "enrichment"),  
  verbose = FALSE, 
  cores)

Arguments

mixModelClusters1

List object containing multisep cluster assignments output by the mts_mixModelCluster function. The list object can also be generated from the mts_mixModelCluster function using categorical variables that have been formatted by the mts_formatMatrix function.

mixModelClusters2

Optional. A list object produced by the mts_mixModelCluster function. The list object can also include categorical variables formatted by the mts_formatMatrix function.
If provided, bidirectional analysis is carried out to assess associations between mixModelClusters1 and mixModelClusters2 (i.e. two contingency tables per gene pair).
If not provided, unidirectional analysis is carried out for mixModelClusters1 against itself (only one contingency table is required per gene pair).

genepairs

Optional. If the argument is not called or left as NULL then gene pairs will be generated based on the bidirectional or unidirectional arguments specified. If provided, genepairs must be a data frame containing two columns of gene names.
- For one-directional analysis (single mixModelClusters object), both genes in each pair must exist in that object.
- For bidirectional analysis (two mixModelClusters objects), the first column must contain genes from mixModelClusters1, and the second column must contain genes from mixModelClusters2.
All gene pairs must have valid cluster values in the respective mixModelClusters input(s).

SyntheticLethalityPrediction

If set to TRUE synthetic lethal patterns are evaluated (by analysis of the bottom left contingency table cell). If FALSE, gene dependency relationships are evaluated for all combinations of clusters for each gene pair, for example including synthetic lethality and induced dependency. Defaults to TRUE.

p_adjustMethod

The method for false discovery rate adjustment of p-values for multiple comparisons. The options are: "BH" (Benjamini & Hochberg (1995), \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.2517-6161.1995.tb02031.x")}) or its alias "fdr", and "BY" (Benjamini & Yekutieli (2001), \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aos/1013699998")}). Defaults to "BY" which is recommended due to the expectation that genes may participate in multiple gene pairs.

qVal

The q value filter threshold value, defaults to 0.05.

effectsize

If TRUE, filtering based on effect size is applied. Defaults to TRUE.

effectsize_threshold

A numeric value between 0 and 1. Gene pairs with effect sizes below this threshold will be excluded from the final results. If set to FALSE, no filtering based on effect size is applied. The default value depends on the analysis type:
- One mixModelCluster object: default = 0.9621389
- Two mixModelCluster objects: default = 0.5029284 Please note that these thresholds were calibrated in XPR_vs_XPR (one object) and XPR_vs_CRISPR analysis (two objects); please see preprint/publication for details (McKie et al 2026).

include_reverse_pairs

If TRUE, both GeneA-GeneB and GeneB-GeneA will be tested when two mixModelCluster objects are provided.
If FALSE, only unique one-way pairs are used. Defaults to FALSE

directionality

Valid options are "enrichment" or "depletion". Considers the directionality of gene dependency relationships: assessed as either "depletion" (corresponding to synthetic lethality in most data types) or "enrichment" in contingency table cells.
For example when synthetic lethality occurs with CRISPR data and expression we expect "enrichment" of samples in the bottom left contingency table cell because low CRISPR scores represent cell death (or possibly cell stasis). For other data types where low values indicate loss of (or reduced) gene function, such as gene expression, the expectation for synthetic lethal relationships is a "depletion" of samples in the bottom-left contingency table cell. Defaults to "depletion".

verbose

If TRUE, the function will print detailed progress messages during execution, including progress updates and any skipped gene pairs. Defaults to FALSE.

cores

The number of compute cores to use, defaults to 1.

Value

A data frame with one row per evaluated gene pair, containing the gene names (Gene1, Gene2), the observed count (Actual_Count), the number of cluster combinations, the sample count, the expected count (Expected_Count), and the p_value and false-discovery-rate q_value (plus an Effect_Size column when effectsize = TRUE). An empty data frame with these columns is returned when no gene pair is valid.

See Also

mts_mixModelCluster, mts_mixModelCluster_XPR, mts_crisprPartition, mts_genepairsChunkGeneration, mts_formatMatrix, mts_plotClusterDistribution

Examples

data("mixModelClusters_depMapXPR")

mixturemodelClusters <- mts_mixModelCluster_XPR(dataMatrix = depMapXPR_subset[c(1:12, 20), ])
# partition into two 'clusters' at -0.5
CRISPR_clusters = mts_crisprPartition(dataMatrix = depMapCRISPRscores_subset[1:12, ])

# unidirectional (i.e. symmetrical) evaluation 
# of synthetic lethality depletion relationships with expression data 
predicted_XPR_SL = mts_patternDetection(
  mixModelClusters1=mixModelClusters_depMapXPR,
  qVal=1
)

# unidirectional synthetic lethal depletion prediction with expression data and
# specified gene pairs, using BH FDR correction, filtering using the q-value
# and the effect size 

predicted_XPR_SL2 = mts_patternDetection(
  genepairs = data.frame(Gene1="PSMB8",Gene2="TTC7B"),
  mixModelClusters1 = mixturemodelClusters,
  SyntheticLethalityPrediction = TRUE,
  p_adjustMethod="BH",  
  qVal = 0.05,  effectsize=TRUE)

# bidirectional synthetic lethal depletion prediction with expression and CRISPR data 
# and including reverse pairs 

Predicted_SL3 = mts_patternDetection(
  mixModelClusters1=mixturemodelClusters[1:10], 
  mixModelClusters2=CRISPR_clusters[1:10],
  include_reverse_pairs = FALSE, effectsize=FALSE, qVal =0.05,
  directionality = "enrichment"
)

# tissue specific analysis 
# 1. subset cell lines of interest using mapping file 

Lung_Cancer_cellLines <- depMapTissue_subset$cell_line[
  depMapTissue_subset$tissue == "Lung Cancer"]

# 2. subset XPR mixture model result list 
LungCancer_XPRmixturemodelClusters <- lapply(mixturemodelClusters, function(GMM) {
    GMM[GMM$Sample %in% Lung_Cancer_cellLines, ]
})

# 3. subset CRISPR mixture model result list 
LungCancer_CRISPR_clusters <- lapply(CRISPR_clusters, function(GMM) {
  GMM[GMM$Sample %in% Lung_Cancer_cellLines, ]
})

TissueSpecific_SL = mts_patternDetection(mixModelClusters1 = LungCancer_CRISPR_clusters,
                         mixModelClusters2 = LungCancer_XPRmixturemodelClusters, 
                         include_reverse_pairs = TRUE,
                         SyntheticLethalityPrediction = TRUE,
                         directionality = "enrichment",
                         qVal = 1) 

# bidirectional analysis of all depletion gene dependency relationships 
# for expression and CRISPR data with BY FDR correction 

PredictedGDR = mts_patternDetection(
  mixModelClusters1=mixturemodelClusters[1:10], 
  mixModelClusters2=CRISPR_clusters[1:10],
  SyntheticLethalityPrediction = FALSE,
  directionality = "enrichment",
  p_adjustMethod="BY", effectsize = FALSE, qVal = 0.01
)


MultiSEp documentation built on Aug. 27, 2026, 5:07 p.m.