Skip to contents

The computeReactionActivityScores function computes reaction activity scores for a custom dataset using the provided metabolic network, training data geometric means, and other parameters. It integrates gene expression data with the metabolic network to derive reaction activity scores, transition probabilities, and adjusted reaction activity matrices.

Usage

computeReactionActivityScores(
  counts = NULL,
  metadata = NULL,
  dds = NULL,
  mgraph,
  geom
)

Arguments

counts

A data frame or matrix containing raw unnormalized RNA-Seq gene counts. Columns are samples, rows are genes.

metadata

A data frame containing sample metadata. Required if counts is provided.

dds

A DESeqDataSet object. If provided, counts and metadata are ignored.

mgraph

The graph object representing the metabolic network.

geom

A named numeric vector containing the geometric means of the training dataset.

Value

A list containing various Reaction Activity scores computed for the custom dataset based on the provided metabolic network and training data.

custom_coldata The modified sample metadata corresponding to the custom dataset.

ras The original Reaction Activity matrix computed for the custom dataset.

ras_prob The Reaction Activity matrix adjusted by transition probabilities.

ras_prob_path The Reaction Activity matrix adjusted by transition probabilities considering a target node.

ras_prob_rec The Reaction Activity matrix adjusted by transition probabilities with a recursive adjustment method.

ras_prob_up The Reaction Activity matrix adjusted by adding transition probabilities.

ras_prob_up_path The Reaction Activity matrix adjusted by adding transition probabilities considering a target node.

ras_prob_up_rec The Reaction Activity matrix adjusted by adding transition probabilities with a recursive adjustment method.

Details

This function integrates gene expression data with a metabolic network to compute reaction activity scores. It estimates size factors for the custom dataset based on the geometric means of the training dataset and normalizes the gene expression data accordingly. The function then computes Reaction Activity scores and transition probabilities for the custom dataset using the provided metabolic network. Various adjustments are applied to the Reaction Activity scores to derive different metrics, including those considering transition probabilities, target nodes, and recursive adjustment methods.

Examples

if (FALSE) { # \dontrun{
# Load necessary data
geom <- readRDS("./SVM_GD2_dashboard/data/geom_train_data.Rds")
custom_counts <-
  read.table("SVM_GD2_dashboard/data/datasets/custom_counts.tsv", sep = "\t", header = TRUE)
custom_coldata <-
  read.table("SVM_GD2_dashboard/data/datasets/custom_metadata.tsv", sep = "\t", header = TRUE)
mgraph <- load_metabolic_network("path/to/metabolic_network.graphml")

# Compute Reaction Activity scores for the custom dataset
reaction_activity <- computeReactionActivityScores(custom_counts, custom_coldata, mgraph, geom)
} # }