Data Handling¶
SpaHDmap provides several functions and classes for handling spatial transcriptomics data. This module includes tools for data preparation, preprocessing, and feature selection.
- class SpaHDmap.data.STData(adata, section_name, radius, scale_rate=1.0, select_hvgs=True, gene_list=None, swap_coord=True, create_mask=True, image_type=None, color_norm=False)[source]¶
A class for handling and managing spatial transcriptomics data.
- Parameters:
adata (
AnnData) – AnnData object containing the spatial transcriptomics data.section_name (
str) – Name of the tissue section.radius (
float) – Radius of spots in original scale.scale_rate (
float) – Scale rate for adjusting coordinates and image size.select_hvgs (
bool) – Whether to select highly variable genes (HVGs) from the data.gene_list (
Optional[List[str]]) – List of genes to arrange the data by. If provided, select_hvgs will be set to False. Missing genes will be added with zero expression.swap_coord (
bool) – Whether to swap the x and y coordinates.create_mask (
bool) – Whether to create a mask for the image.image_type (
Optional[str]) – Type of the image (‘HE’ or ‘Immunofluorescence’). If None, will be auto-detected.color_norm (
bool) – Whether to apply Reinhard color normalization. Only works for H&E images.
|
Prepare an STData object from various data sources, with a specific loading priority. |
|
Select the top SVGs based on Moran's I or SPARK-X or BSP for a given section or list of sections. |