API Documentations
Import UNAGI:
from UNAGI import UNAGI
Documentaions for the UNAGI package.
UNAGI launcher
The UNAGI class is the main class of UNAGI. It contains the function to prepare the data, start the model training and start analysing the perturbation results.
The function to specify the data directory, the attribute name of the stage information and the total number of time stages of the time-series single-cell data. |
|
Set up the training parameters and the model parameters. |
|
The function to calculate the cell graphs for each stage. |
|
The function to register the parameters for the CPO analysis. |
|
The function to register the parameters for the iDREM analysis. |
|
The function to register the species of the single-cell data. |
|
The function to launch the model training. |
The model architecture of UNAGI
The module contains the VAE model and the discriminator model.
Trainer of UNAGI
The modules to start the training of UNAGI.
The UNAGI_runner class is used to set up the hyperparameters to run iDREM, find clustering optimal parameters and run the UNAGI model . |
|
The customized elbo to support the VAE and discriminator loss. |
Dynamic graphs
Construct the dynamic graphs for the given data.
Calculate the distance between two nodes.
calculate KL divergence of multivariate gaussian distributions between two clusters. |
|
calculate the differential gene similarity between two clusters. |
|
Normalize the kl divergence distance and top differential gene distances. |
Build the dynamic graphs.
calculate the distance between two stages |
|
calculate the distance between two stages and connect the clusters in two stages with smallest distance with midpath in iterative training |
|
update gaussian and gamma rep, top 100 differential genes, cell types of clusters to anndata |
|
updata edges to the anndata database, calculate edges changes. |
Dynamic regulatory networks
Reconstruct the dynamic regulatory networks using iDREM for the dynamic graphs.
train IDREM model and save the results in iterative training with midpath and iteration |
Gene weights accumulation
Identify dynamic genes and accumulate gene weights.
|
update gene weights and decay the weight of genes that are not important in this iteration |
Perturbations
Perform perturbations using compounds/drugs or pathways, analyze the perturbation results.
Get top compounds predictions after compound perturbations at a given intensity. |
|
Get top pathways predictions after pathway perturbations at a given intensity. |
|
|
Analyse the online perturbation results. |
|
The main function to analyse the perturbation results. |
Perform perturbation. |
|
|
Perform online perturbation. |
|
Start the perturbation analysis. |
|
Start the perturbation analysis (online version). |
Analyse pertubration results
The analyst class is the class to perform downstream analysis. |
|
Perform downstream tasks including dynamic markers discoveries, hierarchical markers discoveries, pathway perturbations and compound perturbations. |
Marker discovery
UNAGI supports to discover dynamic markers (temporal) and hierarchical markers (static).
Dynamic markers
|
Get the top markers for each track from IDREM results. |
|
Get the top markers for each track from IDREM results and consider the whole background as one distribution. |
|
Get the top markers for each track from IDREM results and save as a csv file. |
|
Get the top markers for each track from IDREM results. |
|
Calculate the p-value of the input gene expression change based on the background gene expression change. |
Hierarchical static markers
|
Perform hierarchical clustering on the dataset and get the hierarchical clustering markers for each stage. |
Plottings
Functions to visualize the outputs of UNAGI, including cell type compositions, latent representations, the heatmaps of hierarchical markers, and dendrogram of individual stages.
The plotting module contains functions for visualizing the results of UNAGI.
|
Plot the latent representation of the cells colored by cell type and leiden clusters. |
The color scheme the cell types are plotted with. |
|
|
Plot the cell type composition of each stage |
Plot the dendrogram of the hierarchical static markers of each stage. |
|
|
Plot the heatmap of the hierarchical static markers of the chosen cluster and its siblings. |