API

Import the spapros API as follows:

import spapros as sp

Selection

Main Class

se.ProbesetSelector(adata, celltype_key[, ...])

General class for probeset selection.

Other Functions

se.select_reference_probesets(adata, n[, ...])

Select reference probesets with basic selection methods.

se.select_pca_genes(adata, n[, ...])

Select n features based on pca loadings.

se.select_DE_genes(adata, n[, per_group, ...])

Select genes based on wilxocon rank genes test.

Evaluation

Main Class

ev.ProbesetEvaluator(adata[, celltype_key, ...])

General class for probe set evaluation, comparison, plotting.

Other Functions

ev.get_metric_default_parameters()

Get the default metric parameters.

ev.forest_classifications(adata, selection)

Train best trees including secondary trees.

ev.single_forest_classifications(adata, ...)

Compute or load decision tree classification results.

Utility functions

Expression Constraints

ut.get_expression_quantile(adata[, q, ...])

Compute each genes q'th quantile on normalised (and log1p) data.

ut.transfered_expression_thresholds(adata[, ...])

Transfer expression thresholds between different normalisations.

ut.plateau_penalty_kernel(var[, x_min, x_max])

Return penalty function.

Spatial Data Analysis

Plotting

The sp.pl functions are used directly only in rare cases, instead always try to use the wrapper methods from the ProbesetEvaluator and ProbesetSelector (see 2nd table below).

pl.masked_dotplot(adata, selector[, ct_key, ...])

Create dotplot with additional annotation masks.

pl.clf_genes_umaps(adata, df[, basis, ...])

Plot umaps of genes needed for cell type classification of each cell type.

pl.selection_histogram(adata, ...[, ...])

Plot histogram of quantiles for selected genes for different penalty kernels.

pl.gene_overlap(selection_df[, style, ...])

Plot overlap of gene sets

pl.correlation_matrix(set_ids, cor_matrices)

Plot heatmap of gene correlation matrix.

pl.summary_table(table[, summaries, ...])

Plot table of summary statistics

pl.cluster_similarity(selections_info[, ...])

Plot cluster similarity as NMI over number of clusters

pl.knn_overlap(selections_info[, data, ...])

Plot mean knn overlap over k

pl.confusion_matrix(set_ids, conf_matrices)

Plot heatmap of cell type classification confusion matrices.

pl.marker_correlation(marker_corr[, ...])

Plot maximal correlations with marker genes

pl module

ProbesetSelector

ProbesetEvaluator

pl.masked_dotplot()

see pl.masked_dotplot for now

pl.clf_genes_umaps()

ProbesetSelector.plot_clf_genes()

pl.selection_histogram()

ProbesetSelector.plot_histogram()

pl.gene_overlap()

ProbesetSelector.plot_gene_overlap()

potentially added soon

pl.correlation_matrix()

ProbesetSelector.plot_coexpression()

ProbesetEvaluator.plot_coexpression()

pl.summary_table()

ProbesetEvaluator.plot_summary()

pl.cluster_similarity()

ProbesetEvaluator.plot_cluster_similarity()

pl.knn_overlap()

ProbesetEvaluator.plot_knn_overlap()

pl.confusion_matrix()

ProbesetEvaluator.plot_confusion_matrix()

pl.marker_correlation()

ProbesetEvaluator.plot_marker_corr()