|
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | 5 | "execution_count": null, |
6 | | - "id": "vblA", |
7 | | - "metadata": {}, |
8 | | - "outputs": [], |
9 | | - "source": [ |
10 | | - "import os\n", |
11 | | - "import json\n", |
12 | | - "from os.path import join\n", |
13 | | - "from vitessce import (\n", |
14 | | - " convert_cell_browser_project_to_anndata,\n", |
15 | | - " AnnDataWrapper,\n", |
16 | | - " VitessceConfig,\n", |
17 | | - ")\n", |
18 | | - "from vitessce.data_utils import VAR_CHUNK_SIZE" |
19 | | - ] |
20 | | - }, |
21 | | - { |
22 | | - "cell_type": "code", |
23 | | - "execution_count": null, |
24 | | - "id": "lEQa", |
25 | | - "metadata": {}, |
26 | | - "outputs": [], |
27 | | - "source": [ |
28 | | - "## 3. Convert UCSC Cell Browser project to a Vitessce view config" |
29 | | - ] |
30 | | - }, |
31 | | - { |
32 | | - "cell_type": "code", |
33 | | - "execution_count": null, |
34 | | - "id": "Hstk", |
| 6 | + "id": "Hbol", |
35 | 7 | "metadata": {}, |
36 | 8 | "outputs": [], |
37 | 9 | "source": [ |
38 | 10 | "import marimo as mo" |
39 | 11 | ] |
40 | 12 | }, |
41 | | - { |
42 | | - "cell_type": "code", |
43 | | - "execution_count": null, |
44 | | - "id": "PKri", |
45 | | - "metadata": {}, |
46 | | - "outputs": [], |
47 | | - "source": [ |
48 | | - "# Example run, coverting \"adultPancreas\" project:\n", |
49 | | - "adata = convert_cell_browser_project_to_anndata(project_name=\"adultPancreas\", keep_only_marker_genes=True)" |
50 | | - ] |
51 | | - }, |
52 | 13 | { |
53 | 14 | "cell_type": "markdown", |
54 | | - "id": "BYtC", |
55 | | - "metadata": {}, |
56 | | - "source": [ |
57 | | - "## 3. Configure Vitessce with the AnnData-Zarr store" |
58 | | - ] |
59 | | - }, |
60 | | - { |
61 | | - "cell_type": "markdown", |
62 | | - "id": "bkHC", |
63 | | - "metadata": {}, |
| 15 | + "id": "MJUe", |
| 16 | + "metadata": { |
| 17 | + "marimo": { |
| 18 | + "config": { |
| 19 | + "hide_code": true |
| 20 | + } |
| 21 | + } |
| 22 | + }, |
64 | 23 | "source": [ |
65 | | - "## 1. Convert UCSC Cell Browser project to a format that is supported by Vitessce\n", |
66 | | - "#### Output:\n", |
67 | | - "An AnnData object" |
| 24 | + "# Load UCSC Cell Browser project in Vitessce" |
68 | 25 | ] |
69 | 26 | }, |
70 | 27 | { |
71 | 28 | "cell_type": "markdown", |
72 | | - "id": "MJUe", |
73 | | - "metadata": {}, |
| 29 | + "id": "vblA", |
| 30 | + "metadata": { |
| 31 | + "marimo": { |
| 32 | + "config": { |
| 33 | + "hide_code": true |
| 34 | + } |
| 35 | + } |
| 36 | + }, |
74 | 37 | "source": [ |
75 | 38 | "This notebook shows you how to use the `convert_cell_browser_project_to_anndata` function, which allows you to take an existing project, published in https://cells.ucsc.edu/ and:\n", |
76 | 39 | "1. Convert it into the AnnData format that is supported by Vitessce\n", |
|
84 | 47 | ] |
85 | 48 | }, |
86 | 49 | { |
87 | | - "cell_type": "markdown", |
88 | | - "id": "Kclp", |
| 50 | + "cell_type": "code", |
| 51 | + "execution_count": null, |
| 52 | + "id": "bkHC", |
89 | 53 | "metadata": {}, |
| 54 | + "outputs": [], |
90 | 55 | "source": [ |
91 | | - "## 4. Render the Vitessce widget" |
| 56 | + "import os\n", |
| 57 | + "import json\n", |
| 58 | + "from os.path import join\n", |
| 59 | + "from vitessce import (\n", |
| 60 | + " convert_cell_browser_project_to_anndata,\n", |
| 61 | + " AnnDataWrapper,\n", |
| 62 | + " VitessceConfig,\n", |
| 63 | + ")\n", |
| 64 | + "from vitessce.data_utils import VAR_CHUNK_SIZE" |
92 | 65 | ] |
93 | 66 | }, |
94 | 67 | { |
95 | 68 | "cell_type": "markdown", |
96 | | - "id": "Xref", |
| 69 | + "id": "lEQa", |
| 70 | + "metadata": { |
| 71 | + "marimo": { |
| 72 | + "config": { |
| 73 | + "hide_code": true |
| 74 | + } |
| 75 | + } |
| 76 | + }, |
| 77 | + "source": [ |
| 78 | + "## 1. Convert UCSC Cell Browser project to a format that is supported by Vitessce\n", |
| 79 | + "#### Output:\n", |
| 80 | + "An AnnData object" |
| 81 | + ] |
| 82 | + }, |
| 83 | + { |
| 84 | + "cell_type": "code", |
| 85 | + "execution_count": null, |
| 86 | + "id": "PKri", |
97 | 87 | "metadata": {}, |
| 88 | + "outputs": [], |
98 | 89 | "source": [ |
99 | | - "## 2. Save the AnnData object as a Zarr store" |
| 90 | + "# Example run, coverting \"adultPancreas\" project:\n", |
| 91 | + "adata = convert_cell_browser_project_to_anndata(project_name=\"adultPancreas\", keep_only_marker_genes=True)" |
100 | 92 | ] |
101 | 93 | }, |
102 | 94 | { |
103 | 95 | "cell_type": "markdown", |
104 | | - "id": "Hbol", |
105 | | - "metadata": {}, |
| 96 | + "id": "Xref", |
| 97 | + "metadata": { |
| 98 | + "marimo": { |
| 99 | + "config": { |
| 100 | + "hide_code": true |
| 101 | + } |
| 102 | + } |
| 103 | + }, |
106 | 104 | "source": [ |
107 | | - "# Load UCSC Cell Browser project in Vitessce" |
| 105 | + "## 2. Save the AnnData object as a Zarr store" |
108 | 106 | ] |
109 | 107 | }, |
110 | 108 | { |
|
119 | 117 | "adata.write_zarr(zarr_filepath, chunks=[adata.shape[0], VAR_CHUNK_SIZE])" |
120 | 118 | ] |
121 | 119 | }, |
| 120 | + { |
| 121 | + "cell_type": "markdown", |
| 122 | + "id": "BYtC", |
| 123 | + "metadata": { |
| 124 | + "marimo": { |
| 125 | + "config": { |
| 126 | + "hide_code": true |
| 127 | + } |
| 128 | + } |
| 129 | + }, |
| 130 | + "source": [ |
| 131 | + "## 3. Configure Vitessce with the AnnData-Zarr store" |
| 132 | + ] |
| 133 | + }, |
122 | 134 | { |
123 | 135 | "cell_type": "code", |
124 | 136 | "execution_count": null, |
|
138 | 150 | "anndata_wrapper_inst.auto_view_config(vc)" |
139 | 151 | ] |
140 | 152 | }, |
| 153 | + { |
| 154 | + "cell_type": "markdown", |
| 155 | + "id": "Kclp", |
| 156 | + "metadata": { |
| 157 | + "marimo": { |
| 158 | + "config": { |
| 159 | + "hide_code": true |
| 160 | + } |
| 161 | + } |
| 162 | + }, |
| 163 | + "source": [ |
| 164 | + "## 4. Render the Vitessce widget" |
| 165 | + ] |
| 166 | + }, |
141 | 167 | { |
142 | 168 | "cell_type": "code", |
143 | 169 | "execution_count": null, |
|
0 commit comments