thor.pp.Spatial

class thor.pp.Spatial(name, st_dir, image_path=None, save_dir=None)[source]

Bases: object

Class for spatial transcriptomics data. This class is used to minimally process spatial transcriptomics data.

Parameters:
  • name (str) – Name of the spatial transcriptomics data.

  • st_dir (str) – Path to the directory containing the spatial transcriptomics data. This directory should contain the 10x spaceranger output.

  • image_path (str, optional) – Path to the full-size image file used for spatial transcriptomics.

  • save_dir (str, optional) – Path to the directory where the processed spatial transcriptomics data will be saved.

Methods

process_transcriptome

Process the spatial transcriptome data (sequence-based).

process_transcriptome(perform_QC=True, min_cells=10, min_counts=1000, max_counts=35000, max_mt_pct=20, max_rb_pct=100)[source]

Process the spatial transcriptome data (sequence-based). This function will read the 10x spaceranger output and perform basic preprocessing steps.

Parameters:
  • perform_QC (bool, optional) – Whether to perform quality control. Default is True.

  • min_cells (int, optional) – Minimum number of cells. Default is 10.

  • min_counts (int, optional) – Minimum number of counts. Default is 1000.

  • max_counts (int, optional) – Maximum number of counts. Default is 35000.

  • max_mt_pct (float, optional) – Maximum percentage of mitochondrial genes. Default is 20.

  • max_rb_pct (float, optional) – Maximum percentage of ribosomal genes. Default is 100.

Note

It is recommended that this preprocessing step is done by the users using Scanpy or Seurat. This function only provides very basic level of preprocessing following Scanpy. Please refer to the Scanpy documentation.