Calculate the Mean Transcripts per Unit Area.
Usage
getTxPerArea(
seu_obj = NULL,
features = NULL,
platform = NULL,
cellSegMeta = "path_to_cellMeta",
tx_file = NULL,
exp_file = "path_to_exp_mtx"
)
Arguments
- seu_obj
A Seurat object. The object must have 'sample_id' and 'platform' metadata for identification and reporting. It is expected that
seu_obj$cell_area
contains the area information for each cell.- features
An optional vector of feature names (e.g., gene symbols) for which to calculate transcripts per unit area. Defaults to NULL, which means the calculation uses all available features in the RNA assay of the Seurat object.
- platform
The platform from which the data originates. Valid options are 'Xenium', 'CosMx', and 'Merscope'.
- cellSegMeta
Path to CellsegMeta file.
- tx_file
Path to transcription file.
Value
Returns a data frame with three columns: sample_id
, platform
, and value
. The value
column contains
the computed mean number of transcripts per unit area for the selected features across all cells in the dataset.
This data frame provides a concise summary of transcriptional activity normalized by cell size, which can be
critical for downstream analyses, especially in studies where cell morphology and size are variable.
Details
This function calculates the mean number of transcripts per unit area for specified features (genes) in a Seurat object. If no features are specified, the function defaults to using all targets within the RNA assay of the provided Seurat object. This calculation provides insight into the density of transcriptional activity relative to cell area, offering a normalized measure of gene expression that accounts for differences in cell size.