Skip to content

Commit 7c4cf57

Browse files
committed
update tutorial text for new API
1 parent 44cf068 commit 7c4cf57

3 files changed

Lines changed: 17 additions & 16 deletions

File tree

docs/notebooks/kang_analysis.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,13 @@
372372
"## Configuring and training a MOFA-FLEX model\n",
373373
"\n",
374374
"We now instantiate and train a single-group, single-view MOFA-FLEX model on the IFN-β–stimulated PBMC dataset.\n",
375-
"- Data input: The dataset is passed as one group (`group_1`) and one view (`view_1`) containing RNA expression values.\n",
376-
"- Data options: We disable per-group scaling (`scale_per_group=False`) since all samples belong to the same condition and reference, and we specify the key under which the binary gene-program annotations were stored (`annotations_varm_key=\"annotations\"`).\n",
377-
"- Model options: The model is configured with two latent factors and a Horseshoe prior, which enforces sparsity while allowing informative loadings for genes in the provided programs.\n",
375+
"- The model is configured with two latent factors and a Horseshoe prior, which enforces sparsity while allowing informative loadings for genes in the provided programs.\n",
378376
" These two latent factors will capture information that cannot be represented using our gene program collection.\n",
377+
" We specify the key under which the binary gene-program annotations were stored using the `annotations_varm_key` argument of the [InformedHorseshoe](#mofaflex.priors.InformedHorseshoe) prior.\n",
379378
" The total number of factors in the model will thus be 67: 65 gene programs plus two uninformed factors.\n",
380-
"- Training options: We set a fixed random seed for reproducibility."
379+
"- The dataset is passed as one group (`group_1`) and one view (`view_1`) containing RNA expression values.\n",
380+
"- We disable per-group scaling (`scale_per_group=False`) in the [Normal likelihood](#mofaflex.likelihoods.Normal), since all samples belong to the same condition and reference.\n",
381+
"- We set a fixed random seed for reproducibility."
381382
]
382383
},
383384
{

docs/notebooks/mofaflex_for_mofa_users_cll.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,15 @@
302302
"metadata": {},
303303
"source": [
304304
"## Train the model\n",
305-
"The model is automatically trained when a [MOFAFLEX](#mofaflex.MOFAFLEX) object is created.\n",
306-
"The [MOFAFLEX](#mofaflex.MOFAFLEX) constructor takes the data as its first argument and several objects containing the different settings as its following arguments in arbitrary order.\n",
305+
"We need to first [define a model](#mofaflex.terms.MofaFlex).\n",
307306
"For this tutorial, we will use 15 factors with a spike-and-slab prior and Gaussian likelihoods for all views.\n",
308-
"The spike-and-slab prior typically requires larger learning rates and longer training times than other priors, so we increase the learning rate to 0.01 and the early stopper patience to 1000 epochs.\n",
309307
"Note that we use `factor_init=\"pca\"`, which is the MOFA default{cite:p}`pmid32393329`.\n",
310308
"However, this may result in slow, memory-intensive preprocessing on large datasets.\n",
311309
"You may want to explore the `random` and `orthogonal` initialization options.\n",
312310
"\n",
311+
"The model is then trained by calling the [fit](#mofaflex.MOFAFLEX.fit) method.\n",
312+
"The spike-and-slab prior typically requires larger learning rates and longer training times than other priors, so we increase the learning rate to 0.01 and the early stopper patience to 1000 epochs.\n",
313+
"\n",
313314
"MOFA-FLEX infers the likelhoods for individual views automatically.\n",
314315
"You can also manually specify likelihoods using the `likelihoods` argument of [fit](#mofaflex.MOFAFLEX.fit)."
315316
]

docs/notebooks/mouse_citeseq_informed.ipynb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,17 +415,16 @@
415415
"source": [
416416
"## Configuring and training a MOFA-FLEX model\n",
417417
"\n",
418-
"We now configure and initialise MOFA-FLEX for multi-omic integration of the RNA and protein modalities.\n",
418+
"We now configure and train MOFA-FLEX for multi-omic integration of the RNA and protein modalities.\n",
419419
"Key configuration components include:\n",
420-
"- Data options: the RNA and protein modalities are treated as views of a single group (i.e. same cells).\n",
420+
"- `n_factors=3` specifies three uninformed latent factors.\n",
421+
" The uninformed factors will capture information that cannot be represented using our gene program collection.\n",
422+
" The total number of factors in the model will thus be 59: 56 gene programs plus three uninformed factors.\n",
423+
"- A Horseshoe prior promotes sparsity while allowing flexible sharing of signal across modalities.\n",
421424
" The `gene_set_mask` annotation is linked to the RNA view to guide factor learning using biological priors.\n",
422-
"- Model options:\n",
423-
" - `n_factors=3` specifies three uninformed latent factors.\n",
424-
" The uninformed factors will capture information that cannot be represented using our gene program collection.\n",
425-
" The total number of factors in the model will thus be 59: 56 gene programs plus three uninformed factors.\n",
426-
" - a Horseshoe prior promotes sparsity while allowing flexible sharing of signal across modalities,\n",
427-
" - both weights and factors are constrained to be non-negative for improved interpretability,\n",
428-
" - Gaussian (Normal) likelihoods are chosen for both modalities, reflecting continuous, normalised data.\n",
425+
"- Both weights and factors are constrained to be non-negative for improved interpretability.\n",
426+
"- Gaussian (Normal) likelihoods are chosen for both modalities, reflecting continuous, normalised data.\n",
427+
"- The RNA and protein modalities are treated as views of a single group (i.e. same cells).\n",
429428
"\n",
430429
"This configuration allows MOFA-FLEX to disentangle shared and modality-specific sources of variation, separating biological signal (e.g. cell-type programs) from technical or experimental noise."
431430
]

0 commit comments

Comments
 (0)