API documentation

This section provides detailed API documentation for all public functions and classes in seSemiProfiler.

Initial Setup

scSemiProfiler.initial_setup.initsetup(name, …)

Initial setup of the semi-profiling pipeline, including processing the bulk data, clustering for finding the initial representatives.

Get Representatives Single-cell (used in example)

scSemiProfiler.get_eg_representatives.get_eg_representatives(name)

Used for acquiring representatives’ single-cell data in the example.

Single-cell Processing & Feature Augmentation

scSemiProfiler.singlecell_process.scprocess(…)

Process the reprsentatives’ single-cell data, including preprocessing and feature augmentations.

Single-cell Inference

scSemiProfiler.inference.tgtinfer(name, …)

Computationally infer the single-cell data of a single non-representative target sample based on a representatives’ single-cell data and bulk data of both samples.

scSemiProfiler.inference.scinfer(name, …)

Computationally infer the single-cell data of all non-representative samples (target samples) based on the cohort’s bulk data and the representatives’ single-cell data

Representatives Selection

scSemiProfiler.representative_selection.activeselection(…)

Use active learning to select the next batch of representatives

Global Mode

scSemiProfiler.utils.inspect_data(bulk[, …])

To accommodate users who prefer all-in-one-batch profiling, we have developed hits new function.

scSemiProfiler.utils.global_stop_checking(…)

Checking if further representative selection is needed for the global mode.

Utils - Downstream Analysis

scSemiProfiler.utils.estimate_cost(…)

Estimate the cost of semi-profiling and real-profiling.

scSemiProfiler.utils.visualize_recon(name, …)

Visualize the performance of reconstruction by plotting the original and reconstructed data in the same UMAP.

scSemiProfiler.utils.visualize_inferred(…)

Visualize the inference performance by plotting the representative, inferred target, and target ground truth in the same UMAP.

scSemiProfiler.utils.loss_curve(name[, …])

Visualize the training loss curves

scSemiProfiler.utils.assemble_cohort(name, …)

Assemble inferred sample data and representative sample data into semi-profiled cohort and annotate the celltype.

scSemiProfiler.utils.assemble_representatives(name)

Assemble previous round of inferred representative data and annotate the cell type.

scSemiProfiler.utils.compare_umaps(semidata)

Compare the real-profiled and semi-profiled datasets by plotting them in a same UMAP

scSemiProfiler.utils.compare_adata_umaps(…)

Compare the real-profiled and semi-profiled datasets by plotting them in a same UMAP

scSemiProfiler.utils.celltype_proportion(…)

Compute the cell type proportion in a dataset

scSemiProfiler.utils.composition_by_group(adata)

Visualizing the cell type composition in each group.

scSemiProfiler.utils.geneset_pattern(adata, …)

Generate heatmaps for visualizing gene set activation pattern in a dataset.

scSemiProfiler.utils.celltype_signature_comparison(…)

Use dotplot to compare the cell type signatures found using the real-profiled dataset and the semi-profiled datset.

scSemiProfiler.utils.rrho(name, gtdata, …)

Use RRHO graph to compare the positive and negative markers found using real-profiled and semi-profiled datasets.

scSemiProfiler.utils.enrichment_comparison(…)

Compare the enrichment analysis results using the real-profiled and semi-profiled datasets.

scSemiProfiler.utils.get_error(name[, scpath])

Conclude the semi-profiling history of a project and output the erros, upperbounds, and lower bounds, which are necessary for overall performance evaluation.

scSemiProfiler.utils.errorcurve(upperbounds, …)

Visualize the error and cost as more representatives are sequenced.

Utils - Statistics

scSemiProfiler.utils.comb(a, b)

Combination number

scSemiProfiler.utils.hyperp(N, n1, n2, k)

Returns the pmf of a hypergeometric test.

scSemiProfiler.utils.hypert(N, n1, n2, k)

Returns the p-value of a hypergeometric test.

scSemiProfiler.utils.faiss_knn(query, x[, …])

Compute distances from a vector to its K-nearest neighbros in a matrix.