From e773cc9f9f9d116c0b5a8a8c813c4d890743ca5c Mon Sep 17 00:00:00 2001 From: Martin Kim <46072231+martinkim0@users.noreply.github.com> Date: Fri, 2 Feb 2024 09:23:50 -0800 Subject: [PATCH] Correct and rerun hub intro tutorial (#221) --- hub/scvi_hub_intro_and_download.ipynb | 98 ++++++++++++++++----------- 1 file changed, 59 insertions(+), 39 deletions(-) diff --git a/hub/scvi_hub_intro_and_download.ipynb b/hub/scvi_hub_intro_and_download.ipynb index d78f605..6b2194c 100644 --- a/hub/scvi_hub_intro_and_download.ipynb +++ b/hub/scvi_hub_intro_and_download.ipynb @@ -17,7 +17,9 @@ "id": "c78df63c", "metadata": {}, "source": [ - "Uncomment the following lines in Google Colab in order to install `scvi-tools`:" + "```{note}\n", + "Running the following cell will install tutorial dependencies on Google Colab only. It will have no effect on environments other than Google Colab.\n", + "```" ] }, { @@ -25,12 +27,27 @@ "execution_count": 1, "id": "26d9e3c8", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/martinkim/bin/miniforge3/envs/scvi-11/lib/python3.11/site-packages/scvi_colab/_core.py:41: UserWarning: \n", + " Not currently in Google Colab environment.\n", + "\n", + " Please run with `run_outside_colab=True` to override.\n", + "\n", + " Returning with no further action.\n", + " \n", + " warn(\n" + ] + } + ], "source": [ - "# !pip install --quiet scvi-colab\n", - "# from scvi_colab import install\n", + "!pip install --quiet scvi-colab\n", + "from scvi_colab import install\n", "\n", - "# install()" + "install()" ] }, { @@ -53,11 +70,18 @@ "id": "ce72c6b4", "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Seed set to 0\n" + ] + }, { "name": "stdout", "output_type": "stream", "text": [ - "Last run with scvi-tools version: 1.0.3\n" + "Last run with scvi-tools version: 1.1.0rc2\n" ] } ], @@ -71,7 +95,9 @@ "id": "2e161542", "metadata": {}, "source": [ - "You can modify `save_dir` below to change where the data files for this tutorial are saved." + "```{note}\n", + "You can modify `save_dir` below to change where the data files for this tutorial are saved.\n", + "```" ] }, { @@ -308,7 +334,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "c62bff650893402387f2453e03750c93", + "model_id": "1ea49f2e748948ed951d11724087c5bc", "version_major": 2, "version_minor": 0 }, @@ -322,12 +348,12 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "6219bc54fb6548dfbdbf06736ade3349", + "model_id": "373dd1ad49a6458b9ea00ee1d0b4ec02", "version_major": 2, "version_minor": 0 }, "text/plain": [ - "Downloading (…)38b80e180/adata.h5ad: 0%| | 0.00/526k [00:00:119: FutureWarning: SparseDataset is deprecated and will be removed in late 2024. It has been replaced by the public classes CSRDataset and CSCDataset.\n", + "\n", + "For instance checks, use `isinstance(X, (anndata.experimental.CSRDataset, anndata.experimental.CSCDataset))` instead.\n", + "\n", + "For creation, use `anndata.experimental.sparse_dataset(X)` instead.\n", + "\n" ] }, { @@ -452,7 +492,7 @@ "AnnData object with n_obs × n_vars = 400 × 100\n", " obs: 'batch', 'labels', '_scvi_batch', '_scvi_labels'\n", " uns: '_scvi_manager_uuid', '_scvi_uuid', 'protein_names'\n", - " obsm: 'protein_expression'" + " obsm: 'accessibility', 'protein_expression'" ] }, "execution_count": 8, @@ -536,26 +576,6 @@ "\n", "Please browse the scvi-tools tutorials for explicit examples using scvi-hub in workflows." ] - }, - { - "cell_type": "markdown", - "id": "931009ca", - "metadata": {}, - "source": [ - "## Clean up\n", - "\n", - "Uncomment the following line to remove all data files created in this tutorial:" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "b9a1ddf8", - "metadata": {}, - "outputs": [], - "source": [ - "# save_dir.cleanup()" - ] } ], "metadata": { @@ -574,7 +594,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.7" }, "vscode": { "interpreter": {