Skip to main content
🔍

Statescope API Reference

Class: Statescope

Initialize Statescope

Statescope_model = Initialize_Statescope(Bulk, TumorType='NSCLC')

Parameters

ParameterTypeDescription
Bulkpandas.DataFrameBulk gene expression matrix (library-size-corrected counts).
TumorTypestrTumor type to select predefined signature (e.g., "NSCLC", "PDAC").
NcelltypesintNumber of cell types in the signature.
celltype_keystrKey to use for cell type in AnnData.
NcoresintNumber of cores to use for parallel computing.

Deconvolution Functions

FunctionDescription
Deconvolution()Performs Bayesian Log Normal Deconvolution.
Refinement()Refines gene expression after deconvolution.
StateDiscovery()Discovers cellular states using cNMF.

Deconvolution()

Statescope_model.Deconvolution()

Performs BLADE-based deconvolution on bulk RNA-seq data.


Construction and Initialization

FunctionDescription
Initialize_Statescope()Initializes the Statescope model with bulk data and signatures.
fetch_signature()Retrieves the precomputed signature matrix.
list_available_signatures()Lists all available signatures.

Initialize_Statescope()

Statescope_model = Initialize_Statescope(Bulk, TumorType="NSCLC")

Initializes the Statescope object.


Visualization Functions

FunctionDescription
Heatmap_Fractions()Plots a heatmap of deconvolution cell type fractions.
Heatmap_StateScores()Visualizes state scores in a heatmap.
Heatmap_GEX()Displays the gene expression matrix.
TSNE_AllStates()Performs t-SNE clustering for all states.
TSNE_CellTypes()Runs t-SNE per cell type.

Heatmap_Fractions()

Heatmap_Fractions(Statescope_model)

Plots a heatmap of cell type proportions per sample.


Utility Functions

FunctionDescription
Extract_GEX()Extracts purified gene expression for a given cell type.
Extract_StateScores()Extracts state scores per sample.
Extract_StateLoadings()Extracts state loadings for gene expression clustering.
Create_Cluster_Matrix()Generates scaled data matrices for clustering.

Extract_GEX()

Extract_GEX(Statescope_model, celltype="T_cells_CD8+")

Retrieves refined gene expression data per cell type.