Functional API (Low-level)

Functional API (Low-level)#

Data#

Built-in Data#

builtin_data.get_data(dataset[, save_path, ...])

Used to download data for tutorials.

Tools#

real_data.MetadataConverter(metadata_df)

Class used to convert numerical torch tensors into categorical equivalents.

real_data.AnndataConverter(metadata_df)

Class used to convert tensor datasets into an AnnData object.

real_data.construct_labels(counts, metadata, ...)

Function to generate conditional labels for the various models included.

real_data.distrib_dataset(dataset, levels[, ...])

Function that distributes the TensorDataset generated by construct_labels.

real_data.preprocess_anndata(anndat)

Function to preprocess the inputted AnnData object.

Models#

scvi_variants.Patches(num_genes, l_loc, ...)

Patches, the multi-attribute model.

scvi_variants.SCVI(num_genes, l_loc, l_scale)

scVI (https://www.nature.com/articles/s41592-018-0229-2), implemented through pyro.

scvi_variants.SCANVI(num_genes, l_loc, ...)

Supervised scANVI (https://www.embopress.org/doi/full/10.15252/msb.20209620), implemented through pyro.

Scripts#

Metrics#

metrics.get_normalized_profile(point_dataset)

Used to get library-size normalized pseudobulk profile from group of cells.

metrics.gen_profile_reproduction(...[, ...])

Used to generate new points by performing a full pass through the models.

metrics.get_reproduction_error(...[, ...])

Calculates the model generative error for the given metric.

metrics.calc_asw(anndata, test_for, embed)

Calculates the normalized Average Silhouette Width (ASW).

metrics.kmeans_ari(anndata, test_for, embed)

Calculates the K-Means ARI for latent representations.

metrics.kmeans_nmi(anndata, test_for, embed)

Calculates the K-Means NMI for latent representations.

metrics.knn_error(anndata, test_for, embed)

Calculates KNN classifier accuracy on embeddings.

Training#

training.get_device()

Prints currently used device.

training.train_pyro(model, train_loader, ...)

Runner for basic Pyro models.

training.train_pyro_disjoint_param(model, ...)

Runner for Patches, but can be used for other adversarial models.