This code accompanies the master thesis Predicting immune responses on multi-modal single-cell data with variational inference
(https://repository.tudelft.nl/islandora/object/uuid%3A1b24699a-3967-4b08-9316-dae8d9577222?collection=education).
Author: Francesca Drummer
Supervisors: Dr. Ahmed Mahfouz and Mikhael Manurung
The repository is centered around the scr_trainer module in the new_model folder:
src\_trainer.main
contains training and evaluation functionssrc\_trainer.preprocessing
contains data preprocessingsrc\_trainer.plotting
contains ModelEvaluation class and functions for plottingsrc\_trainer.SCVI\_model
contains scVI model trained with RNAsrc\_trainer.TOTALVI\_model
contains totalVI modelsrc\_trainer.cellPMVI\_model
contains variants of cellPMVI model:cellPMVI
with isotropic normal prior (usescellPMVAE
module)cellPMVI\_lp
with Laplace prior (usescellPMVAE\_lp
module)
src\_trainer.cellPMVI\_CITESEQ
contains adaption of cellPMVI model that is based on totalVI (usescellPMVVAE\_CITESEQ
module)src\_trainer.my\_base\_component
contains cellPMVI encoder variantsrc\_trainer.my\_training\_plan
contains own extension of training plansrc\_trainer.my\_vae
contains cellPMVI VAE variant
Additional files and folders:
notebooks
contains notebooks to reproduce plots from the paper and detailed analysis of each modelscripts
contains the bash file for automatic running of the modelCPA
necessary adjustments to CPA to run with czi datainput
contains trained modelsdiff_exp
contains each cell types csv file with p-value of the differential expression analysisdata
contains datasets in h5ap formatresults
contains the csv and pickle files after model evaluation
There are two options for executing the main file: 1) Training and 2) Evalution of a trained model.
The first argument --func
defines which of them gets executed:
-
--func train\_model
-
--func evaluate\_model
Mandatory arguments
--dataset\_path
: Respective location of .h5ad data to load--model\_type
: Type of model to train. There are four different available types of models:SCVI\_RNA
: scvi model with RNA dataSCVI\_protein
: scvi model with protein dataMMVAE
: MMVAE model with one encoder for each RNA and proteinTotalVI
: default TotalVI model from scvi-tools
Mandatory arguments:
--filename
: model name (DATE combination)--model\_type
: Type of model to evaluate--training\_scenario
: Training scenario 1,2, or 3 for evaluation