Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:

# Format TOML files early (before other tools might read config)
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.3
rev: v0.24.4
hooks:
- id: toml-sort
args: ["--in-place"]
Expand Down
95 changes: 95 additions & 0 deletions notebooks/3.mitocheck-analysis/1.buscar-analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,101 @@
"output_filename = f\"{'shuffled' if shuffle_flag else 'original'}_mitocheck_moa_analysis_results.parquet\"\n",
"results_df.write_parquet(moa_analysis_output / output_filename)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "458fbd23",
"metadata": {},
"outputs": [],
"source": [
"test_df = pl.read_parquet(\n",
" \"./results/moa_analysis/original_mitocheck_moa_analysis_results.parquet\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f9d40b76",
"metadata": {},
"outputs": [],
"source": [
"test_df = (\n",
" test_df.sort([\"ref_profile\", \"on_score\", \"off_score\", \"treatment\"], nulls_last=True)\n",
" .with_row_index(\"_row_idx\")\n",
" .with_columns(\n",
" (pl.col(\"_row_idx\") - pl.col(\"_row_idx\").min().over(\"ref_profile\") + 1)\n",
" .cast(pl.UInt32)\n",
" .alias(\"rank\")\n",
" )\n",
" .drop(\"_row_idx\")\n",
")\n",
"test_df"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "f325f8aa",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><style>\n",
".dataframe > thead > tr,\n",
".dataframe > tbody > tr {\n",
" text-align: right;\n",
" white-space: pre-wrap;\n",
"}\n",
"</style>\n",
"<small>shape: (960, 6)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>rank</th><th>ref_profile</th><th>treatment</th><th>on_score</th><th>off_score</th><th>proportion</th></tr><tr><td>u32</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>null</td><td>&quot;ADCCM&quot;</td><td>&quot;BUB1B&quot;</td><td>null</td><td>null</td><td>null</td></tr><tr><td>null</td><td>&quot;ADCCM&quot;</td><td>&quot;KIF20A&quot;</td><td>null</td><td>null</td><td>null</td></tr><tr><td>null</td><td>&quot;ADCCM&quot;</td><td>&quot;MYST1&quot;</td><td>null</td><td>null</td><td>null</td></tr><tr><td>1</td><td>&quot;ADCCM&quot;</td><td>&quot;RGR&quot;</td><td>1.8337e-14</td><td>0.0</td><td>0.430556</td></tr><tr><td>2</td><td>&quot;ADCCM&quot;</td><td>&quot;OGG1&quot;</td><td>1.1369e-13</td><td>0.0</td><td>0.042553</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>54</td><td>&quot;SmallIrregular&quot;</td><td>&quot;ENSG00000139974&quot;</td><td>463.140217</td><td>0.111111</td><td>0.0</td></tr><tr><td>55</td><td>&quot;SmallIrregular&quot;</td><td>&quot;CGI-63&quot;</td><td>497.549042</td><td>0.027778</td><td>0.0</td></tr><tr><td>56</td><td>&quot;SmallIrregular&quot;</td><td>&quot;VIPR1&quot;</td><td>541.199995</td><td>0.194444</td><td>0.0</td></tr><tr><td>57</td><td>&quot;SmallIrregular&quot;</td><td>&quot;ENSG00000198517&quot;</td><td>558.711878</td><td>0.0</td><td>0.0</td></tr><tr><td>58</td><td>&quot;SmallIrregular&quot;</td><td>&quot;ENSG00000180225&quot;</td><td>645.364835</td><td>0.138889</td><td>0.0</td></tr></tbody></table></div>"
],
"text/plain": [
"shape: (960, 6)\n",
"┌──────┬────────────────┬─────────────────┬────────────┬───────────┬────────────┐\n",
"│ rank ┆ ref_profile ┆ treatment ┆ on_score ┆ off_score ┆ proportion │\n",
"│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │\n",
"│ u32 ┆ str ┆ str ┆ f64 ┆ f64 ┆ f64 │\n",
"╞══════╪════════════════╪═════════════════╪════════════╪═══════════╪════════════╡\n",
"│ null ┆ ADCCM ┆ BUB1B ┆ null ┆ null ┆ null │\n",
"│ null ┆ ADCCM ┆ KIF20A ┆ null ┆ null ┆ null │\n",
"│ null ┆ ADCCM ┆ MYST1 ┆ null ┆ null ┆ null │\n",
"│ 1 ┆ ADCCM ┆ RGR ┆ 1.8337e-14 ┆ 0.0 ┆ 0.430556 │\n",
"│ 2 ┆ ADCCM ┆ OGG1 ┆ 1.1369e-13 ┆ 0.0 ┆ 0.042553 │\n",
"│ … ┆ … ┆ … ┆ … ┆ … ┆ … │\n",
"│ 54 ┆ SmallIrregular ┆ ENSG00000139974 ┆ 463.140217 ┆ 0.111111 ┆ 0.0 │\n",
"│ 55 ┆ SmallIrregular ┆ CGI-63 ┆ 497.549042 ┆ 0.027778 ┆ 0.0 │\n",
"│ 56 ┆ SmallIrregular ┆ VIPR1 ┆ 541.199995 ┆ 0.194444 ┆ 0.0 │\n",
"│ 57 ┆ SmallIrregular ┆ ENSG00000198517 ┆ 558.711878 ┆ 0.0 ┆ 0.0 │\n",
"│ 58 ┆ SmallIrregular ┆ ENSG00000180225 ┆ 645.364835 ┆ 0.138889 ┆ 0.0 │\n",
"└──────┴────────────────┴─────────────────┴────────────┴───────────┴────────────┘"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_df = test_df.with_columns(\n",
" pl.col(\"on_score\")\n",
" .rank(method=\"min\", descending=False)\n",
" .over(\"ref_profile\")\n",
" .cast(pl.UInt32)\n",
" .alias(\"rank\")\n",
").sort([\"ref_profile\", \"rank\"])\n",
"test_df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a9791894",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
323 changes: 159 additions & 164 deletions notebooks/3.mitocheck-analysis/plots/1.heat-map-on-off-scores.ipynb

Large diffs are not rendered by default.

532 changes: 259 additions & 273 deletions notebooks/3.mitocheck-analysis/plots/2.gene-ranking-relationship.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comparison,value
real,0.3119730571847507
perm_null_mean,0.06288665288214809
perm_null_sd,0.015597630731234009
perm_null_mean,0.06247271639021261
perm_null_sd,0.015491729056433213
empirical_p_real_vs_perm,0
zscore_real_vs_perm,15.969502586300562
zscore_real_vs_perm,16.105390165659312
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
profile,mean_rho_real,mean_rho_shuffled,delta_real_minus_shuffled
Anaphase,0.15650479608991533,0.5608964127385906,-0.4043916166486753
Metaphase,0.13139922605215137,0.5093394174370867,-0.3779401913849353
OutOfFocus,0.10073463266775773,0.4172842935847898,-0.31654966091703207
Apoptosis,0.1762858259363896,0.478924334081411,-0.30263850814502136
Large,0.1482367791371488,0.350562590707509,-0.2023258115703602
Elongated,0.2712370916745004,0.47031707404217477,-0.19907998236767438
Prometaphase,0.3473546385279508,0.5422565846807784,-0.19490194615282763
Grape,0.327177791535563,0.5202688055905473,-0.19309101405498436
MetaphaseAlignment,0.14517391794230394,0.3224625514621759,-0.17728863351987195
Interphase,0.3424213985129714,0.5104889215703348,-0.1680675230573634
Folded,0.2882696005225906,0.4517972552372199,-0.16352765471462932
Hole,0.40691895860031285,0.5400238670665998,-0.13310490846628692
ADCCM,0.42070576160986695,0.5503210383410524,-0.12961527673118545
SmallIrregular,0.24237625897755977,0.3648440681218771,-0.12246780914431732
Binuclear,0.3258004638947451,0.43975486734424585,-0.11395440344950075
Polylobed,0.34938013645686744,0.39657308337490166,-0.04719294691803422
profile,mean_rho,feature_space
OutOfFocus,0.07750370900918473,original
MetaphaseAlignment,0.09317750675662102,original
Metaphase,0.09403146460384448,original
Large,0.12395297721298071,original
Anaphase,0.1295363284681192,original
Apoptosis,0.1737850580597236,original
SmallIrregular,0.21873523146467183,original
Elongated,0.257222234180935,original
Binuclear,0.27802463518368153,original
Folded,0.2788073284358493,original
Polylobed,0.31549516115662113,original
Grape,0.31945239999258623,original
Prometaphase,0.3258901426117646,original
Interphase,0.3358363381673327,original
Hole,0.3941905910241724,original
ADCCM,0.4051700760604237,original
MetaphaseAlignment,0.3370797217146052,shuffled
Polylobed,0.36565797628873886,shuffled
SmallIrregular,0.3732682342174917,shuffled
Large,0.3761371957895286,shuffled
Binuclear,0.429199932541633,shuffled
OutOfFocus,0.44320772909259587,shuffled
Elongated,0.4443778206808757,shuffled
Apoptosis,0.4879658015481369,shuffled
Metaphase,0.4921355483067866,shuffled
Folded,0.5007048767989222,shuffled
Grape,0.5014884633783497,shuffled
ADCCM,0.5029203890851184,shuffled
Hole,0.5112183719238499,shuffled
Interphase,0.5257748638252964,shuffled
Anaphase,0.5398174587901845,shuffled
Prometaphase,0.585452476379703,shuffled
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
profile,original,shuffled,delta_real_minus_shuffled
Anaphase,0.1295363284681192,0.5398174587901845,-0.4102811303220653
Metaphase,0.09403146460384448,0.4921355483067866,-0.3981040837029421
OutOfFocus,0.07750370900918473,0.44320772909259587,-0.36570402008341113
Apoptosis,0.1737850580597236,0.4879658015481369,-0.3141807434884133
Prometaphase,0.3258901426117646,0.585452476379703,-0.2595623337679384
Large,0.12395297721298071,0.3761371957895286,-0.2521842185765479
MetaphaseAlignment,0.09317750675662102,0.3370797217146052,-0.2439022149579842
Folded,0.2788073284358493,0.5007048767989222,-0.22189754836307285
Interphase,0.3358363381673327,0.5257748638252964,-0.18993852565796365
Elongated,0.257222234180935,0.4443778206808757,-0.18715558649994074
Grape,0.31945239999258623,0.5014884633783497,-0.1820360633857635
SmallIrregular,0.21873523146467183,0.3732682342174917,-0.1545330027528199
Binuclear,0.27802463518368153,0.429199932541633,-0.1511752973579515
Hole,0.3941905910241724,0.5112183719238499,-0.11702778089967747
ADCCM,0.4051700760604237,0.5029203890851184,-0.09775031302469467
Polylobed,0.31549516115662113,0.36565797628873886,-0.05016281513211773
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.