Use cell2location infrastructure classes for Pyro and scvi-tools
mastercell2location utilizes a specialized infrastructure built on top of Pyro and scvi-tools to handle probabilistic modeling. The core functionality is divided into mixin classes for model behavior and module classes for model initialization and execution.
Base Mixin Classes
Found in cell2location.models.base._pyro_mixin, these classes provide shared functionality across different model types:
- AutoGuide setup: Automates the configuration of guides for variational inference.
- Posterior quantile computation: Methods for calculating quantiles from the posterior distribution.
- Plotting & export: Utilities for visualizing model results and exporting data.
scvi-tools Module Classes
These classes manage the lifecycle of the models, including initialization of the model and the guide. The primary base class is PyroBaseModuleClass.