API and modules

Function

Run([adatas, adata_cm, mode, lambda_s, ...])

Run data integration

label_reweight(celltype)

Reweight labels to make all cell types share the same total weight

load_file(path)

Load single cell dataset from file

filter_data(adata[, min_features, ...])

Filter cells and genes

batch_scale(adata[, use_rep, chunk_size])

Batch-specific scale data

DataLoader

data_loader.SingleCellDataset(data, batch)

data_loader.SingleCellDataset_vertical(adatas)

data_loader.load_data(adatas[, mode, ...])

Load data for training.

Model

model.vae.VAE(enc, dec, ref_id, n_domain, mode)

Variational Autoencoder framework

model.layer.DSBatchNorm(num_features, n_domain)

Domain-specific Batch Normalization

model.layer.Block(input_dim, output_dim[, ...])

Basic block consist of:

model.layer.NN(input_dim, cfg)

Neural network consist of multi Blocks

model.layer.Encoder(input_dim, cfg, mode)

VAE Encoder

model.layer.Decoder(z_dim, cfg)

VAE Decoder

model.loss.kl_div(mu, var[, weight])

model.loss.distance_matrix(pts_src, pts_dst)

Returns the matrix of ||x_i-y_j||_p^p.

model.loss.distance_gmm(mu_src, mu_dst, ...)

Calculate a Wasserstein distance matrix between the gmm distributions with diagonal variances

model.loss.unbalanced_ot(tran, mu1, var1, ...)

Calculate a unbalanced optimal transport matrix between mini batches.

model.utils.onehot(y, n)

Make the input tensor one hot tensors

model.utils.EarlyStopping([patience, ...])

Early stops the training if loss doesn't improve after a given patience.

Evaluation

metrics.batch_entropy_mixing_score(data, batches)

Calculate batch entropy mixing score

metrics.silhouette(X, cell_type[, metric, scale])

Wrapper for sklearn silhouette function values range from [-1, 1] with

metrics.label_transfer(ref, query[, rep, label])

Label transfer

Logger

logger.create_logger([name, ch, fh, levelname])