Skip to contents

It calculated mean expression per probe.

Usage

getMeanExpression(
  seu_obj = NULL,
  features = NULL,
  expMat = "path_to_expMatrix",
  platform = NULL
)

Arguments

seu_obj

A Seurat object. This object must have an RNA assay for target genes and a ControlProbe assay for control probes.

features

An optional vector of gene names for which to calculate mean expression. If NULL, mean expression is calculated for all genes in the RNA assay.

expMat

Path to exprMatrix file.

platform

The platform from which the data originates. Valid options are 'Xenium', 'CosMx', and 'Merscope'.

Value

A data frame with columns target (gene or control probe name), value (mean expression level), type (indicating whether the row represents a Gene or Control), platform, and sample_id.

Details

Computes the mean expression levels for a specified list of features (genes) and control probes within a Seurat object. This function separately calculates the mean expression for both target genes and control probes, then combines these results into a single data frame. If no features are specified, it defaults to all genes in the RNA assay.