Skip to content

Commit

Permalink
more refences to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
katosh committed Aug 30, 2023
1 parent 56434e2 commit 99bb40f
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 8 deletions.
10 changes: 6 additions & 4 deletions docs/source/serialization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ density, refer to our
Deserialization from AnnData
----------------------------

The function `mellon.Predictor.from_dict` can deserialize the
The function :meth:`mellon.Predictor.from_dict` can deserialize the
:class:`mellon.Predictor` and any sub class.

.. code-block:: python
Expand All @@ -69,9 +69,10 @@ The function `mellon.Predictor.from_dict` can deserialize the
Serialization to File
---------------------

Mellon supports serialization to a human-readable JSON file and compressed file formats such as .gz (gzip) and .bz2 (bzip2).
Mellon supports serialization to a human-readable JSON file and compressed file
formats such as .gz (gzip) and .bz2 (bzip2).

The function `mellon.Predictor.from_json` can deserialize the
The function :meth:`mellon.Predictor.from_json` can deserialize the
:class:`mellon.Predictor` and any sub class.

.. code-block:: python
Expand All @@ -88,7 +89,8 @@ The function `mellon.Predictor.from_json` can deserialize the
Deserialization from File
-------------------------

Mellon supports deserialization from JSON and compressed file formats. The compression method can be inferred from the file extension.
Mellon supports deserialization from JSON and compressed file formats. The
compression method can be inferred from the file extension.

.. code-block:: python
Expand Down
110 changes: 107 additions & 3 deletions notebooks/time-series_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@
"source": [
"## Step 4: Density Evaluation and Plotting\n",
"\n",
"The cell-state density can be evaluated for any time point. For instance, we can evaluate the\n",
"The `density_predictor` is a subclass of the\n",
"[mellon.base_predictor.PredictorTime](https://mellon.readthedocs.io/en/latest/predictor.html#mellon.base_predictor.PredictorTime).\n",
"Thus the cell-state density can be evaluated for any time point. For instance, we can evaluate the\n",
"density for all cell states at stage E7.10 wich is notably not covered by a sample."
]
},
Expand Down Expand Up @@ -723,7 +725,11 @@
"\n",
"## Step 7: Saving the Predictor\n",
"\n",
"The density predictor can be serialized and saved for future use. It can be stored in the AnnData `uns` attribute, and the AnnData can be saved with the `write` method. The predictor can be reconstructed using the `from_dict` method of `mellon.Predictor`."
"The density predictor can be serialized and saved for future use.\n",
"It can be stored in the AnnData `uns` attribute, and the AnnData can be saved with the `write` method.\n",
"The predictor can be reconstructed using the\n",
"[from_dict](https://mellon.readthedocs.io/en/latest/predictor.html#mellon.Predictor.from_dict)\n",
"method of [mellon.Predictor](https://mellon.readthedocs.io/en/latest/predictor.html#mellon.Predictor)."
]
},
{
Expand Down Expand Up @@ -830,7 +836,105 @@
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"state": {
"009d4a832bc547eda98b7134b8bfa189": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "LayoutModel",
"state": {}
},
"0956b753c5db4344907cbdc9934269bd": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HTMLStyleModel",
"state": {
"description_width": "",
"font_size": null,
"text_color": null
}
},
"1b675b44738948378acc3e81a5a190e1": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_339b3c18a5a249ba93043baf40ec7e4f",
"IPY_MODEL_22e8e9adc7de4f88bdaae6afa680dc7c",
"IPY_MODEL_6ccb85f98c8e4378b7a9dc92691a001c"
],
"layout": "IPY_MODEL_7b4c74dd7d054a5c821a9a25958b1258"
}
},
"22e8e9adc7de4f88bdaae6afa680dc7c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_009d4a832bc547eda98b7134b8bfa189",
"max": 18684354899,
"style": "IPY_MODEL_fe530b4f59bb414796f46b1e5716f344",
"value": 18684354899
}
},
"339b3c18a5a249ba93043baf40ec7e4f": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_ee6bc90a82fb468c9cb840306406f599",
"style": "IPY_MODEL_0956b753c5db4344907cbdc9934269bd",
"value": "100%"
}
},
"604ee0f3c5c542c2a39e2d2ba52aa852": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HTMLStyleModel",
"state": {
"description_width": "",
"font_size": null,
"text_color": null
}
},
"6ccb85f98c8e4378b7a9dc92691a001c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_e0bae8abaf084635bc297e90a0330ad9",
"style": "IPY_MODEL_604ee0f3c5c542c2a39e2d2ba52aa852",
"value": " 17.4G/17.4G [16:58<00:00, 20.3MB/s]"
}
},
"7b4c74dd7d054a5c821a9a25958b1258": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "LayoutModel",
"state": {}
},
"e0bae8abaf084635bc297e90a0330ad9": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "LayoutModel",
"state": {}
},
"ee6bc90a82fb468c9cb840306406f599": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "LayoutModel",
"state": {}
},
"fe530b4f59bb414796f46b1e5716f344": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "2.0.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
}
},
"version_major": 2,
"version_minor": 0
}
Expand Down
4 changes: 3 additions & 1 deletion notebooks/trajectory-trends_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@
"id": "8129bf9a",
"metadata": {},
"source": [
"Palantir also offers a wrapper for the `mellon.FunctionEstimator` to run the trend computation on all branches simultaneously and store them in `ad.varm[\"gene_trends_<fate>\"]`:"
"Palantir also offers a wrapper for the\n",
"[`mellon.FunctionEstimator`](https://mellon.readthedocs.io/en/uncertainty/model.html#mellon.model.FunctionEstimator)\n",
"to run the trend computation on all branches simultaneously and store them in `ad.varm[\"gene_trends_<fate>\"]`:"
]
},
{
Expand Down

0 comments on commit 99bb40f

Please sign in to comment.