Import Thor as:

import thor

API

fineST class for prediction of cellular level gene expression (thor)

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

Class for in silico cell gene expression inference

Preprocessing of histology images and spatial transcriptomics data (thor.pp)

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

Whole slide image class.

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

Class for spatial transcriptomics data.

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

Preprocess the image and extract features from the cells.

pp.load_nuclei([nuclei_path, source_format])

Load nuclei segmentation result from a file.

pp.load_cellpose(nuclei_path)

Load nuclei segmentation result from a cellpose output file.

pp.load_cellprofiler(nuclei_path)

Load nuclei segmentation result from a cellprofiler output file.

pp.load_mask_npz(nuclei_path)

Load nuclei segmentation result from a mask array npz file.

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

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

Visualization interface on images and spatial transcriptomics data (thor.pl)

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

Color the cells or nuclei with one variable, gene name, or any other observable (prepared img_mask as input).

pl.multiple(vars_list, img_masks_list[, ax, ...])

Color the cells or nuclei with multiple variables, gene or any observable (prepared `img_mask`s as input).

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

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

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

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

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

Color the cells or nuclei with cluster labels.

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

Plot spatial expression data with spots on top.

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

Annotate the ROI and baseline on the image.

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

Plot log2foldchange of gene expression against distance from the baseline.

Advanced analyses on fineST outputs (thor.analy)

analy.SPARKX([rscript_path])

Class for running SPARKX.

analy.analyze_gene_expression_gradient(adata)

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

analy.compute_dge_between_regions(ad_r1, ad_r2)

Compute differential gene expression (DGE) between two regions.

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

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

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

Infer TF activity using the CollecTRI database.

analy.read_polygon_ROI(json_path, adata[, ...])

Read polygon ROI from json file.

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

Run CopyKAT on the input data.

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

Convert AnnData object to matrix market format.

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

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