|
13 | 13 | "\n", |
14 | 14 | "Before running this tutorial, you need to:\n", |
15 | 15 | "\n", |
16 | | - "1. Download the SCimilarity model from https://zenodo.org/records/15729925\n", |
17 | | - "2. Download the cell type-level attributions you are interested in from https://zenodo.org/communities/signature/. For this tutorial, you will need two attribution folders from Zenodo (https://zenodo.org/records/15794176):\n", |
| 16 | + "1. Download the model_files folder from [here](https://zenodo.org/records/17903196)\n", |
| 17 | + "2. Download the cell type-level attributions you are interested in from [here](https://zenodo.org/communities/signature/). For this tutorial, you will need two attribution folders from [here](https://zenodo.org/records/17905668):\n", |
18 | 18 | "\n", |
19 | | - " 1. `celltype_attributions_lung`: contains data for the first part of the tutorial showing a simple querying example. This folder can be extracted with the command `tar -xzf celltype_attributions_lung.tar.gz`\n", |
20 | | - " 2. `celltype_attributions`: contains data from myeloid cells to replicate the MS1 signature analysis from the paper. This folder can be extracted with the command `tar -xzf celltype_attributions.tar.gz`" |
| 19 | + " 1. **celltype_attributions_lung**: contains data for the first part of the tutorial showing a simple querying example. This folder can be extracted with the command \"tar -xzf celltype_attributions_lung.tar.gz\"\n", |
| 20 | + " 2. **celltype_attributions**: contains data from myeloid cells to replicate the MS1 signature analysis from the paper. This folder can be extracted with the command \"tar -xzf celltype_attributions.tar.gz\"" |
21 | 21 | ] |
22 | 22 | }, |
23 | 23 | { |
|
33 | 33 | "from os.path import join\n", |
34 | 34 | "import pandas as pd\n", |
35 | 35 | "import seaborn as sns\n", |
36 | | - "from SIGnature import SIGnature, SCimilarity, Meta\n", |
37 | | - "import tiledb\n", |
38 | | - "import time\n", |
| 36 | + "from SIGnature import SIGnature, Meta\n", |
| 37 | + "from SIGnature.models.scimilarity import SCimilarityWrapper\n", |
39 | 38 | "from tqdm import tqdm\n", |
40 | 39 | "import warnings\n", |
41 | 40 | "\n", |
|
67 | 66 | "metadata": {}, |
68 | 67 | "outputs": [], |
69 | 68 | "source": [ |
70 | | - "## Path to Scimilarity Model Downloaded from Zenodo (https://zenodo.org/records/15729925)\n", |
71 | | - "scim_model_path = \"/home/scimilarity_model\"\n", |
| 69 | + "## Path to Scimilarity Model Downloaded from Zenodo (https://zenodo.org/records/17903196)\n", |
| 70 | + "scim_model_path = \"/home/model_files/scimilarity\" # change to path where model_files was downloaded\n", |
72 | 71 | "## Set use_gpu false when querying attributions\n", |
73 | | - "scim = SCimilarity(model_path=scim_model_path, use_gpu=False)" |
| 72 | + "scim = SCimilarityWrapper(model_path=scim_model_path, use_gpu=False)" |
74 | 73 | ] |
75 | 74 | }, |
76 | 75 | { |
|
80 | 79 | "metadata": {}, |
81 | 80 | "outputs": [], |
82 | 81 | "source": [ |
83 | | - "## Folder where the cell type attributions are stored\n", |
84 | | - "## Downloaded from Zenodo (https://zenodo.org/records/15794176)\n", |
| 82 | + "## Folder where the cell type attributions are stored, Downloaded from Zenodo (https://zenodo.org/records/17905668)\n", |
85 | 83 | "ct_base = \"/home/celltype_attributions_lung\"\n", |
86 | 84 | "all_ct = os.listdir(ct_base)" |
87 | 85 | ] |
|
103 | 101 | "source": [ |
104 | 102 | "## Check genes (AT1 associated genes from CellMarker)\n", |
105 | 103 | "goi = ['CAV1', 'CAV2', 'CLIC5']\n", |
106 | | - "sig = SIGnature(gene_order=scim.gene_order, model=scim)\n", |
| 104 | + "sig = SIGnature(gene_order=scim.gene_order)\n", |
107 | 105 | "gene_list = sig.check_genes(goi)" |
108 | 106 | ] |
109 | 107 | }, |
|
259 | 257 | "metadata": {}, |
260 | 258 | "outputs": [], |
261 | 259 | "source": [ |
262 | | - "## Path to Scimilarity Model Downloaded from Zenodo (https://zenodo.org/records/15794176)\n", |
263 | | - "scim_model_path = \"/home/scimilarity_model\"\n", |
| 260 | + "## Path to Scimilarity Model Downloaded from Zenodo (https://zenodo.org/records/17903196)\n", |
| 261 | + "scim_model_path = \"/home/model_files/scimilarity\"\n", |
264 | 262 | "## Set use_gpu false when querying attributions\n", |
265 | | - "scim = SCimilarity(model_path=scim_model_path, use_gpu=False)" |
| 263 | + "scim = SCimilarityWrapper(model_path=scim_model_path, use_gpu=False)" |
266 | 264 | ] |
267 | 265 | }, |
268 | 266 | { |
|
272 | 270 | "metadata": {}, |
273 | 271 | "outputs": [], |
274 | 272 | "source": [ |
275 | | - "## This should be the folder where the attributions are stored\n", |
276 | | - "## Path to cell type attributions downloaded from Zenodo (https://zenodo.org/records/15794176)\n", |
| 273 | + "## This should be the folder where the attributions are stored, downloaded from Zenodo (https://zenodo.org/records/17905668)\n", |
277 | 274 | "ct_base = \"/home/celltype_attributions\"\n", |
278 | 275 | "all_ct = os.listdir(ct_base)" |
279 | 276 | ] |
|
343 | 340 | } |
344 | 341 | ], |
345 | 342 | "source": [ |
346 | | - "sig = SIGnature(gene_order=scim.gene_order, model=scim)\n", |
| 343 | + "sig = SIGnature(gene_order=scim.gene_order)\n", |
347 | 344 | "gene_list = sig.check_genes(ms1_genes)" |
348 | 345 | ] |
349 | 346 | }, |
|
867 | 864 | " dotsize=9,\n", |
868 | 865 | ")" |
869 | 866 | ] |
870 | | - }, |
871 | | - { |
872 | | - "cell_type": "code", |
873 | | - "execution_count": null, |
874 | | - "id": "e98b6563-124d-40c5-a9be-783944f52e01", |
875 | | - "metadata": {}, |
876 | | - "outputs": [], |
877 | | - "source": [] |
878 | 867 | } |
879 | 868 | ], |
880 | 869 | "metadata": { |
|
0 commit comments