Developer
Benchmarking
|
Compute approximate k-nearest-neighbors graph. |
Data
|
Initialize edge-level and node-level training and validation dataloaders. |
|
Split a PyG Data object into training, validation and test PyG Data objects using an edge-level split. |
|
Split data on node-level into training, validation and test sets by adding node-level masks (train_mask, val_mask, test_mask) to the PyG Data object. |
|
Prepare data for model training including edge-level and node-level train, validation, and test splits. |
|
Spatially annotated torch dataset class to extract node features, node labels, adjacency matrix and edge indices in a standardized format from an AnnData object. |
Models
|
Helper to load saved model files. |
|
Helper to validate variable names. |
|
Helper to initialize a model. |
Modules
|
Variational Gene Program Graph Autoencoder class. |
VGAE module mix in class containing universal VGAE module functionalities. |
|
Base module mix in class containing universal module functionalities. |
|
Compute categorical covariates contrastive weighted binary cross entropy loss with logits. |
|
|
Compute edge reconstruction weighted binary cross entropy loss with logits using ground truth edge labels and predicted edge logits. |
Compute group lasso regularization loss for the masked decoder layer weights to enforce gene program sparsity (each gene program is a group; groups are normalized by the number of non-masked weights per group). |
|
|
Compute L1 regularization loss for the rna decoder weights of gene programs of the type ´gp_type´ to encourage gene sparsity of those gene programs. |
|
Compute Kullback-Leibler divergence as per Kingma, D. |
|
Compute omics reconstruction loss according to a negative binomial model, which is often used to model omics count data such as scRNA-seq or scATAC-seq data. |
NN
|
One-hop Attention Node Label Aggregator class that uses a weighted sum of the omics features of a node's 1-hop neighbors to build an aggregated neighbor omics feature vector for a node. |
|
One-hop GCN Norm Node Label Aggregator class that uses a symmetrically normalized sum of the omics feature vector of a node's 1-hop neighbors to build an aggregated neighbor omics feature vector for a node. |
|
One-hop Sum Node Label Aggregator class that sums up the omics features of a node's 1-hop neighbors to build an aggregated neighbor omics feature vector for a node. |
|
Cosine similarity graph decoder class. |
|
Fully connected omics feature decoder class. |
|
Masked omics feature decoder class. |
|
Encoder class. |
|
Masked linear class. |
|
Add-on masked layer class. |
Train
|
Trainer class. |
|
Get the evaluation metrics for a (balanced) sample of positive and negative edges and a sample of nodes. |
|
Plot evaluation metrics. |