Calculate the number of transcripts per nucleus.
Arguments
- seu_obj
A Seurat object containing spatial transcriptomics data with metadata attributes including 'path' and 'platform' to identify the location and type of data. The object is expected to be annotated with sample identifiers and must have been preprocessed to include information on cellular localization of transcripts.
- features
An optional vector of feature names (genes) for which to calculate the mean transcripts per nucleus. If NULL (default), the function calculates this metric for all genes.
- tx_file
Path to tx file.
- platform
Platform.
Value
A data frame with the columns: sample_id
, platform
, and value
, where value
represents
the mean number of transcripts per nucleus across the specified features for the dataset.
This provides a focused view of nuclear gene expression.
Details
This function calculates the mean number of transcripts localized within the nucleus
for a specified set of features (genes) across all cells in a given dataset. This measurement
is specific to spatial transcriptomics data where the distinction between nuclear and cytoplasmic
transcript localization can be made. The function is designed to work with different platforms by
reading transcript localization data using a helper function readTxMeta
. If no features are
specified, the function defaults to using all available genes.