Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix key in mtp.cell_transition #61

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions examples/plotting/300_sankey.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"source": [
"As with all plotting functionalities in {mod}`moscot`, we first call the {meth}`~moscot.problems.time.TemporalProblem.sankey` method of the problem class, which stores the results of the computation in the {class}`~anndata.AnnData` instance. Let us assume we want to plot the Sankey diagram across all time points 2, 3, 4, and 7 . Moreover, we want the Sankey diagram to visualize flows between cell types. In general, we can visualize the flow defined by any categorical column in {attr}`~anndata.AnnData.obs` via the `source_groups` and the `target_groups` parameters, respectively.\n",
"\n",
"In this example, we are interested in descendants as opposed to ancestors, which is why we choose `forward = True`. The information required to plot the Sankey diagram is provided in transition matrices, which we would obtain by `return_data = True`. Here, we are only interested in the visualization."
"In this example, we are interested in descendants as opposed to ancestors, which is why we choose `forward = True`. The information required to plot the Sankey diagram is provided in transition matrices, which are saved to {attr}`~anndata.AnnData.uns['moscot_results']['sankey']` by default. Here, we are only interested in the visualization."
]
},
{
Expand All @@ -134,7 +134,6 @@
" source_groups=\"cell_type\",\n",
" target_groups=\"cell_type\",\n",
" forward=True,\n",
" return_data=False,\n",
")"
]
},
Expand Down Expand Up @@ -206,10 +205,9 @@
" source_groups={\"cell_type\": [\"HSC\", \"MasP\", \"MkP\"]},\n",
" target_groups={\"cell_type\": [\"HSC\", \"MasP\", \"MkP\"]},\n",
" forward=True,\n",
" return_data=False,\n",
" key_added=new_key,\n",
")\n",
"mtp.sankey(tp, dpi=100, title=\"Cell type evolution over time\", uns_key=new_key)"
"mtp.sankey(tp, dpi=100, title=\"Cell type evolution over time\", key=new_key)"
]
}
],
Expand All @@ -223,7 +221,7 @@
"kernelspec": {
"display_name": "moscot",
"language": "python",
"name": "moscot"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -235,7 +233,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions tutorials/200_temporal_problem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
" figsize=(5, 5),\n",
" return_fig=True,\n",
" ax=axes[0],\n",
" uns_key=\"transitions_2_3\",\n",
" key=\"transitions_2_3\",\n",
")\n",
"\n",
"axes[1] = mtp.cell_transition(\n",
Expand All @@ -590,7 +590,7 @@
" figsize=(5, 5),\n",
" return_fig=True,\n",
" ax=axes[1],\n",
" uns_key=\"transitions_3_4\",\n",
" key=\"transitions_3_4\",\n",
")\n",
"\n",
"axes[2] = mtp.cell_transition(\n",
Expand All @@ -599,7 +599,7 @@
" figsize=(5, 5),\n",
" return_fig=True,\n",
" ax=axes[2],\n",
" uns_key=\"transitions_4_7\",\n",
" key=\"transitions_4_7\",\n",
")\n",
"\n",
"fig.subplots_adjust(wspace=0.4)"
Expand Down Expand Up @@ -866,7 +866,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
"version": "3.11.5"
},
"vscode": {
"interpreter": {
Expand Down
Loading