|
a |
|
b/notebooks/base_test.ipynb |
|
|
1 |
{ |
|
|
2 |
"cells": [ |
|
|
3 |
{ |
|
|
4 |
"cell_type": "code", |
|
|
5 |
"execution_count": 1, |
|
|
6 |
"metadata": { |
|
|
7 |
"tags": [] |
|
|
8 |
}, |
|
|
9 |
"outputs": [], |
|
|
10 |
"source": [ |
|
|
11 |
"%load_ext autoreload\n", |
|
|
12 |
"%autoreload 2\n", |
|
|
13 |
"\n", |
|
|
14 |
"%matplotlib inline" |
|
|
15 |
] |
|
|
16 |
}, |
|
|
17 |
{ |
|
|
18 |
"cell_type": "code", |
|
|
19 |
"execution_count": 2, |
|
|
20 |
"metadata": {}, |
|
|
21 |
"outputs": [], |
|
|
22 |
"source": [ |
|
|
23 |
"import os, sys" |
|
|
24 |
] |
|
|
25 |
}, |
|
|
26 |
{ |
|
|
27 |
"cell_type": "code", |
|
|
28 |
"execution_count": 3, |
|
|
29 |
"metadata": {}, |
|
|
30 |
"outputs": [], |
|
|
31 |
"source": [ |
|
|
32 |
"import pylab as plt\n", |
|
|
33 |
"import matplotlib\n", |
|
|
34 |
"\n", |
|
|
35 |
"import numpy as np\n", |
|
|
36 |
"import pandas as pd" |
|
|
37 |
] |
|
|
38 |
}, |
|
|
39 |
{ |
|
|
40 |
"cell_type": "code", |
|
|
41 |
"execution_count": 4, |
|
|
42 |
"metadata": {}, |
|
|
43 |
"outputs": [ |
|
|
44 |
{ |
|
|
45 |
"name": "stdout", |
|
|
46 |
"output_type": "stream", |
|
|
47 |
"text": [ |
|
|
48 |
"['/Users/joewandy/Work/git/pyMultiOmics/notebooks', '/opt/anaconda3/envs/pyMultiOmics/lib/python310.zip', '/opt/anaconda3/envs/pyMultiOmics/lib/python3.10', '/opt/anaconda3/envs/pyMultiOmics/lib/python3.10/lib-dynload', '', '/opt/anaconda3/envs/pyMultiOmics/lib/python3.10/site-packages']\n" |
|
|
49 |
] |
|
|
50 |
} |
|
|
51 |
], |
|
|
52 |
"source": [ |
|
|
53 |
"os.getcwd()\n", |
|
|
54 |
"print(sys.path)" |
|
|
55 |
] |
|
|
56 |
}, |
|
|
57 |
{ |
|
|
58 |
"cell_type": "code", |
|
|
59 |
"execution_count": 5, |
|
|
60 |
"metadata": {}, |
|
|
61 |
"outputs": [ |
|
|
62 |
{ |
|
|
63 |
"name": "stderr", |
|
|
64 |
"output_type": "stream", |
|
|
65 |
"text": [ |
|
|
66 |
"2022-03-24 14:39:13.236 | WARNING | pyMultiOmics.reactome:get_neo4j_driver:14 - Using a default neo4j server: bolt://localhost:7687\n", |
|
|
67 |
"2022-03-24 14:39:13.236 | WARNING | pyMultiOmics.reactome:get_neo4j_driver:19 - Using a default neo4j username or password: neo4j\n", |
|
|
68 |
"2022-03-24 14:39:13.236 | INFO | pyMultiOmics.reactome:get_neo4j_driver:24 - Created graph database driver for bolt://localhost:7687 (neo4j)\n" |
|
|
69 |
] |
|
|
70 |
} |
|
|
71 |
], |
|
|
72 |
"source": [ |
|
|
73 |
"sys.path.append('..')\n", |
|
|
74 |
"\n", |
|
|
75 |
"from pyMultiOmics.base import SingleOmicsData, MultiOmicsData\n", |
|
|
76 |
"from pyMultiOmics.mapping import Mapper\n", |
|
|
77 |
"from pyMultiOmics.common import set_log_level_info, set_log_level_debug, download_file, extract_zip_file\n", |
|
|
78 |
"from pyMultiOmics.constants import IDENTIFIER_COL, SAMPLE_COL\n", |
|
|
79 |
"from pyMultiOmics.constants import GENES, PROTEINS, COMPOUNDS" |
|
|
80 |
] |
|
|
81 |
}, |
|
|
82 |
{ |
|
|
83 |
"cell_type": "markdown", |
|
|
84 |
"metadata": {}, |
|
|
85 |
"source": [ |
|
|
86 |
"# Demonstration of pyMultiOmics base classes" |
|
|
87 |
] |
|
|
88 |
}, |
|
|
89 |
{ |
|
|
90 |
"cell_type": "markdown", |
|
|
91 |
"metadata": { |
|
|
92 |
"tags": [] |
|
|
93 |
}, |
|
|
94 |
"source": [ |
|
|
95 |
"### Load the multi-omics COVID-19 data from [1]\n", |
|
|
96 |
"\n", |
|
|
97 |
"[1] [Overmyer, Katherine A., et al. \"Large-scale multi-omic analysis of COVID-19 severity.\" Cell systems 12.1 (2021): 23-40.](https://www.sciencedirect.com/science/article/pii/S2405471220303719)" |
|
|
98 |
] |
|
|
99 |
}, |
|
|
100 |
{ |
|
|
101 |
"cell_type": "code", |
|
|
102 |
"execution_count": 6, |
|
|
103 |
"metadata": {}, |
|
|
104 |
"outputs": [ |
|
|
105 |
{ |
|
|
106 |
"name": "stderr", |
|
|
107 |
"output_type": "stream", |
|
|
108 |
"text": [ |
|
|
109 |
"2022-03-24 14:39:14.454 | INFO | pyMultiOmics.common:download_file:59 - Downloading covid19_multiomics_data.zip\n", |
|
|
110 |
"2.36kKB [00:00, 15.6kKB/s] \n", |
|
|
111 |
"2022-03-24 14:39:14.634 | INFO | pyMultiOmics.common:extract_zip_file:71 - Extracting covid19_multiomics_data.zip\n", |
|
|
112 |
"100%|██████████████████████████████████████████████████████████████████████████████████| 14/14 [00:00<00:00, 256.77it/s]\n", |
|
|
113 |
"2022-03-24 14:39:14.692 | INFO | pyMultiOmics.common:extract_zip_file:77 - Deleting covid19_multiomics_data.zip\n" |
|
|
114 |
] |
|
|
115 |
} |
|
|
116 |
], |
|
|
117 |
"source": [ |
|
|
118 |
"url = 'https://github.com/glasgowcompbio/pyMultiOmics-data/raw/main/covid19_multiomics_data.zip'\n", |
|
|
119 |
"out_file = download_file(url)\n", |
|
|
120 |
"extract_zip_file(out_file)" |
|
|
121 |
] |
|
|
122 |
}, |
|
|
123 |
{ |
|
|
124 |
"cell_type": "code", |
|
|
125 |
"execution_count": 7, |
|
|
126 |
"metadata": {}, |
|
|
127 |
"outputs": [ |
|
|
128 |
{ |
|
|
129 |
"data": { |
|
|
130 |
"text/plain": [ |
|
|
131 |
"'/Users/joewandy/Work/git/pyMultiOmics/notebooks/covid19_multiomics_data'" |
|
|
132 |
] |
|
|
133 |
}, |
|
|
134 |
"execution_count": 7, |
|
|
135 |
"metadata": {}, |
|
|
136 |
"output_type": "execute_result" |
|
|
137 |
} |
|
|
138 |
], |
|
|
139 |
"source": [ |
|
|
140 |
"DATA_FOLDER = os.path.abspath(os.path.join('covid19_multiomics_data'))\n", |
|
|
141 |
"DATA_FOLDER" |
|
|
142 |
] |
|
|
143 |
}, |
|
|
144 |
{ |
|
|
145 |
"cell_type": "markdown", |
|
|
146 |
"metadata": {}, |
|
|
147 |
"source": [ |
|
|
148 |
"### Read the individual dataframes" |
|
|
149 |
] |
|
|
150 |
}, |
|
|
151 |
{ |
|
|
152 |
"cell_type": "code", |
|
|
153 |
"execution_count": 8, |
|
|
154 |
"metadata": {}, |
|
|
155 |
"outputs": [], |
|
|
156 |
"source": [ |
|
|
157 |
"transcript_df = pd.read_csv(os.path.join(DATA_FOLDER, 'covid_genes_include_p.csv'), index_col='Identifier')\n", |
|
|
158 |
"transcript_design = pd.read_csv(os.path.join(DATA_FOLDER, 'covid_genes_design.csv'), index_col='sample')" |
|
|
159 |
] |
|
|
160 |
}, |
|
|
161 |
{ |
|
|
162 |
"cell_type": "code", |
|
|
163 |
"execution_count": 9, |
|
|
164 |
"metadata": {}, |
|
|
165 |
"outputs": [], |
|
|
166 |
"source": [ |
|
|
167 |
"protein_df = pd.read_csv(os.path.join(DATA_FOLDER, 'covid_protein_include_p.csv'), index_col='Identifier')\n", |
|
|
168 |
"protein_design = pd.read_csv(os.path.join(DATA_FOLDER, 'covid_protein_design.csv'), index_col='sample')" |
|
|
169 |
] |
|
|
170 |
}, |
|
|
171 |
{ |
|
|
172 |
"cell_type": "code", |
|
|
173 |
"execution_count": 10, |
|
|
174 |
"metadata": {}, |
|
|
175 |
"outputs": [], |
|
|
176 |
"source": [ |
|
|
177 |
"compound_df = pd.read_csv(os.path.join(DATA_FOLDER, 'covid_compounds_include_p.csv'), index_col='Identifier')\n", |
|
|
178 |
"compound_design = pd.read_csv(os.path.join(DATA_FOLDER, 'covid_compounds_design.csv'), index_col='sample')" |
|
|
179 |
] |
|
|
180 |
}, |
|
|
181 |
{ |
|
|
182 |
"cell_type": "markdown", |
|
|
183 |
"metadata": {}, |
|
|
184 |
"source": [ |
|
|
185 |
"### Create single omics data container objects" |
|
|
186 |
] |
|
|
187 |
}, |
|
|
188 |
{ |
|
|
189 |
"cell_type": "markdown", |
|
|
190 |
"metadata": {}, |
|
|
191 |
"source": [ |
|
|
192 |
"Some data cleaning is done upon loading in `SingleOmicsData`:\n", |
|
|
193 |
"- Duplicate values are removed from the rows and columns\n", |
|
|
194 |
"- Duplicate sample names are removed\n", |
|
|
195 |
"- Measurements with missing metadata are removed\n", |
|
|
196 |
"- Metadata with missing measurements are removed too" |
|
|
197 |
] |
|
|
198 |
}, |
|
|
199 |
{ |
|
|
200 |
"cell_type": "code", |
|
|
201 |
"execution_count": 11, |
|
|
202 |
"metadata": {}, |
|
|
203 |
"outputs": [ |
|
|
204 |
{ |
|
|
205 |
"name": "stderr", |
|
|
206 |
"output_type": "stream", |
|
|
207 |
"text": [ |
|
|
208 |
"2022-03-24 14:39:14.981 | WARNING | pyMultiOmics.base:_keep_common_samples:126 - Dropped 4 columns from sample metadata due to missing measurements\n" |
|
|
209 |
] |
|
|
210 |
}, |
|
|
211 |
{ |
|
|
212 |
"data": { |
|
|
213 |
"text/plain": [ |
|
|
214 |
"genes data with (13028, 125) measurements" |
|
|
215 |
] |
|
|
216 |
}, |
|
|
217 |
"execution_count": 11, |
|
|
218 |
"metadata": {}, |
|
|
219 |
"output_type": "execute_result" |
|
|
220 |
} |
|
|
221 |
], |
|
|
222 |
"source": [ |
|
|
223 |
"transcript_data = SingleOmicsData(GENES, transcript_df, transcript_design)\n", |
|
|
224 |
"transcript_data" |
|
|
225 |
] |
|
|
226 |
}, |
|
|
227 |
{ |
|
|
228 |
"cell_type": "code", |
|
|
229 |
"execution_count": 12, |
|
|
230 |
"metadata": {}, |
|
|
231 |
"outputs": [ |
|
|
232 |
{ |
|
|
233 |
"data": { |
|
|
234 |
"text/plain": [ |
|
|
235 |
"proteins data with (1499, 129) measurements" |
|
|
236 |
] |
|
|
237 |
}, |
|
|
238 |
"execution_count": 12, |
|
|
239 |
"metadata": {}, |
|
|
240 |
"output_type": "execute_result" |
|
|
241 |
} |
|
|
242 |
], |
|
|
243 |
"source": [ |
|
|
244 |
"protein_data = SingleOmicsData(PROTEINS, protein_df, protein_design)\n", |
|
|
245 |
"protein_data" |
|
|
246 |
] |
|
|
247 |
}, |
|
|
248 |
{ |
|
|
249 |
"cell_type": "code", |
|
|
250 |
"execution_count": 13, |
|
|
251 |
"metadata": {}, |
|
|
252 |
"outputs": [ |
|
|
253 |
{ |
|
|
254 |
"data": { |
|
|
255 |
"text/plain": [ |
|
|
256 |
"compounds data with (46, 129) measurements" |
|
|
257 |
] |
|
|
258 |
}, |
|
|
259 |
"execution_count": 13, |
|
|
260 |
"metadata": {}, |
|
|
261 |
"output_type": "execute_result" |
|
|
262 |
} |
|
|
263 |
], |
|
|
264 |
"source": [ |
|
|
265 |
"compound_data = SingleOmicsData(COMPOUNDS, compound_df, compound_design)\n", |
|
|
266 |
"compound_data" |
|
|
267 |
] |
|
|
268 |
}, |
|
|
269 |
{ |
|
|
270 |
"cell_type": "markdown", |
|
|
271 |
"metadata": {}, |
|
|
272 |
"source": [ |
|
|
273 |
"### Getting values" |
|
|
274 |
] |
|
|
275 |
}, |
|
|
276 |
{ |
|
|
277 |
"cell_type": "markdown", |
|
|
278 |
"metadata": {}, |
|
|
279 |
"source": [ |
|
|
280 |
"You can get data out of the container by using the `data_df` and `design_df` attributes.\n", |
|
|
281 |
"\n", |
|
|
282 |
"Notice that after the data is loaded and cleaned, the number of samples in the measurement dataframe (`data_df`) is the same as the number of rows in the sample metadata dataframe (`design_df`)." |
|
|
283 |
] |
|
|
284 |
}, |
|
|
285 |
{ |
|
|
286 |
"cell_type": "code", |
|
|
287 |
"execution_count": 14, |
|
|
288 |
"metadata": {}, |
|
|
289 |
"outputs": [ |
|
|
290 |
{ |
|
|
291 |
"data": { |
|
|
292 |
"text/html": [ |
|
|
293 |
"<div>\n", |
|
|
294 |
"<style scoped>\n", |
|
|
295 |
" .dataframe tbody tr th:only-of-type {\n", |
|
|
296 |
" vertical-align: middle;\n", |
|
|
297 |
" }\n", |
|
|
298 |
"\n", |
|
|
299 |
" .dataframe tbody tr th {\n", |
|
|
300 |
" vertical-align: top;\n", |
|
|
301 |
" }\n", |
|
|
302 |
"\n", |
|
|
303 |
" .dataframe thead th {\n", |
|
|
304 |
" text-align: right;\n", |
|
|
305 |
" }\n", |
|
|
306 |
"</style>\n", |
|
|
307 |
"<table border=\"1\" class=\"dataframe\">\n", |
|
|
308 |
" <thead>\n", |
|
|
309 |
" <tr style=\"text-align: right;\">\n", |
|
|
310 |
" <th></th>\n", |
|
|
311 |
" <th>sample_1</th>\n", |
|
|
312 |
" <th>sample_2</th>\n", |
|
|
313 |
" <th>sample_3</th>\n", |
|
|
314 |
" <th>sample_4</th>\n", |
|
|
315 |
" <th>sample_5</th>\n", |
|
|
316 |
" <th>sample_6</th>\n", |
|
|
317 |
" <th>sample_7</th>\n", |
|
|
318 |
" <th>sample_8</th>\n", |
|
|
319 |
" <th>sample_9</th>\n", |
|
|
320 |
" <th>sample_10</th>\n", |
|
|
321 |
" <th>...</th>\n", |
|
|
322 |
" <th>sample_120</th>\n", |
|
|
323 |
" <th>sample_121</th>\n", |
|
|
324 |
" <th>sample_122</th>\n", |
|
|
325 |
" <th>sample_123</th>\n", |
|
|
326 |
" <th>sample_124</th>\n", |
|
|
327 |
" <th>sample_125</th>\n", |
|
|
328 |
" <th>sample_126</th>\n", |
|
|
329 |
" <th>sample_127</th>\n", |
|
|
330 |
" <th>sample_128</th>\n", |
|
|
331 |
" <th>sample_129</th>\n", |
|
|
332 |
" </tr>\n", |
|
|
333 |
" <tr>\n", |
|
|
334 |
" <th>Identifier</th>\n", |
|
|
335 |
" <th></th>\n", |
|
|
336 |
" <th></th>\n", |
|
|
337 |
" <th></th>\n", |
|
|
338 |
" <th></th>\n", |
|
|
339 |
" <th></th>\n", |
|
|
340 |
" <th></th>\n", |
|
|
341 |
" <th></th>\n", |
|
|
342 |
" <th></th>\n", |
|
|
343 |
" <th></th>\n", |
|
|
344 |
" <th></th>\n", |
|
|
345 |
" <th></th>\n", |
|
|
346 |
" <th></th>\n", |
|
|
347 |
" <th></th>\n", |
|
|
348 |
" <th></th>\n", |
|
|
349 |
" <th></th>\n", |
|
|
350 |
" <th></th>\n", |
|
|
351 |
" <th></th>\n", |
|
|
352 |
" <th></th>\n", |
|
|
353 |
" <th></th>\n", |
|
|
354 |
" <th></th>\n", |
|
|
355 |
" <th></th>\n", |
|
|
356 |
" </tr>\n", |
|
|
357 |
" </thead>\n", |
|
|
358 |
" <tbody>\n", |
|
|
359 |
" <tr>\n", |
|
|
360 |
" <th>A0A024R6I7</th>\n", |
|
|
361 |
" <td>37.995543</td>\n", |
|
|
362 |
" <td>37.353091</td>\n", |
|
|
363 |
" <td>37.527875</td>\n", |
|
|
364 |
" <td>37.673128</td>\n", |
|
|
365 |
" <td>37.983542</td>\n", |
|
|
366 |
" <td>37.489959</td>\n", |
|
|
367 |
" <td>37.615303</td>\n", |
|
|
368 |
" <td>37.534702</td>\n", |
|
|
369 |
" <td>37.525762</td>\n", |
|
|
370 |
" <td>37.844902</td>\n", |
|
|
371 |
" <td>...</td>\n", |
|
|
372 |
" <td>37.730180</td>\n", |
|
|
373 |
" <td>38.082377</td>\n", |
|
|
374 |
" <td>37.661959</td>\n", |
|
|
375 |
" <td>37.195828</td>\n", |
|
|
376 |
" <td>37.365447</td>\n", |
|
|
377 |
" <td>37.564109</td>\n", |
|
|
378 |
" <td>37.683884</td>\n", |
|
|
379 |
" <td>37.282698</td>\n", |
|
|
380 |
" <td>37.655909</td>\n", |
|
|
381 |
" <td>37.754401</td>\n", |
|
|
382 |
" </tr>\n", |
|
|
383 |
" <tr>\n", |
|
|
384 |
" <th>A0A0G2JRN3</th>\n", |
|
|
385 |
" <td>37.995543</td>\n", |
|
|
386 |
" <td>37.353091</td>\n", |
|
|
387 |
" <td>37.527875</td>\n", |
|
|
388 |
" <td>37.673128</td>\n", |
|
|
389 |
" <td>37.983542</td>\n", |
|
|
390 |
" <td>37.489959</td>\n", |
|
|
391 |
" <td>37.615303</td>\n", |
|
|
392 |
" <td>37.534702</td>\n", |
|
|
393 |
" <td>37.525762</td>\n", |
|
|
394 |
" <td>37.844902</td>\n", |
|
|
395 |
" <td>...</td>\n", |
|
|
396 |
" <td>37.730180</td>\n", |
|
|
397 |
" <td>38.082377</td>\n", |
|
|
398 |
" <td>37.661959</td>\n", |
|
|
399 |
" <td>37.195828</td>\n", |
|
|
400 |
" <td>37.365447</td>\n", |
|
|
401 |
" <td>37.564109</td>\n", |
|
|
402 |
" <td>37.683884</td>\n", |
|
|
403 |
" <td>37.282698</td>\n", |
|
|
404 |
" <td>37.655909</td>\n", |
|
|
405 |
" <td>37.754401</td>\n", |
|
|
406 |
" </tr>\n", |
|
|
407 |
" <tr>\n", |
|
|
408 |
" <th>A0A075B6H9</th>\n", |
|
|
409 |
" <td>27.176361</td>\n", |
|
|
410 |
" <td>29.419228</td>\n", |
|
|
411 |
" <td>27.174171</td>\n", |
|
|
412 |
" <td>28.879702</td>\n", |
|
|
413 |
" <td>27.262485</td>\n", |
|
|
414 |
" <td>29.535232</td>\n", |
|
|
415 |
" <td>27.657446</td>\n", |
|
|
416 |
" <td>30.323779</td>\n", |
|
|
417 |
" <td>28.194885</td>\n", |
|
|
418 |
" <td>29.253091</td>\n", |
|
|
419 |
" <td>...</td>\n", |
|
|
420 |
" <td>27.731627</td>\n", |
|
|
421 |
" <td>27.621776</td>\n", |
|
|
422 |
" <td>27.249976</td>\n", |
|
|
423 |
" <td>27.403813</td>\n", |
|
|
424 |
" <td>27.133006</td>\n", |
|
|
425 |
" <td>27.793462</td>\n", |
|
|
426 |
" <td>26.876193</td>\n", |
|
|
427 |
" <td>27.715091</td>\n", |
|
|
428 |
" <td>26.965212</td>\n", |
|
|
429 |
" <td>28.376997</td>\n", |
|
|
430 |
" </tr>\n", |
|
|
431 |
" <tr>\n", |
|
|
432 |
" <th>A0A075B6I0</th>\n", |
|
|
433 |
" <td>28.294477</td>\n", |
|
|
434 |
" <td>29.048510</td>\n", |
|
|
435 |
" <td>28.953215</td>\n", |
|
|
436 |
" <td>29.527460</td>\n", |
|
|
437 |
" <td>28.605867</td>\n", |
|
|
438 |
" <td>29.251895</td>\n", |
|
|
439 |
" <td>26.943355</td>\n", |
|
|
440 |
" <td>29.914134</td>\n", |
|
|
441 |
" <td>28.947290</td>\n", |
|
|
442 |
" <td>29.108465</td>\n", |
|
|
443 |
" <td>...</td>\n", |
|
|
444 |
" <td>28.977874</td>\n", |
|
|
445 |
" <td>27.961132</td>\n", |
|
|
446 |
" <td>29.085045</td>\n", |
|
|
447 |
" <td>28.319069</td>\n", |
|
|
448 |
" <td>29.418182</td>\n", |
|
|
449 |
" <td>29.003245</td>\n", |
|
|
450 |
" <td>28.002763</td>\n", |
|
|
451 |
" <td>28.660543</td>\n", |
|
|
452 |
" <td>28.665092</td>\n", |
|
|
453 |
" <td>29.839541</td>\n", |
|
|
454 |
" </tr>\n", |
|
|
455 |
" <tr>\n", |
|
|
456 |
" <th>A0A075B6I4</th>\n", |
|
|
457 |
" <td>24.783368</td>\n", |
|
|
458 |
" <td>27.573331</td>\n", |
|
|
459 |
" <td>25.619161</td>\n", |
|
|
460 |
" <td>23.893562</td>\n", |
|
|
461 |
" <td>18.440251</td>\n", |
|
|
462 |
" <td>25.033513</td>\n", |
|
|
463 |
" <td>19.384221</td>\n", |
|
|
464 |
" <td>22.054705</td>\n", |
|
|
465 |
" <td>27.642444</td>\n", |
|
|
466 |
" <td>27.163654</td>\n", |
|
|
467 |
" <td>...</td>\n", |
|
|
468 |
" <td>27.365780</td>\n", |
|
|
469 |
" <td>26.182814</td>\n", |
|
|
470 |
" <td>27.649039</td>\n", |
|
|
471 |
" <td>25.888229</td>\n", |
|
|
472 |
" <td>26.724164</td>\n", |
|
|
473 |
" <td>26.577443</td>\n", |
|
|
474 |
" <td>27.996742</td>\n", |
|
|
475 |
" <td>21.713502</td>\n", |
|
|
476 |
" <td>19.659693</td>\n", |
|
|
477 |
" <td>20.145198</td>\n", |
|
|
478 |
" </tr>\n", |
|
|
479 |
" <tr>\n", |
|
|
480 |
" <th>...</th>\n", |
|
|
481 |
" <td>...</td>\n", |
|
|
482 |
" <td>...</td>\n", |
|
|
483 |
" <td>...</td>\n", |
|
|
484 |
" <td>...</td>\n", |
|
|
485 |
" <td>...</td>\n", |
|
|
486 |
" <td>...</td>\n", |
|
|
487 |
" <td>...</td>\n", |
|
|
488 |
" <td>...</td>\n", |
|
|
489 |
" <td>...</td>\n", |
|
|
490 |
" <td>...</td>\n", |
|
|
491 |
" <td>...</td>\n", |
|
|
492 |
" <td>...</td>\n", |
|
|
493 |
" <td>...</td>\n", |
|
|
494 |
" <td>...</td>\n", |
|
|
495 |
" <td>...</td>\n", |
|
|
496 |
" <td>...</td>\n", |
|
|
497 |
" <td>...</td>\n", |
|
|
498 |
" <td>...</td>\n", |
|
|
499 |
" <td>...</td>\n", |
|
|
500 |
" <td>...</td>\n", |
|
|
501 |
" <td>...</td>\n", |
|
|
502 |
" </tr>\n", |
|
|
503 |
" <tr>\n", |
|
|
504 |
" <th>V9GYE3</th>\n", |
|
|
505 |
" <td>30.157740</td>\n", |
|
|
506 |
" <td>29.011826</td>\n", |
|
|
507 |
" <td>30.755732</td>\n", |
|
|
508 |
" <td>31.037739</td>\n", |
|
|
509 |
" <td>30.690791</td>\n", |
|
|
510 |
" <td>29.544621</td>\n", |
|
|
511 |
" <td>29.991859</td>\n", |
|
|
512 |
" <td>29.005067</td>\n", |
|
|
513 |
" <td>28.611893</td>\n", |
|
|
514 |
" <td>29.039570</td>\n", |
|
|
515 |
" <td>...</td>\n", |
|
|
516 |
" <td>30.307260</td>\n", |
|
|
517 |
" <td>30.378135</td>\n", |
|
|
518 |
" <td>29.925498</td>\n", |
|
|
519 |
" <td>30.471018</td>\n", |
|
|
520 |
" <td>31.777999</td>\n", |
|
|
521 |
" <td>31.486205</td>\n", |
|
|
522 |
" <td>31.822441</td>\n", |
|
|
523 |
" <td>31.144855</td>\n", |
|
|
524 |
" <td>32.149526</td>\n", |
|
|
525 |
" <td>28.001153</td>\n", |
|
|
526 |
" </tr>\n", |
|
|
527 |
" <tr>\n", |
|
|
528 |
" <th>V9GYG9</th>\n", |
|
|
529 |
" <td>30.157740</td>\n", |
|
|
530 |
" <td>29.011826</td>\n", |
|
|
531 |
" <td>30.755732</td>\n", |
|
|
532 |
" <td>31.037739</td>\n", |
|
|
533 |
" <td>30.690791</td>\n", |
|
|
534 |
" <td>29.544621</td>\n", |
|
|
535 |
" <td>29.991859</td>\n", |
|
|
536 |
" <td>29.005067</td>\n", |
|
|
537 |
" <td>28.611893</td>\n", |
|
|
538 |
" <td>29.039570</td>\n", |
|
|
539 |
" <td>...</td>\n", |
|
|
540 |
" <td>30.307260</td>\n", |
|
|
541 |
" <td>30.378135</td>\n", |
|
|
542 |
" <td>29.925498</td>\n", |
|
|
543 |
" <td>30.471018</td>\n", |
|
|
544 |
" <td>31.777999</td>\n", |
|
|
545 |
" <td>31.486205</td>\n", |
|
|
546 |
" <td>31.822441</td>\n", |
|
|
547 |
" <td>31.144855</td>\n", |
|
|
548 |
" <td>32.149526</td>\n", |
|
|
549 |
" <td>28.001153</td>\n", |
|
|
550 |
" </tr>\n", |
|
|
551 |
" <tr>\n", |
|
|
552 |
" <th>X6R8F3</th>\n", |
|
|
553 |
" <td>22.821315</td>\n", |
|
|
554 |
" <td>20.147061</td>\n", |
|
|
555 |
" <td>21.002496</td>\n", |
|
|
556 |
" <td>19.830364</td>\n", |
|
|
557 |
" <td>18.213300</td>\n", |
|
|
558 |
" <td>22.831885</td>\n", |
|
|
559 |
" <td>21.686202</td>\n", |
|
|
560 |
" <td>23.468367</td>\n", |
|
|
561 |
" <td>20.292526</td>\n", |
|
|
562 |
" <td>24.971321</td>\n", |
|
|
563 |
" <td>...</td>\n", |
|
|
564 |
" <td>20.178151</td>\n", |
|
|
565 |
" <td>21.893118</td>\n", |
|
|
566 |
" <td>24.072429</td>\n", |
|
|
567 |
" <td>18.115715</td>\n", |
|
|
568 |
" <td>20.282632</td>\n", |
|
|
569 |
" <td>21.229028</td>\n", |
|
|
570 |
" <td>23.293898</td>\n", |
|
|
571 |
" <td>20.400931</td>\n", |
|
|
572 |
" <td>18.845678</td>\n", |
|
|
573 |
" <td>26.863133</td>\n", |
|
|
574 |
" </tr>\n", |
|
|
575 |
" <tr>\n", |
|
|
576 |
" <th>P80188</th>\n", |
|
|
577 |
" <td>22.821315</td>\n", |
|
|
578 |
" <td>20.147061</td>\n", |
|
|
579 |
" <td>21.002496</td>\n", |
|
|
580 |
" <td>19.830364</td>\n", |
|
|
581 |
" <td>18.213300</td>\n", |
|
|
582 |
" <td>22.831885</td>\n", |
|
|
583 |
" <td>21.686202</td>\n", |
|
|
584 |
" <td>23.468367</td>\n", |
|
|
585 |
" <td>20.292526</td>\n", |
|
|
586 |
" <td>24.971321</td>\n", |
|
|
587 |
" <td>...</td>\n", |
|
|
588 |
" <td>20.178151</td>\n", |
|
|
589 |
" <td>21.893118</td>\n", |
|
|
590 |
" <td>24.072429</td>\n", |
|
|
591 |
" <td>18.115715</td>\n", |
|
|
592 |
" <td>20.282632</td>\n", |
|
|
593 |
" <td>21.229028</td>\n", |
|
|
594 |
" <td>23.293898</td>\n", |
|
|
595 |
" <td>20.400931</td>\n", |
|
|
596 |
" <td>18.845678</td>\n", |
|
|
597 |
" <td>26.863133</td>\n", |
|
|
598 |
" </tr>\n", |
|
|
599 |
" <tr>\n", |
|
|
600 |
" <th>P80188-2</th>\n", |
|
|
601 |
" <td>22.821315</td>\n", |
|
|
602 |
" <td>20.147061</td>\n", |
|
|
603 |
" <td>21.002496</td>\n", |
|
|
604 |
" <td>19.830364</td>\n", |
|
|
605 |
" <td>18.213300</td>\n", |
|
|
606 |
" <td>22.831885</td>\n", |
|
|
607 |
" <td>21.686202</td>\n", |
|
|
608 |
" <td>23.468367</td>\n", |
|
|
609 |
" <td>20.292526</td>\n", |
|
|
610 |
" <td>24.971321</td>\n", |
|
|
611 |
" <td>...</td>\n", |
|
|
612 |
" <td>20.178151</td>\n", |
|
|
613 |
" <td>21.893118</td>\n", |
|
|
614 |
" <td>24.072429</td>\n", |
|
|
615 |
" <td>18.115715</td>\n", |
|
|
616 |
" <td>20.282632</td>\n", |
|
|
617 |
" <td>21.229028</td>\n", |
|
|
618 |
" <td>23.293898</td>\n", |
|
|
619 |
" <td>20.400931</td>\n", |
|
|
620 |
" <td>18.845678</td>\n", |
|
|
621 |
" <td>26.863133</td>\n", |
|
|
622 |
" </tr>\n", |
|
|
623 |
" </tbody>\n", |
|
|
624 |
"</table>\n", |
|
|
625 |
"<p>1499 rows × 129 columns</p>\n", |
|
|
626 |
"</div>" |
|
|
627 |
], |
|
|
628 |
"text/plain": [ |
|
|
629 |
" sample_1 sample_2 sample_3 sample_4 sample_5 sample_6 \\\n", |
|
|
630 |
"Identifier \n", |
|
|
631 |
"A0A024R6I7 37.995543 37.353091 37.527875 37.673128 37.983542 37.489959 \n", |
|
|
632 |
"A0A0G2JRN3 37.995543 37.353091 37.527875 37.673128 37.983542 37.489959 \n", |
|
|
633 |
"A0A075B6H9 27.176361 29.419228 27.174171 28.879702 27.262485 29.535232 \n", |
|
|
634 |
"A0A075B6I0 28.294477 29.048510 28.953215 29.527460 28.605867 29.251895 \n", |
|
|
635 |
"A0A075B6I4 24.783368 27.573331 25.619161 23.893562 18.440251 25.033513 \n", |
|
|
636 |
"... ... ... ... ... ... ... \n", |
|
|
637 |
"V9GYE3 30.157740 29.011826 30.755732 31.037739 30.690791 29.544621 \n", |
|
|
638 |
"V9GYG9 30.157740 29.011826 30.755732 31.037739 30.690791 29.544621 \n", |
|
|
639 |
"X6R8F3 22.821315 20.147061 21.002496 19.830364 18.213300 22.831885 \n", |
|
|
640 |
"P80188 22.821315 20.147061 21.002496 19.830364 18.213300 22.831885 \n", |
|
|
641 |
"P80188-2 22.821315 20.147061 21.002496 19.830364 18.213300 22.831885 \n", |
|
|
642 |
"\n", |
|
|
643 |
" sample_7 sample_8 sample_9 sample_10 ... sample_120 \\\n", |
|
|
644 |
"Identifier ... \n", |
|
|
645 |
"A0A024R6I7 37.615303 37.534702 37.525762 37.844902 ... 37.730180 \n", |
|
|
646 |
"A0A0G2JRN3 37.615303 37.534702 37.525762 37.844902 ... 37.730180 \n", |
|
|
647 |
"A0A075B6H9 27.657446 30.323779 28.194885 29.253091 ... 27.731627 \n", |
|
|
648 |
"A0A075B6I0 26.943355 29.914134 28.947290 29.108465 ... 28.977874 \n", |
|
|
649 |
"A0A075B6I4 19.384221 22.054705 27.642444 27.163654 ... 27.365780 \n", |
|
|
650 |
"... ... ... ... ... ... ... \n", |
|
|
651 |
"V9GYE3 29.991859 29.005067 28.611893 29.039570 ... 30.307260 \n", |
|
|
652 |
"V9GYG9 29.991859 29.005067 28.611893 29.039570 ... 30.307260 \n", |
|
|
653 |
"X6R8F3 21.686202 23.468367 20.292526 24.971321 ... 20.178151 \n", |
|
|
654 |
"P80188 21.686202 23.468367 20.292526 24.971321 ... 20.178151 \n", |
|
|
655 |
"P80188-2 21.686202 23.468367 20.292526 24.971321 ... 20.178151 \n", |
|
|
656 |
"\n", |
|
|
657 |
" sample_121 sample_122 sample_123 sample_124 sample_125 \\\n", |
|
|
658 |
"Identifier \n", |
|
|
659 |
"A0A024R6I7 38.082377 37.661959 37.195828 37.365447 37.564109 \n", |
|
|
660 |
"A0A0G2JRN3 38.082377 37.661959 37.195828 37.365447 37.564109 \n", |
|
|
661 |
"A0A075B6H9 27.621776 27.249976 27.403813 27.133006 27.793462 \n", |
|
|
662 |
"A0A075B6I0 27.961132 29.085045 28.319069 29.418182 29.003245 \n", |
|
|
663 |
"A0A075B6I4 26.182814 27.649039 25.888229 26.724164 26.577443 \n", |
|
|
664 |
"... ... ... ... ... ... \n", |
|
|
665 |
"V9GYE3 30.378135 29.925498 30.471018 31.777999 31.486205 \n", |
|
|
666 |
"V9GYG9 30.378135 29.925498 30.471018 31.777999 31.486205 \n", |
|
|
667 |
"X6R8F3 21.893118 24.072429 18.115715 20.282632 21.229028 \n", |
|
|
668 |
"P80188 21.893118 24.072429 18.115715 20.282632 21.229028 \n", |
|
|
669 |
"P80188-2 21.893118 24.072429 18.115715 20.282632 21.229028 \n", |
|
|
670 |
"\n", |
|
|
671 |
" sample_126 sample_127 sample_128 sample_129 \n", |
|
|
672 |
"Identifier \n", |
|
|
673 |
"A0A024R6I7 37.683884 37.282698 37.655909 37.754401 \n", |
|
|
674 |
"A0A0G2JRN3 37.683884 37.282698 37.655909 37.754401 \n", |
|
|
675 |
"A0A075B6H9 26.876193 27.715091 26.965212 28.376997 \n", |
|
|
676 |
"A0A075B6I0 28.002763 28.660543 28.665092 29.839541 \n", |
|
|
677 |
"A0A075B6I4 27.996742 21.713502 19.659693 20.145198 \n", |
|
|
678 |
"... ... ... ... ... \n", |
|
|
679 |
"V9GYE3 31.822441 31.144855 32.149526 28.001153 \n", |
|
|
680 |
"V9GYG9 31.822441 31.144855 32.149526 28.001153 \n", |
|
|
681 |
"X6R8F3 23.293898 20.400931 18.845678 26.863133 \n", |
|
|
682 |
"P80188 23.293898 20.400931 18.845678 26.863133 \n", |
|
|
683 |
"P80188-2 23.293898 20.400931 18.845678 26.863133 \n", |
|
|
684 |
"\n", |
|
|
685 |
"[1499 rows x 129 columns]" |
|
|
686 |
] |
|
|
687 |
}, |
|
|
688 |
"execution_count": 14, |
|
|
689 |
"metadata": {}, |
|
|
690 |
"output_type": "execute_result" |
|
|
691 |
} |
|
|
692 |
], |
|
|
693 |
"source": [ |
|
|
694 |
"protein_data.data_df" |
|
|
695 |
] |
|
|
696 |
}, |
|
|
697 |
{ |
|
|
698 |
"cell_type": "code", |
|
|
699 |
"execution_count": 15, |
|
|
700 |
"metadata": {}, |
|
|
701 |
"outputs": [ |
|
|
702 |
{ |
|
|
703 |
"data": { |
|
|
704 |
"text/html": [ |
|
|
705 |
"<div>\n", |
|
|
706 |
"<style scoped>\n", |
|
|
707 |
" .dataframe tbody tr th:only-of-type {\n", |
|
|
708 |
" vertical-align: middle;\n", |
|
|
709 |
" }\n", |
|
|
710 |
"\n", |
|
|
711 |
" .dataframe tbody tr th {\n", |
|
|
712 |
" vertical-align: top;\n", |
|
|
713 |
" }\n", |
|
|
714 |
"\n", |
|
|
715 |
" .dataframe thead th {\n", |
|
|
716 |
" text-align: right;\n", |
|
|
717 |
" }\n", |
|
|
718 |
"</style>\n", |
|
|
719 |
"<table border=\"1\" class=\"dataframe\">\n", |
|
|
720 |
" <thead>\n", |
|
|
721 |
" <tr style=\"text-align: right;\">\n", |
|
|
722 |
" <th></th>\n", |
|
|
723 |
" <th>group</th>\n", |
|
|
724 |
" </tr>\n", |
|
|
725 |
" <tr>\n", |
|
|
726 |
" <th>sample</th>\n", |
|
|
727 |
" <th></th>\n", |
|
|
728 |
" </tr>\n", |
|
|
729 |
" </thead>\n", |
|
|
730 |
" <tbody>\n", |
|
|
731 |
" <tr>\n", |
|
|
732 |
" <th>sample_1</th>\n", |
|
|
733 |
" <td>covid</td>\n", |
|
|
734 |
" </tr>\n", |
|
|
735 |
" <tr>\n", |
|
|
736 |
" <th>sample_2</th>\n", |
|
|
737 |
" <td>covid</td>\n", |
|
|
738 |
" </tr>\n", |
|
|
739 |
" <tr>\n", |
|
|
740 |
" <th>sample_3</th>\n", |
|
|
741 |
" <td>covid</td>\n", |
|
|
742 |
" </tr>\n", |
|
|
743 |
" <tr>\n", |
|
|
744 |
" <th>sample_4</th>\n", |
|
|
745 |
" <td>covid</td>\n", |
|
|
746 |
" </tr>\n", |
|
|
747 |
" <tr>\n", |
|
|
748 |
" <th>sample_5</th>\n", |
|
|
749 |
" <td>covid</td>\n", |
|
|
750 |
" </tr>\n", |
|
|
751 |
" <tr>\n", |
|
|
752 |
" <th>...</th>\n", |
|
|
753 |
" <td>...</td>\n", |
|
|
754 |
" </tr>\n", |
|
|
755 |
" <tr>\n", |
|
|
756 |
" <th>sample_125</th>\n", |
|
|
757 |
" <td>non_covid</td>\n", |
|
|
758 |
" </tr>\n", |
|
|
759 |
" <tr>\n", |
|
|
760 |
" <th>sample_126</th>\n", |
|
|
761 |
" <td>non_covid</td>\n", |
|
|
762 |
" </tr>\n", |
|
|
763 |
" <tr>\n", |
|
|
764 |
" <th>sample_127</th>\n", |
|
|
765 |
" <td>non_covid</td>\n", |
|
|
766 |
" </tr>\n", |
|
|
767 |
" <tr>\n", |
|
|
768 |
" <th>sample_128</th>\n", |
|
|
769 |
" <td>non_covid</td>\n", |
|
|
770 |
" </tr>\n", |
|
|
771 |
" <tr>\n", |
|
|
772 |
" <th>sample_129</th>\n", |
|
|
773 |
" <td>non_covid</td>\n", |
|
|
774 |
" </tr>\n", |
|
|
775 |
" </tbody>\n", |
|
|
776 |
"</table>\n", |
|
|
777 |
"<p>129 rows × 1 columns</p>\n", |
|
|
778 |
"</div>" |
|
|
779 |
], |
|
|
780 |
"text/plain": [ |
|
|
781 |
" group\n", |
|
|
782 |
"sample \n", |
|
|
783 |
"sample_1 covid\n", |
|
|
784 |
"sample_2 covid\n", |
|
|
785 |
"sample_3 covid\n", |
|
|
786 |
"sample_4 covid\n", |
|
|
787 |
"sample_5 covid\n", |
|
|
788 |
"... ...\n", |
|
|
789 |
"sample_125 non_covid\n", |
|
|
790 |
"sample_126 non_covid\n", |
|
|
791 |
"sample_127 non_covid\n", |
|
|
792 |
"sample_128 non_covid\n", |
|
|
793 |
"sample_129 non_covid\n", |
|
|
794 |
"\n", |
|
|
795 |
"[129 rows x 1 columns]" |
|
|
796 |
] |
|
|
797 |
}, |
|
|
798 |
"execution_count": 15, |
|
|
799 |
"metadata": {}, |
|
|
800 |
"output_type": "execute_result" |
|
|
801 |
} |
|
|
802 |
], |
|
|
803 |
"source": [ |
|
|
804 |
"protein_data.design_df" |
|
|
805 |
] |
|
|
806 |
}, |
|
|
807 |
{ |
|
|
808 |
"cell_type": "markdown", |
|
|
809 |
"metadata": {}, |
|
|
810 |
"source": [ |
|
|
811 |
"### Create a multi-omics data container objects" |
|
|
812 |
] |
|
|
813 |
}, |
|
|
814 |
{ |
|
|
815 |
"cell_type": "code", |
|
|
816 |
"execution_count": 16, |
|
|
817 |
"metadata": {}, |
|
|
818 |
"outputs": [], |
|
|
819 |
"source": [ |
|
|
820 |
"publication = 'Overmyer, Katherine A., et al. \"Large-scale multi-omic analysis of COVID-19 severity.\" Cell systems 12.1 (2021): 23-40.'\n", |
|
|
821 |
"url = 'https://www.sciencedirect.com/science/article/pii/S2405471220303719'" |
|
|
822 |
] |
|
|
823 |
}, |
|
|
824 |
{ |
|
|
825 |
"cell_type": "code", |
|
|
826 |
"execution_count": 17, |
|
|
827 |
"metadata": {}, |
|
|
828 |
"outputs": [ |
|
|
829 |
{ |
|
|
830 |
"data": { |
|
|
831 |
"text/plain": [ |
|
|
832 |
"Multi-omics data container\n", |
|
|
833 |
"- publication: Overmyer, Katherine A., et al. \"Large-scale multi-omic analysis of COVID-19 severity.\" Cell systems 12.1 (2021): 23-40.\n", |
|
|
834 |
"- URL: https://www.sciencedirect.com/science/article/pii/S2405471220303719\n", |
|
|
835 |
"- Views: 3 modalities\n", |
|
|
836 |
"\t - genes data with (13028, 125) measurements\n", |
|
|
837 |
"\t - proteins data with (1499, 129) measurements\n", |
|
|
838 |
"\t - compounds data with (46, 129) measurements" |
|
|
839 |
] |
|
|
840 |
}, |
|
|
841 |
"execution_count": 17, |
|
|
842 |
"metadata": {}, |
|
|
843 |
"output_type": "execute_result" |
|
|
844 |
} |
|
|
845 |
], |
|
|
846 |
"source": [ |
|
|
847 |
"mo = MultiOmicsData(publication=publication, url=url)\n", |
|
|
848 |
"mo.add_data([transcript_data, protein_data, compound_data])\n", |
|
|
849 |
"mo" |
|
|
850 |
] |
|
|
851 |
} |
|
|
852 |
], |
|
|
853 |
"metadata": { |
|
|
854 |
"kernelspec": { |
|
|
855 |
"display_name": "Python 3 (ipykernel)", |
|
|
856 |
"language": "python", |
|
|
857 |
"name": "python3" |
|
|
858 |
}, |
|
|
859 |
"language_info": { |
|
|
860 |
"codemirror_mode": { |
|
|
861 |
"name": "ipython", |
|
|
862 |
"version": 3 |
|
|
863 |
}, |
|
|
864 |
"file_extension": ".py", |
|
|
865 |
"mimetype": "text/x-python", |
|
|
866 |
"name": "python", |
|
|
867 |
"nbconvert_exporter": "python", |
|
|
868 |
"pygments_lexer": "ipython3", |
|
|
869 |
"version": "3.10.1" |
|
|
870 |
} |
|
|
871 |
}, |
|
|
872 |
"nbformat": 4, |
|
|
873 |
"nbformat_minor": 4 |
|
|
874 |
} |