summarize_batch_reduce_visium_hd: Summarize and reduce Visium HD data by batch

summarize_batch_reduce_visium_hdR Documentation

Summarize and reduce Visium HD data by batch

Description

This function processes and reduces spatial transcriptomics data from a Visium HD batch. It aggregates gene expression data across specified barcodes, groups the data by a new set of barcodes, and returns a summarized matrix.

Usage

summarize_batch_reduce_visium_hd(batch)

Arguments

batch

A list containing the following elements:

  • mtr: A matrix (sparse or dense) of gene expression counts, with genes as rows and barcodes as columns.

  • df: A data frame containing barcode information, including a column named barcodes and a column named barcodes_new for the grouping operation.

Details

The function performs the following steps:

  1. Subsets the count matrix to include only the barcodes listed in the data frame.

  2. Converts the subsetted count matrix to a data frame and merges it with the barcode data frame.

  3. Groups the data by the new barcode identifiers and sums the gene expression counts across these groups.

  4. Converts the summarized data back into a matrix format for further analysis.

Value

A matrix containing the aggregated gene expression data, with genes as columns and the new barcodes as rows. The values in the matrix represent the sum of gene expression counts for each gene across the grouped barcodes.


theMILOlab/SPATA2 documentation built on Feb. 8, 2025, 11:41 p.m.