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.maincontains training and evaluation functionssrc\_trainer.preprocessingcontains data preprocessingsrc\_trainer.plottingcontains ModelEvaluation class and functions for plottingsrc\_trainer.SCVI\_modelcontains scVI model trained with RNAsrc\_trainer.TOTALVI\_modelcontains totalVI modelsrc\_trainer.cellPMVI\_modelcontains variants of cellPMVI model:cellPMVIwith isotropic normal prior (usescellPMVAEmodule)cellPMVI\_lpwith Laplace prior (usescellPMVAE\_lpmodule)
src\_trainer.cellPMVI\_CITESEQcontains adaption of cellPMVI model that is based on totalVI (usescellPMVVAE\_CITESEQmodule)src\_trainer.my\_base\_componentcontains cellPMVI encoder variantsrc\_trainer.my\_training\_plancontains own extension of training plansrc\_trainer.my\_vaecontains cellPMVI VAE variant
Additional files and folders:
notebookscontains notebooks to reproduce plots from the paper and detailed analysis of each modelscriptscontains the bash file for automatic running of the modelCPAnecessary adjustments to CPA to run with czi datainputcontains trained modelsdiff_expcontains each cell types csv file with p-value of the differential expression analysisdatacontains datasets in h5ap formatresultscontains 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