mts_omics: Predict synthetic lethality and other dependency...

View source: R/mts_omics.R

mts_omicsR Documentation

Predict synthetic lethality and other dependency relationships from mutually exclusive loss of function patterns

Description

Compare any 'omics datatype either against itself (e.g. XPR_vs_XPR) or against another data-type (e.g. XPR_vs_CRISPR). Analysis of dependency relationships across many different data types is possible. For example: mutation, RNA-seq, proteomics, methylation data, histone marks, CRISPR scores, drug sensitivity, potentially metabolomics etc. This function takes as input either one dataset (for symmetrical analysis such as XPR_vs_XPR) or two datasets (non-symmetrical analysis such as XPR_vs_mutation).

Usage

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

Arguments

dataMatrix

A matrix in gene by sample format, where rownames typically correspond to genes (or other data features) and colnames correspond to sample names. May be omitted if mixModelClusters1 is provided.

dataMatrix2

Optional. A matrix where rownames correspond to genes (or other data features) and colnames correspond to sample names. If provided, the function will perform bidirectional analysis to assess associations between values in dataMatrix and dataMatrix2. If not provided, the function will perform one-directional analysis. May be omitted if mixModelClusters2 is provided.

mixModelClusters1

Optional. A pre-computed cluster list for data type 1, as produced by mts_mixModelCluster() (continuous data) or mts_formatMatrix() (categorical data, e.g. mutation impact). When supplied, dataMatrix and categorical1 are ignored. Exactly one of dataMatrix or mixModelClusters1 must be provided.

mixModelClusters2

Optional. A pre-computed cluster list for data type 2, as for mixModelClusters1. When supplied, dataMatrix2 and categorical2 are ignored.

categorical1

If TRUE, dataMatrix is treated as a categorical impact matrix and is processed with mts_formatMatrix() (which expects a numeric 1/2 matrix where 1 = HIGH impact / loss of function and 2 = LOW impact / wild type) instead of Gaussian mixture modelling. Ignored when mixModelClusters1 is supplied. Defaults to FALSE.

categorical2

As categorical1, but for dataMatrix2. Defaults to FALSE.

genepairs

Optional. If the argument is not called (left as NULL) then gene pairs will be generated based on the bidirectional or one directional 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 the function will exclusively predict synthetic lethal patterns (only analysing samples in the combination of the lowest value clusters for each gene pair). If set to FALSE the function will investigate all possible gene dependency patterns across all cluster combinations for each gene pair. Defaults to TRUE.

p_adjustMethod

The p.adjust method to adjust p-values for multiple comparisons. The adjustment methods include "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".

directionality

Considers directionality across the entire contingency table. Two options are available: "enrichment" and "depletion". For example when Synthetic Lethality occurs with CRISPR data we expect enrichment of samples in the bottom left contingency table cell while with other datatypes such as expression the expectation for Synthetic Lethality is a depletion of samples in the bottom-left contingency table cell. Defaults to "depletion".

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 TRUE.

qVal

A q value filter. 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

cores

The number of compute cores to use. Defaults to 1.

verbose

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

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_patternDetection

Examples

data(mixModelClusters_depMapXPR)
Unidirectional_depletion_SL_XPRvsXPR = mts_omics(
  mixModelClusters1 = mixModelClusters_depMapXPR,
  qVal=1,
  cores=1
)

data(depMapXPR_subset)
data(depMapCRISPRscores_subset)
Bidirectional_enrichment_SL_XPRvsCRISPR = mts_omics(
  dataMatrix = depMapCRISPRscores_subset[3,],
  dataMatrix2 = depMapXPR_subset[2,],
  directionality = "enrichment",
  qVal=1,
  cores=1
)

GDR_patternAnalysis_unidirectional_depletion_XPRvsXPR = mts_omics(
  dataMatrix = depMapXPR_subset[1:2,],
  SyntheticLethalityPrediction = FALSE,
  effectsize=FALSE,
  qVal=1,
  cores=1
)


# Mutation (categorical) with gene expression.
# depMapMUT_small contains string variant calls ("WT" or e.g. "p.R167W");
# convert to the 1/2 impact convention expected by mts_formatMatrix().


data(depMapMUT_small)
data(depMapXPR_small)
mutImpact <- as.data.frame(
  ifelse(as.matrix(depMapMUT_small) == "WT", 2L, 1L),
  stringsAsFactors = FALSE, check.names = FALSE)
rownames(mutImpact) <- rownames(depMapMUT_small)

SL_mut_vs_xpr = mts_omics(
  dataMatrix   = mutImpact,
  dataMatrix2  = depMapXPR_small[3,],
  categorical1 = TRUE,
  directionality = "depletion",
  qVal         = 1,
  effectsize   = FALSE,
  cores        = 1
)

# Or with pre-computed mutation 'clusters'
mutClusters <- mts_formatMatrix(matrix = mutImpact, cores = 1)
SL_mut_vs_xpr_pre = mts_omics(
  mixModelClusters1 = mutClusters,
  dataMatrix2       = depMapXPR_small[3,],
  directionality    = "depletion",
  qVal              = 1,
  effectsize        = FALSE,
  cores             = 1
)


# Using only mutation (or other categorical) data
data(depMapMUT_small)
mutImpactSmall <- as.data.frame( # make a binary matrix
  ifelse(as.matrix(depMapMUT_small) == "WT", 2L, 1L),
  stringsAsFactors = FALSE, check.names = FALSE)
rownames(mutImpactSmall) <- rownames(depMapMUT_small)

mutClasses <- mts_formatMatrix(matrix = mutImpactSmall[,1:5], cores = 1)

SL_mut_only = mts_omics(
  mixModelClusters1 = mutClasses,
  directionality    = "depletion",
  qVal              = 1,
  effectsize        = FALSE,
  cores             = 1
  )



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