Import Thor as:

import thor

Classes

Prediction of in silico cell gene expression

thor.fineST(image_path, name[, ...])

Class for in silico cell gene expression inference

Preprocessing of WSI

thor.pp.WholeSlideImage(image_path[, name, ...])

Whole slide image class.

Preprocessing of spatial transcriptomics

thor.pp.Spatial(name, st_dir[, image_path, ...])

Class for spatial transcriptomics data.

Example interface with external R packages

thor.analy.SPARKX([rscript_path])

Class for running SPARK-X.

API

Preprocessing

thor.pp.preprocess_image(image_path[, bbox, ...])

Preprocess the image and extract features from the cells.

thor.pp.load_nuclei([nuclei_path, source_format])

Load nuclei segmentation result from a file.

thor.pp.load_cellpose(nuclei_path)

Load nuclei segmentation result from a cellpose output file.

thor.pp.load_cellprofiler(nuclei_path)

Load nuclei segmentation result from a cellprofiler output file.

thor.pp.load_mask_npz(nuclei_path)

Load nuclei segmentation result from a mask array npz file.

thor.pp.nuclei_segmentation(image_path[, ...])

Segment nuclei from H&E stained images using stardist, cellpose or histocartography.

Advanced analyses

thor.analy.analyze_gene_expression_gradient(adata)

Analyze gene expression against a baseline in a selected region of interest (ROI).

thor.analy.compute_dge_between_regions(...)

Compute differential gene expression (DGE) between two regions.

thor.analy.get_pathway_score(adata[, layer, ...])

Calculate pathway score for each cell using over-representation analysis.

thor.analy.get_tf_activity(adata[, layer, ...])

Infer TF activity using the CollecTRI database.

thor.analy.read_polygon_ROI(json_path, adata)

Read polygon ROI from json file.

thor.analy.prepare_and_run_copykat(adata[, ...])

Run CopyKAT on the input data.

thor.analy.adata_to_mtx_conversion(adata[, ...])

Convert AnnData object to matrix market format.

thor.analy.run_commot(adata[, region, ...])

Run the cell-cell communication analysis using the modified COMMOT method.

Plotting

thor.pl.single(var_name, img_mask[, ax, ...])

Color the cells or nuclei with one variable, gene name, or any other observable.

thor.pl.multiple(vars_list, img_masks_list)

Color the cells or nuclei with multiple variables.

thor.pl.single_molecule(var, var_expression, ...)

Color the cells or nuclei with a variable, gene or any observable (gene expression vector as input).

thor.pl.multi_molecules(vars_list, ...[, ...])

Color the cells or nuclei with multiple variables, gene or any observable (gene expression array as input).

thor.pl.clusters(cluster_labels_list[, ...])

Color the cells or nuclei with cluster labels.

thor.pl.spot_over(ad, ad_spot[, spot_scale, ...])

Plot spatial expression data with spots on top.

thor.pl.annotate_ROI(im[, ROI_polygon, ...])

Annotate the ROI and baseline on the image.

thor.pl.deg([data, genes, ...])

Plot log2foldchange of gene expression against distance from the baseline.

thor.pl.fringe([data, genes, cmap, lw, ...])

Plot log2foldchange of gene expression against distance from the baseline.