API

Import SCALEX:

import scalex

Function

SCALEX([data_list, batch_categories, ...])

Online single-cell data integration through projecting heterogeneous datasets into a common cell-embedding space

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

Label transfer

Data

Load data

data.load_data(data_list[, ...])

Load dataset with preprocessing

data.concat_data(data_list[, ...])

Concatenate multiple datasets along the observations axis with name batch_key.

data.load_files(root)

Load single cell dataset from files

data.load_file(path[, backed])

Load single cell dataset from file

data.read_mtx(path)

Read mtx format data folder including:

Preprocessing

data.preprocessing(adata[, profile, ...])

Preprocessing single-cell data

data.preprocessing_rna(adata[, ...])

Preprocessing single-cell RNA-seq data

data.preprocessing_atac(adata[, ...])

Preprocessing single-cell ATAC-seq

data.batch_scale(adata[, chunk_size])

Batch-specific scale data

data.reindex(adata, genes[, chunk_size])

Reindex AnnData with gene list

DataLoader

data.SingleCellDataset(adata[, use_layer])

Dataloader of single-cell data

data.BatchSampler(batch_size, batch_id[, ...])

Batch-specific Sampler sampled data of each batch is from the same dataset.

Net

Model

net.vae.VAE(enc, dec[, n_domain])

VAE framework

Layer

net.layer.DSBatchNorm(num_features, n_domain)

Domain-specific Batch Normalization

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

Basic block consist of:

net.layer.NN(input_dim, cfg)

Neural network consist of multi Blocks

net.layer.Encoder(input_dim, cfg)

VAE Encoder

Loss

net.loss.kl_div(mu, var)

net.loss.binary_cross_entropy(recon_x, x)

Utils

net.utils.onehot(y, n)

Make the input tensor one hot tensors

net.utils.EarlyStopping([patience, verbose, ...])

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

Plot

plot.embedding(adata[, color, color_map, ...])

plot separated embeddings with others as background

plot.plot_meta(adata[, use_rep, color, ...])

Plot meta correlations among batches

plot.plot_meta2(adata[, use_rep, color, ...])

Plot meta correlations between two batches

plot.plot_confusion(y, y_pred[, save, cmap])

Plot confusion matrix

Metric

Collections of useful measurements for evaluating results.

metrics.batch_entropy_mixing_score(data, batches)

Calculate batch entropy mixing score

metrics.silhouette_score(X, labels, *[, ...])

Compute the mean Silhouette Coefficient of all samples.

Logger

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