diff --git a/docs/notebooks/tabula_sapiens_tutorial.ipynb b/docs/notebooks/tabula_sapiens_tutorial.ipynb
index c63ddb2..03dd337 100644
--- a/docs/notebooks/tabula_sapiens_tutorial.ipynb
+++ b/docs/notebooks/tabula_sapiens_tutorial.ipynb
@@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
- ""
+ ""
]
},
{
@@ -38,6 +38,7 @@
"- scVI [(Lopez et al. 2018)](https://www.nature.com/articles/s41592-018-0229-2)\n",
"- bbKNN [(Polański et al. 2020)](https://academic.oup.com/bioinformatics/article/36/3/964/5545955)\n",
"- Scanorama [(He et al. 2019)](https://www.nature.com/articles/s41587-019-0113-3)\n",
+ "- Harmony [(Korsunsky et al. 2019)](https://www.nature.com/articles/s41592-019-0619-0)\n",
"\n",
"Annotation Methods:\n",
"- KNN on integrated spaces\n",
@@ -51,7 +52,7 @@
"\n",
"**User action is only required in Steps 1-3.**\n",
"\n",
- "Last edited: 6/27/2021\n",
+ "Last edited: 08/27/2024\n",
"\n"
]
},
@@ -70,34 +71,10 @@
{
"cell_type": "code",
"execution_count": 1,
- "id": "GXsE8GgGhXOm",
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "GXsE8GgGhXOm",
- "outputId": "85d58497-b865-4ace-c9d6-ab1a2f5d753f"
- },
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "\u001b[0m\u001b[01;34msample_data\u001b[0m/\n"
- ]
- }
- ],
- "source": [
- "ls"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 19,
"id": "h41Q6U5wMwyP",
"metadata": {
"id": "h41Q6U5wMwyP",
- "outputId": "9729039b-88d1-49ca-ee8a-e6dbfde86237",
+ "outputId": "03c4cf1b-7fde-4628-cb87-012a39e33360",
"colab": {
"base_uri": "https://localhost:8080/"
}
@@ -108,13 +85,13 @@
"name": "stdout",
"text": [
"Cloning into 'PopV'...\n",
- "remote: Enumerating objects: 1125, done.\u001b[K\n",
- "remote: Counting objects: 100% (384/384), done.\u001b[K\n",
- "remote: Compressing objects: 100% (225/225), done.\u001b[K\n",
- "remote: Total 1125 (delta 175), reused 298 (delta 140), pack-reused 741\u001b[K\n",
- "Receiving objects: 100% (1125/1125), 280.35 MiB | 22.14 MiB/s, done.\n",
- "Resolving deltas: 100% (645/645), done.\n",
- "Updating files: 100% (68/68), done.\n"
+ "remote: Enumerating objects: 1215, done.\u001b[K\n",
+ "remote: Counting objects: 100% (474/474), done.\u001b[K\n",
+ "remote: Compressing objects: 100% (212/212), done.\u001b[K\n",
+ "remote: Total 1215 (delta 245), reused 435 (delta 238), pack-reused 741 (from 1)\u001b[K\n",
+ "Receiving objects: 100% (1215/1215), 282.87 MiB | 15.42 MiB/s, done.\n",
+ "Resolving deltas: 100% (715/715), done.\n",
+ "Updating files: 100% (66/66), done.\n"
]
}
],
@@ -145,19 +122,33 @@
"id": "MlQ3oQoRtd1C"
},
"source": [
- "## Restart the Runtime after installation (User Action Required)\n",
+ "## Restart the Session after installation (User Action Required)\n",
"\n",
- "Runtime -> \"Restart runtime\""
+ "Runtime -> \"Restart session\""
]
},
{
"cell_type": "code",
- "execution_count": 32,
+ "execution_count": 1,
"id": "935b37ea-29ee-4134-b793-fb1be48d1156",
"metadata": {
- "id": "935b37ea-29ee-4134-b793-fb1be48d1156"
+ "id": "935b37ea-29ee-4134-b793-fb1be48d1156",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "outputId": "37f0b213-6927-42e8-c0f9-1e394a20ceae"
},
- "outputs": [],
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "WARNING:tensorflow:From /usr/local/lib/python3.10/dist-packages/tensorflow/python/compat/v2_compat.py:98: disable_resource_variables (from tensorflow.python.ops.resource_variables_toggle) is deprecated and will be removed in a future version.\n",
+ "Instructions for updating:\n",
+ "non-resource variables are not supported in the long term\n"
+ ]
+ }
+ ],
"source": [
"%%capture\n",
"import popv\n",
@@ -203,7 +194,7 @@
"id": "db0a86c6",
"metadata": {
"id": "db0a86c6",
- "outputId": "82c4c5d6-137d-465c-c179-6756ec8d16ab",
+ "outputId": "c6fd82d4-8ec6-498b-a4b9-5204e85d7668",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 36
@@ -251,7 +242,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "lkm3ELAfV8-D",
- "outputId": "0f3aa991-80d4-4c42-9991-ffbe863896cc"
+ "outputId": "4e92d0c5-4058-484c-e56c-dfbc5215b6df"
},
"outputs": [
{
@@ -259,25 +250,29 @@
"name": "stdout",
"text": [
"downloading\n",
- "--2024-02-20 02:12:52-- https://www.dropbox.com/s/mrf8y7emfupo4he/LCA.h5ad?dl=1\n",
- "Resolving www.dropbox.com (www.dropbox.com)... 162.125.1.18, 2620:100:6016:18::a27d:112\n",
- "Connecting to www.dropbox.com (www.dropbox.com)|162.125.1.18|:443... connected.\n",
+ "--2024-08-29 03:31:42-- https://www.dropbox.com/s/mrf8y7emfupo4he/LCA.h5ad?dl=1\n",
+ "Resolving www.dropbox.com (www.dropbox.com)... 162.125.81.18, 2620:100:6031:18::a27d:5112\n",
+ "Connecting to www.dropbox.com (www.dropbox.com)|162.125.81.18|:443... connected.\n",
"HTTP request sent, awaiting response... 302 Found\n",
- "Location: /s/dl/mrf8y7emfupo4he/LCA.h5ad [following]\n",
- "--2024-02-20 02:12:53-- https://www.dropbox.com/s/dl/mrf8y7emfupo4he/LCA.h5ad\n",
+ "Location: https://www.dropbox.com/scl/fi/5henh04air005wccgxbje/LCA.h5ad?rlkey=yqw49zvvkipjfo5a92tkyan6v&dl=1 [following]\n",
+ "--2024-08-29 03:31:43-- https://www.dropbox.com/scl/fi/5henh04air005wccgxbje/LCA.h5ad?rlkey=yqw49zvvkipjfo5a92tkyan6v&dl=1\n",
"Reusing existing connection to www.dropbox.com:443.\n",
"HTTP request sent, awaiting response... 302 Found\n",
- "Location: https://uc8559b7d1230cbe8280dbdb40c1.dl.dropboxusercontent.com/cd/0/get/CNmqGELI26Q5-Hphnw6GatdGPX3L-tf6Hltq_uzPVGTYhUj2CMylLRVI4g5sqRnNpBXRuAwjENGtfsUWEYK1jXRzj9u4oR2a1Xfd_1AnNI_7YrWFPRNCNU4-YtN7uaxTsHr4lS8XNN9mFgd7w6cxv0tK/file?dl=1# [following]\n",
- "--2024-02-20 02:12:53-- https://uc8559b7d1230cbe8280dbdb40c1.dl.dropboxusercontent.com/cd/0/get/CNmqGELI26Q5-Hphnw6GatdGPX3L-tf6Hltq_uzPVGTYhUj2CMylLRVI4g5sqRnNpBXRuAwjENGtfsUWEYK1jXRzj9u4oR2a1Xfd_1AnNI_7YrWFPRNCNU4-YtN7uaxTsHr4lS8XNN9mFgd7w6cxv0tK/file?dl=1\n",
- "Resolving uc8559b7d1230cbe8280dbdb40c1.dl.dropboxusercontent.com (uc8559b7d1230cbe8280dbdb40c1.dl.dropboxusercontent.com)... 162.125.1.15, 2620:100:6016:15::a27d:10f\n",
- "Connecting to uc8559b7d1230cbe8280dbdb40c1.dl.dropboxusercontent.com (uc8559b7d1230cbe8280dbdb40c1.dl.dropboxusercontent.com)|162.125.1.15|:443... connected.\n",
+ "Location: https://ucdc6774ffd790e04d8786582413.dl.dropboxusercontent.com/cd/0/inline/CZgQQzNmnh9taqmKnT2qqpfHeYEUr_ycPzaRoro8NnF5tmjfGBCRY3PBXHaEZfypsQmrd3zxqEPVyMxdEodQfrsmXWs8kcBie6ZyTsKTZG4mPqEGhVfXtXdEIY9ESId4sctG6qEVkaQN8deSUYxonWHu/file?dl=1# [following]\n",
+ "--2024-08-29 03:31:44-- https://ucdc6774ffd790e04d8786582413.dl.dropboxusercontent.com/cd/0/inline/CZgQQzNmnh9taqmKnT2qqpfHeYEUr_ycPzaRoro8NnF5tmjfGBCRY3PBXHaEZfypsQmrd3zxqEPVyMxdEodQfrsmXWs8kcBie6ZyTsKTZG4mPqEGhVfXtXdEIY9ESId4sctG6qEVkaQN8deSUYxonWHu/file?dl=1\n",
+ "Resolving ucdc6774ffd790e04d8786582413.dl.dropboxusercontent.com (ucdc6774ffd790e04d8786582413.dl.dropboxusercontent.com)... 162.125.81.15, 2620:100:6031:15::a27d:510f\n",
+ "Connecting to ucdc6774ffd790e04d8786582413.dl.dropboxusercontent.com (ucdc6774ffd790e04d8786582413.dl.dropboxusercontent.com)|162.125.81.15|:443... connected.\n",
+ "HTTP request sent, awaiting response... 302 Found\n",
+ "Location: /cd/0/inline2/CZiyd0BPxmA4Rb6SJQfGYQnWMlhrw8mmCLBaWfR2_HXq3qDYt8_sZ4PUIZTPBD1o41tzmdGq3oQa1XJQrim1hKSO3ElZcGj638nT8SLupYL5MlDJUJASJHXbgVG5xxAMdsGm89CCaFvTQiwGS5Z1v0bAZgyyYHYPMjYJVVA1JCo_gVmTdvd2KpXVvUD4NQeV6yXPBfZUnZC3L-ImZL3RIpFP8qLm8chpXMzF7je_YISCYdu284eMNIWdFiYMTgXkeKdLutmSHGC2JhjDwGG2Jcp5KW6ln58lHmcjCKQ273wy0JyBU5HU508Kj7ncpk4QbOYJj2MLI0a3YnMNd-M4nkLLPp_d9AL24YtFj6fiZfXAmxyXr1D9Wsdj5XHnRkH2ieo/file?dl=1 [following]\n",
+ "--2024-08-29 03:31:44-- https://ucdc6774ffd790e04d8786582413.dl.dropboxusercontent.com/cd/0/inline2/CZiyd0BPxmA4Rb6SJQfGYQnWMlhrw8mmCLBaWfR2_HXq3qDYt8_sZ4PUIZTPBD1o41tzmdGq3oQa1XJQrim1hKSO3ElZcGj638nT8SLupYL5MlDJUJASJHXbgVG5xxAMdsGm89CCaFvTQiwGS5Z1v0bAZgyyYHYPMjYJVVA1JCo_gVmTdvd2KpXVvUD4NQeV6yXPBfZUnZC3L-ImZL3RIpFP8qLm8chpXMzF7je_YISCYdu284eMNIWdFiYMTgXkeKdLutmSHGC2JhjDwGG2Jcp5KW6ln58lHmcjCKQ273wy0JyBU5HU508Kj7ncpk4QbOYJj2MLI0a3YnMNd-M4nkLLPp_d9AL24YtFj6fiZfXAmxyXr1D9Wsdj5XHnRkH2ieo/file?dl=1\n",
+ "Reusing existing connection to ucdc6774ffd790e04d8786582413.dl.dropboxusercontent.com:443.\n",
"HTTP request sent, awaiting response... 200 OK\n",
"Length: 354684075 (338M) [application/binary]\n",
"Saving to: ‘tmp_testing/LCA.h5ad’\n",
"\n",
- "tmp_testing/LCA.h5a 100%[===================>] 338.25M 103MB/s in 3.3s \n",
+ "tmp_testing/LCA.h5a 100%[===================>] 338.25M 11.3MB/s in 21s \n",
"\n",
- "2024-02-20 02:12:57 (103 MB/s) - ‘tmp_testing/LCA.h5ad’ saved [354684075/354684075]\n",
+ "2024-08-29 03:32:06 (15.9 MB/s) - ‘tmp_testing/LCA.h5ad’ saved [354684075/354684075]\n",
"\n"
]
}
@@ -424,27 +419,27 @@
"execution_count": 9,
"id": "3d63bea8",
"metadata": {
+ "id": "3d63bea8",
"colab": {
"base_uri": "https://localhost:8080/"
},
- "id": "3d63bea8",
- "outputId": "e9b2715b-fcba-45c3-d9f3-263c2ab29829"
+ "outputId": "412dbb83-838e-4acb-8cf1-3e27032737ec"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
- "--2024-02-20 02:13:05-- https://zenodo.org/api/records/7587774/files/TS_Lung_filtered.h5ad/content\n",
+ "--2024-08-29 03:32:14-- https://zenodo.org/api/records/7587774/files/TS_Lung_filtered.h5ad/content\n",
"Resolving zenodo.org (zenodo.org)... 188.185.79.172, 188.184.98.238, 188.184.103.159, ...\n",
"Connecting to zenodo.org (zenodo.org)|188.185.79.172|:443... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
"Length: 1953465248 (1.8G) [application/octet-stream]\n",
"Saving to: ‘tmp/TS_Lung.h5ad’\n",
"\n",
- "tmp/TS_Lung.h5ad 100%[===================>] 1.82G 18.2MB/s in 1m 47s \n",
+ "tmp/TS_Lung.h5ad 100%[===================>] 1.82G 11.7MB/s in 2m 48s \n",
"\n",
- "2024-02-20 02:14:53 (17.4 MB/s) - ‘tmp/TS_Lung.h5ad’ saved [1953465248/1953465248]\n",
+ "2024-08-29 03:35:02 (11.1 MB/s) - ‘tmp/TS_Lung.h5ad’ saved [1953465248/1953465248]\n",
"\n"
]
}
@@ -465,7 +460,7 @@
"id": "ab9a16a4",
"metadata": {
"id": "ab9a16a4",
- "outputId": "58c5796e-ca0b-47db-c395-8e43b6591a8c",
+ "outputId": "98821fb8-a9ed-4a29-c80d-ca10a2476ff6",
"colab": {
"base_uri": "https://localhost:8080/"
}
@@ -488,27 +483,27 @@
"execution_count": 11,
"id": "66e75578",
"metadata": {
+ "id": "66e75578",
"colab": {
"base_uri": "https://localhost:8080/"
},
- "id": "66e75578",
- "outputId": "6d070894-0a7f-42ec-dd4d-a1fa222b9dde"
+ "outputId": "2ed95646-033d-4986-ec02-83e1027665ae"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
- "--2024-02-20 02:14:53-- https://zenodo.org/api/records/7580707/files/pretrained_models_Lung_ts.tar.gz/content\n",
- "Resolving zenodo.org (zenodo.org)... 188.184.103.159, 188.185.79.172, 188.184.98.238, ...\n",
+ "--2024-08-29 03:35:03-- https://zenodo.org/api/records/7580707/files/pretrained_models_Lung_ts.tar.gz/content\n",
+ "Resolving zenodo.org (zenodo.org)... 188.184.103.159, 188.184.98.238, 188.185.79.172, ...\n",
"Connecting to zenodo.org (zenodo.org)|188.184.103.159|:443... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
"Length: 75525173 (72M) [application/octet-stream]\n",
"Saving to: ‘tmp/pretrained_model_Lung.tar.gz’\n",
"\n",
- "tmp/pretrained_mode 100%[===================>] 72.03M 14.7MB/s in 6.0s \n",
+ "tmp/pretrained_mode 100%[===================>] 72.03M 21.3MB/s in 4.4s \n",
"\n",
- "2024-02-20 02:15:00 (12.0 MB/s) - ‘tmp/pretrained_model_Lung.tar.gz’ saved [75525173/75525173]\n",
+ "2024-08-29 03:35:08 (16.5 MB/s) - ‘tmp/pretrained_model_Lung.tar.gz’ saved [75525173/75525173]\n",
"\n"
]
}
@@ -587,31 +582,19 @@
},
{
"cell_type": "code",
- "execution_count": 22,
- "id": "tXznk8J_hFFI",
+ "source": [
+ "popv.Config.num_threads = 1"
+ ],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "tXznk8J_hFFI",
- "outputId": "1f259905-680e-423b-d0bf-6899d3734f85"
+ "id": "dmWdD5u4JfpI"
},
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "\u001b[0m\u001b[01;34mdataset\u001b[0m/ \u001b[01;34montology\u001b[0m/\n"
- ]
- }
- ],
- "source": [
- "ls ./PopV/resources"
- ]
+ "id": "dmWdD5u4JfpI",
+ "execution_count": 15,
+ "outputs": []
},
{
"cell_type": "code",
- "execution_count": 23,
+ "execution_count": 16,
"id": "db50776c-e9d2-4198-8b19-b0cdebd6b167",
"metadata": {
"id": "db50776c-e9d2-4198-8b19-b0cdebd6b167"
@@ -629,7 +612,7 @@
" ref_batch_key=ref_batch_key,\n",
" unknown_celltype_label=unknown_celltype_label,\n",
" save_path_trained_models=output_model_fn,\n",
- " cl_obo_folder=\"./PopV/resources/ontology/\",\n",
+ " cl_obo_folder=\"content/PopV/resources/ontology/\",\n",
" prediction_mode=\"inference\", # 'fast' mode gives fast results (does not include BBKNN and Scanorama and makes more inaccurate predictions)\n",
" n_samples_per_label=n_samples_per_label,\n",
" accelerator=\"cuda\",\n",
@@ -640,14 +623,14 @@
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": 17,
"id": "e58408ba",
"metadata": {
"id": "e58408ba",
- "outputId": "c07eea54-5268-4759-ca31-50fde5be48c4",
"colab": {
"base_uri": "https://localhost:8080/"
- }
+ },
+ "outputId": "ee9e7c18-a031-4075-c6e8-955fd3be08af"
},
"outputs": [
{
@@ -663,7 +646,7 @@
]
},
"metadata": {},
- "execution_count": 24
+ "execution_count": 17
}
],
"source": [
@@ -672,15 +655,15 @@
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": 18,
"id": "1e6b602d-8e13-4e1d-b31e-632a0c4a2284",
"metadata": {
+ "collapsed": true,
+ "id": "1e6b602d-8e13-4e1d-b31e-632a0c4a2284",
"colab": {
"base_uri": "https://localhost:8080/"
},
- "collapsed": true,
- "id": "1e6b602d-8e13-4e1d-b31e-632a0c4a2284",
- "outputId": "aed3ef40-b21b-4c87-fc41-71aac31a1806"
+ "outputId": "e398bfab-a32e-43b4-be09-d6cca20aecc0"
},
"outputs": [
{
@@ -695,24 +678,24 @@
"\tCompleted 5 / 10 iteration(s).\n",
"Reach convergence after 5 iteration(s).\n",
"Found 4000 genes among all datasets\n",
- "[[0. 0.11818182 0.53663571 0.01059002 0.80443756 0.00458716\n",
- " 0.05777778 0.06041335 0.09090909 0.05973716 0.02083333]\n",
- " [0. 0. 0.14545455 0.61119516 0.11428571 0.84862385\n",
- " 0.03111111 0.04155844 0.38636364 0.05584416 0.52083333]\n",
- " [0. 0. 0. 0.33888048 0.51051868 0.01834862\n",
- " 0.36444444 0.20031797 0.25 0.15292712 0.10416667]\n",
- " [0. 0. 0. 0. 0.05446293 0.73853211\n",
- " 0.01777778 0.01361573 0.40909091 0.00716846 0.35416667]\n",
- " [0. 0. 0. 0. 0. 0.2912844\n",
- " 0.22222222 0.43879173 0.65909091 0.4958184 0.4375 ]\n",
+ "[[0. 0.10779221 0.53405573 0.00453858 0.80134159 0.00917431\n",
+ " 0.08 0.05882353 0.09090909 0.05615293 0.0625 ]\n",
+ " [0. 0. 0.14025974 0.60060514 0.12857143 0.83944954\n",
+ " 0.03555556 0.05064935 0.38636364 0.05714286 0.45833333]\n",
+ " [0. 0. 0. 0.36006051 0.50616612 0.01376147\n",
+ " 0.36444444 0.19236884 0.25 0.16726404 0.08333333]\n",
+ " [0. 0. 0. 0. 0.05597579 0.72477064\n",
+ " 0.01777778 0.01210287 0.34090909 0.00955795 0.33333333]\n",
+ " [0. 0. 0. 0. 0. 0.32568807\n",
+ " 0.22666667 0.44197138 0.63636364 0.49820789 0.41666667]\n",
" [0. 0. 0. 0. 0. 0.\n",
- " 0.01777778 0.02752294 0.65909091 0.05733945 0.64583333]\n",
+ " 0.01777778 0.02522936 0.70454545 0.07568807 0.625 ]\n",
" [0. 0. 0. 0. 0. 0.\n",
- " 0. 0.15555556 0. 0.61333333 0.04166667]\n",
+ " 0. 0.17333333 0. 0.62666667 0.04166667]\n",
" [0. 0. 0. 0. 0. 0.\n",
- " 0. 0. 0.40909091 0.54719235 0.16666667]\n",
+ " 0. 0. 0.43181818 0.54958184 0.22916667]\n",
" [0. 0. 0. 0. 0. 0.\n",
- " 0. 0. 0. 0.25 0.54166667]\n",
+ " 0. 0. 0. 0.20454545 0.52083333]\n",
" [0. 0. 0. 0. 0. 0.\n",
" 0. 0. 0. 0. 0.60416667]\n",
" [0. 0. 0. 0. 0. 0.\n",
@@ -722,36 +705,35 @@
"Processing datasets (3, 5)\n",
"Processing datasets (5, 8)\n",
"Processing datasets (4, 8)\n",
- "Processing datasets (5, 10)\n",
"Processing datasets (6, 9)\n",
- "Processing datasets (1, 3)\n",
+ "Processing datasets (5, 10)\n",
"Processing datasets (9, 10)\n",
+ "Processing datasets (1, 3)\n",
"Processing datasets (7, 9)\n",
- "Processing datasets (8, 10)\n",
"Processing datasets (0, 2)\n",
- "Processing datasets (1, 10)\n",
+ "Processing datasets (8, 10)\n",
"Processing datasets (2, 4)\n",
"Processing datasets (4, 9)\n",
+ "Processing datasets (1, 10)\n",
"Processing datasets (4, 7)\n",
- "Processing datasets (4, 10)\n",
"Processing datasets (7, 8)\n",
- "Processing datasets (3, 8)\n",
+ "Processing datasets (4, 10)\n",
"Processing datasets (1, 8)\n",
"Processing datasets (2, 6)\n",
- "Processing datasets (3, 10)\n",
"Processing datasets (2, 3)\n",
+ "Processing datasets (3, 8)\n",
+ "Processing datasets (3, 10)\n",
"Processing datasets (4, 5)\n",
- "Processing datasets (8, 9)\n",
"Processing datasets (2, 8)\n",
+ "Processing datasets (7, 10)\n",
"Processing datasets (4, 6)\n",
+ "Processing datasets (8, 9)\n",
"Processing datasets (2, 7)\n",
- "Processing datasets (7, 10)\n",
"Processing datasets (6, 7)\n",
"Processing datasets (2, 9)\n",
"Processing datasets (1, 2)\n",
- "Processing datasets (0, 1)\n",
"Processing datasets (1, 4)\n",
- "Processing datasets (2, 10)\n",
+ "Processing datasets (0, 1)\n",
"\u001b[34mINFO \u001b[0m File tmp/pretrained_model_Lung/scvi/model.pt already downloaded \n"
]
},
@@ -763,6 +745,7 @@
"INFO:lightning.pytorch.utilities.rank_zero:TPU available: False, using: 0 TPU cores\n",
"INFO:lightning.pytorch.utilities.rank_zero:IPU available: False, using: 0 IPUs\n",
"INFO:lightning.pytorch.utilities.rank_zero:HPU available: False, using: 0 HPUs\n",
+ "INFO:lightning.pytorch.utilities.rank_zero:You are using a CUDA device ('NVIDIA A100-SXM4-40GB') that has Tensor Cores. To properly utilize them, you should set `torch.set_float32_matmul_precision('medium' | 'high')` which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision\n",
"INFO:lightning.pytorch.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n"
]
},
@@ -770,7 +753,7 @@
"output_type": "stream",
"name": "stdout",
"text": [
- "Epoch 200/200: 100%|██████████| 200/200 [03:35<00:00, 1.36s/it, v_num=1, train_loss_step=1.8e+3, train_loss_epoch=1.92e+3] "
+ "Epoch 200/200: 100%|██████████| 200/200 [03:50<00:00, 1.16s/it, v_num=1, train_loss_step=1.95e+3, train_loss_epoch=1.92e+3]"
]
},
{
@@ -784,7 +767,7 @@
"output_type": "stream",
"name": "stdout",
"text": [
- "\rEpoch 200/200: 100%|██████████| 200/200 [03:35<00:00, 1.08s/it, v_num=1, train_loss_step=1.8e+3, train_loss_epoch=1.92e+3]\n",
+ "\rEpoch 200/200: 100%|██████████| 200/200 [03:50<00:00, 1.15s/it, v_num=1, train_loss_step=1.95e+3, train_loss_epoch=1.92e+3]\n",
"\u001b[34mINFO \u001b[0m Input AnnData not setup with scvi-tools. attempting to transfer AnnData setup \n",
"\u001b[34mINFO \u001b[0m File tmp/pretrained_model_Lung/\u001b[35m/scanvi/\u001b[0m\u001b[95mmodel.pt\u001b[0m already downloaded \n",
"\u001b[34mINFO \u001b[0m Training for \u001b[1;36m20\u001b[0m epochs. \n"
@@ -805,7 +788,7 @@
"output_type": "stream",
"name": "stdout",
"text": [
- "Epoch 20/20: 100%|██████████| 20/20 [00:17<00:00, 1.09it/s, v_num=1, train_loss_step=2e+3, train_loss_epoch=2.06e+3] "
+ "Epoch 20/20: 100%|██████████| 20/20 [00:15<00:00, 1.39it/s, v_num=1, train_loss_step=1.71e+3, train_loss_epoch=2.01e+3]"
]
},
{
@@ -819,7 +802,7 @@
"output_type": "stream",
"name": "stdout",
"text": [
- "\rEpoch 20/20: 100%|██████████| 20/20 [00:17<00:00, 1.13it/s, v_num=1, train_loss_step=2e+3, train_loss_epoch=2.06e+3]\n",
+ "\rEpoch 20/20: 100%|██████████| 20/20 [00:15<00:00, 1.31it/s, v_num=1, train_loss_step=1.71e+3, train_loss_epoch=2.01e+3]\n",
"\u001b[34mINFO \u001b[0m AnnData object appears to be a copy. Attempting to transfer setup. \n"
]
}
@@ -832,15 +815,15 @@
},
{
"cell_type": "code",
- "execution_count": 26,
+ "execution_count": 19,
"id": "a13f55b3",
"metadata": {
"id": "a13f55b3",
- "outputId": "c5eba993-f586-4156-af31-6aaf26b84831",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 36
- }
+ },
+ "outputId": "66244885-db46-4851-bfd5-49d212ab341f"
},
"outputs": [
{
@@ -854,7 +837,7 @@
}
},
"metadata": {},
- "execution_count": 26
+ "execution_count": 19
}
],
"source": [
@@ -863,7 +846,7 @@
},
{
"cell_type": "code",
- "execution_count": 27,
+ "execution_count": 20,
"id": "57be6575",
"metadata": {
"id": "57be6575"
@@ -876,14 +859,14 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": 21,
"id": "mPpRz3mdrr0M",
"metadata": {
+ "id": "mPpRz3mdrr0M",
"colab": {
"base_uri": "https://localhost:8080/"
},
- "id": "mPpRz3mdrr0M",
- "outputId": "c5d56c36-5686-48ad-b1a2-a63cd049b329"
+ "outputId": "c09d29e3-be95-43d5-a456-bb23cc33860d"
},
"outputs": [
{
@@ -893,14 +876,14 @@
"AnnData object with n_obs × n_vars = 16797 × 4000\n",
" obs: 'tissue_in_publication', 'donor_id', 'free_annotation', 'compartment', 'cell_type_ontology_term_id', 'cell_type', 'assay', 'sex', 'tissue', 'cell_ontology_class', 'cell_ontology_class_tissue', 'donor_tissue', 'assay_correct', 'donor_assay', '_batch_annotation', '_labels_annotation', '_ref_subsample', 'method', 'donor', 'cell_ontology_type', 'donor_method', 'cell_ontology_id', '_dataset', 'n_counts', 'popv_celltypist_prediction', 'popv_celltypist_prediction_probabilities', 'popv_knn_on_bbknn_prediction', 'popv_knn_on_bbknn_prediction_probabilities', 'popv_knn_on_harmony_prediction', 'popv_knn_on_harmony_prediction_probabilities', 'popv_knn_on_scanorama_prediction', 'popv_knn_on_scanorama_prediction_probabilities', 'subsampled_labels', '_scvi_batch', '_scvi_labels', 'popv_knn_on_scvi_prediction', 'popv_knn_on_scvi_prediction_probabilities', '_labels_annotation_cell_ontology_id', 'popv_onclass_prediction', 'popv_onclass_seen', 'popv_onclass_prediction_probabilities', 'popv_onclass_seen_probabilities', 'popv_rf_prediction', 'popv_rf_prediction_probabilities', 'popv_scanvi_prediction', 'popv_scanvi_prediction_probabilities', 'popv_svm_prediction', 'popv_svm_prediction_probabilities', 'popv_majority_vote_prediction', 'popv_majority_vote_score', 'popv_prediction', 'popv_prediction_score', 'popv_prediction_depth', 'popv_prediction_onclass_relative_depth', 'popv_parent'\n",
" var: 'mean', 'std'\n",
- " uns: 'Filtered_cells', 'log1p', 'unknown_celltype_label', '_pretrained_scvi_path', '_save_path_trained_models', '_prediction_mode', '_cl_obo_file', '_cl_ontology_file', '_nlp_emb_file', '_accelerator', '_devices', '_compute_embedding', '_return_probabilities', 'prediction_keys', 'neighbors', 'leiden', '_scvi_uuid', '_scvi_manager_uuid', 'prediction_keys_seen'\n",
+ " uns: 'Filtered_cells', 'log1p', 'unknown_celltype_label', '_pretrained_scvi_path', '_save_path_trained_models', '_prediction_mode', '_cl_obo_file', '_cl_ontology_file', '_nlp_emb_file', '_accelerator', '_devices', '_compute_embedding', '_return_probabilities', 'prediction_keys', 'neighbors', 'over_clustering', '_scvi_uuid', '_scvi_manager_uuid', 'prediction_keys_seen'\n",
" obsm: 'X_pca', 'X_scvi', 'X_scvi_umap', 'X_umap', 'X_bbknn_umap_popv', 'X_pca_harmony', 'X_umap_harmony_popv', 'X_scanorama', 'X_umap_scanorma_popv', 'X_scvi_umap_popv', 'onclass_probabilities', 'X_scanvi', 'X_scanvi_umap_popv'\n",
" layers: 'scvi_counts', 'scaled_counts'\n",
" obsp: 'connectivities', 'distances'"
]
},
"metadata": {},
- "execution_count": 28
+ "execution_count": 21
}
],
"source": [
@@ -918,20 +901,20 @@
"id": "4o_4nhUJT2oF"
},
"id": "4o_4nhUJT2oF",
- "execution_count": 34,
+ "execution_count": 22,
"outputs": []
},
{
"cell_type": "code",
- "execution_count": 35,
+ "execution_count": 23,
"id": "31479a95",
"metadata": {
+ "id": "31479a95",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
- "id": "31479a95",
- "outputId": "bcbdfdea-d47c-47bb-be83-0f0f0fce66da"
+ "outputId": "2b9530ac-bcce-4e2f-997d-1e8cb99901b1"
},
"outputs": [
{
@@ -940,7 +923,7 @@
"text/plain": [
"