API documentation

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

Initial Setup

scSemiProfiler_dev.initial_setup.initsetup(…)

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_dev.get_eg_representatives.get_eg_representatives(name)

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

Single-cell Processing & Feature Augmentation

scSemiProfiler_dev.singlecell_process.scprocess(…)

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

Single-cell Inference

scSemiProfiler_dev.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_dev.representative_selection.activeselection(…)

Use active learning to select the next batch of representatives

Utils - Downstream Analysis

scSemiProfiler_dev.utils.estimate_cost(…)

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

scSemiProfiler_dev.utils.visualize_recon(…)

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

scSemiProfiler_dev.utils.visualize_inferred(…)

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

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

Visualize the training loss curves

scSemiProfiler_dev.utils.assemble_cohort(…)

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

scSemiProfiler_dev.utils.assemble_representatives(name)

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

scSemiProfiler_dev.utils.compare_umaps(semidata)

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

scSemiProfiler_dev.utils.compare_adata_umaps(…)

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

scSemiProfiler_dev.utils.celltype_proportion(…)

Compute the cell type proportion in a dataset

scSemiProfiler_dev.utils.composition_by_group(adata)

Visualizing the cell type composition in each group.

scSemiProfiler_dev.utils.geneset_pattern(…)

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

scSemiProfiler_dev.utils.celltype_signature_comparison(…)

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

scSemiProfiler_dev.utils.rrho(gtdata, …)

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

scSemiProfiler_dev.utils.enrichment_comparison(…)

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

scSemiProfiler_dev.utils.get_error(name)

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

scSemiProfiler_dev.utils.errorcurve(…[, …])

Visualize the error and cost as more representatives are sequenced.

Utils - Statistics

scSemiProfiler_dev.utils.comb(a, b)

Combination number

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

Returns the cdf of a hypergeometric test.

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

Returns the p-value of a hypergeometric test.

scSemiProfiler_dev.utils.faiss_knn(query, x)

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