muon.tl.mofa#

muon.tl.mofa(data: Union[anndata._core.anndata.AnnData, mudata._core.mudata.MuData], groups_label: Optional[bool] = None, use_raw: bool = False, use_layer: Optional[str] = None, use_var: Optional[str] = 'highly_variable', use_obs: Optional[str] = None, likelihoods: Optional[Union[str, List[str]]] = None, n_factors: int = 10, scale_views: bool = False, scale_groups: bool = False, center_groups: bool = True, ard_weights: bool = True, ard_factors: bool = True, spikeslab_weights: bool = True, spikeslab_factors: bool = False, n_iterations: int = 1000, convergence_mode: str = 'fast', use_float32: bool = False, gpu_mode: bool = False, svi_mode: bool = False, svi_batch_size: float = 0.5, svi_learning_rate: float = 1.0, svi_forgetting_rate: float = 0.5, svi_start_stochastic: int = 1, smooth_covariate: Optional[str] = None, smooth_warping: bool = False, smooth_kwargs: Optional[Mapping[str, Any]] = None, save_parameters: bool = False, save_data: bool = True, save_metadata: bool = True, seed: int = 1, outfile: Optional[str] = None, expectations: Optional[List[str]] = None, save_interrupted: bool = True, verbose: bool = False, quiet: bool = True, copy: bool = False)#

Run Multi-Omics Factor Analysis

Parameters
  • data – an MuData object

  • groups_label (optional) – a column name in adata.obs for grouping the samples

  • use_raw (optional) – use raw slot of AnnData as input values

  • use_layer (optional) – use a specific layer of AnnData as input values (supersedes use_raw option)

  • use_var (optional) – .var column with a boolean value to select genes (e.g. “highly_variable”), None by default

  • use_obs (optional) – strategy to deal with samples (cells) not being the same across modalities (“union” or “intersection”, throw error by default)

  • likelihoods (optional) – likelihoods to use, default is guessed from the data

  • n_factors (optional) – number of factors to train the model with

  • scale_views (optional) – scale views to unit variance

  • scale_groups (optional) – scale groups to unit variance

  • center_groups (optional) – center groups to zero mean (True by default)

  • ard_weights (optional) – use view-wise sparsity

  • ard_factors (optional) – use group-wise sparsity

  • spikeslab_weights (optional) – use feature-wise sparsity (e.g. gene-wise)

  • spikeslab_factors (optional) – use sample-wise sparsity (e.g. cell-wise)

  • n_iterations (optional) – upper limit on the number of iterations

  • convergence_mode (optional) – fast, medium, or slow convergence mode

  • use_float32 (optional) – use reduced precision (float32)

  • gpu_mode (optional) – if to use GPU mode

  • svi_mode (optional) – if to use Stochastic Variational Inference (SVI)

  • svi_batch_size (optional) – batch size as a fraction (only applicable when svi_mode=True, 0.5 by default)

  • svi_learning_rate (optional) – learning rate (only applicable when svi_mode=True, 1.0 by default)

  • svi_forgetting_rate (optional) – forgetting_rate (only applicable when svi_mode=True, 0.5 by default)

  • svi_start_stochastic (optional) – first iteration to start SVI (only applicable when svi_mode=True, 1 by default)

  • smooth_covariate (optional) – use a covariate (column in .obs) to learn smooth factors (MEFISTO)

  • smooth_warping (optional) – if to learn the alignment of covariates (e.g. time points) from different groups; by default, the first group is used as a reference, which can be adjusted by setting the REF_GROUP in smooth_kwargs = { “warping_ref”: REF_GROUP } (MEFISTO)

  • smooth_kwargs (optional) – additional arguments for MEFISTO (covariates_names, scale_cov, start_opt, n_grid, opt_freq, warping_freq, warping_ref, warping_open_begin, warping_open_end, sparseGP, frac_inducing, model_groups, new_values)

  • save_parameters (optional) – if to save training parameters

  • save_data (optional) – if to save training data

  • save_metadata (optional) – if to load metadata from the AnnData object (.obs and .var tables) and save it, False by default

  • seed (optional) – random seed

  • outfile (optional) – path to HDF5 file to store the model

  • expectations (optional) – which nodes should be used to save expectations for (will save only W and Z by default);

  • names (possible expectations) – nclude Y, W, Z, Tau, AlphaZ, AlphaW, ThetaW, ThetaZ

  • save_interrupted (optional) – if to save partially trained model when the training is interrupted

  • verbose (optional) – print verbose information during traing

  • quiet (optional) – silence messages during training procedure

  • copy (optional) – return a copy of AnnData instead of writing to the provided object