API reference#

STDataset#

STDataset(count_df, coordinate_df[, ...])

STDataset: A meta class for discribing Spatial Transcriptomics data.

Load dataset from disk#

load_10X(read_path[, make_sparse])

Load 10X Genomics Space Ranger outputs and generate STDataset.

load_anndata_h5(read_path, **kwargs)

Load anndata saved h5ad file and generate STDataset.

Run svgbit within one function#

run(dataset[, k, n_svgs, n_svg_clusters, cores])

Run all part of svgbit within one function.

Filters#

filters.low_variance_filter(dataset[, var])

Filter genes with low variance.

filters.high_expression_filter(dataset[, ...])

Filter genes with high expression ratio.

filters.quantile_filter(dataset[, quantile])

Filter genes with quantile.

Normalizers#

normalizers.logcpm_normalizer(dataset)

Perform logcpm on dataset.

normalizers.cpm_normalizer(dataset)

Perform CPM on dataset.

Visualization#

plot.svg_heatmap(dataset[, save_path, ...])

Draw SVG distribution heatmap.

plot.spot_type_map(dataset[, save_path, ...])

Draw SVG type map.

plot.hotspot_distribution_map(dataset, cluster)

Draw hotspot distribution map for one SVG cluster.

plot.hotspot_expression(dataset, gene[, ...])

Draw hotspot expression for one gene.

plot.gene_expression(dataset, gene[, ...])

Draw expression for one gene.

plot.hotspot_colocalization_map(dataset, genes)

Draw hotspot expression for multiple genes.

Gene combinations#

find_combinations(dataset, center_spots[, ...])

Find gene pairs in certain SVG cluster.

STDataset Methods#

STDataset.acquire_weight([k])

Acquire weight for analysis.

STDataset.acquire_hotspot(**kwargs)

Acquire hotspot matrix.

STDataset.acquire_density([cores])

Acquire local Di and global AI value.

STDataset.find_clusters([n_svgs, ...])

Find SVG clusters.

STDataset Attributes#

STDataset.AI

A Series for AI value.

STDataset.Di

A DataFrame for local Di value.

STDataset.coordinate_df

Coordinate information.

STDataset.count_df

Expression matrix.

STDataset.svg_cluster

SVG cluster result.

STDataset.spot_type

A pd.DataFrame for spot type.

STDataset.genes

An Index for genes' names.

STDataset.hotspot_df

Hotspot matrix.

STDataset.n_genes

Number of total genes.

STDataset.n_spots

Number of total spots.

STDataset.spots

An Index for spots' names.

STDataset.weight

Weight used by svgbit.

STDataset.weight_type

What kind of weight is used.