Skip to content

Commit eaeaf47

Browse files
committed
filter out compounds from gene-gene relationship benchmark
1 parent 60df3eb commit eaeaf47

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

RxRx3-core_benchmarks/rxrx3_core_benchmarks_openphenom.ipynb

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"cell_type": "code",
47-
"execution_count": null,
47+
"execution_count": 4,
4848
"metadata": {},
4949
"outputs": [],
5050
"source": [
@@ -63,7 +63,7 @@
6363
},
6464
{
6565
"cell_type": "code",
66-
"execution_count": null,
66+
"execution_count": 6,
6767
"metadata": {},
6868
"outputs": [],
6969
"source": [
@@ -72,20 +72,20 @@
7272
},
7373
{
7474
"cell_type": "code",
75-
"execution_count": null,
75+
"execution_count": 7,
7676
"metadata": {},
7777
"outputs": [],
7878
"source": [
7979
"embeddings_mrged = rxrx3_metadata.merge(\n",
80-
" openphenom_embeddings.rename(columns={\"well_id\": \"external_well_id\"}).groupby(\"external_well_id\").mean(), \n",
80+
" openphenom_embeddings.groupby(\"well_id\").mean(), \n",
8181
" left_on=\"well_id\", \n",
8282
" right_index=True,\n",
8383
")"
8484
]
8585
},
8686
{
8787
"cell_type": "code",
88-
"execution_count": null,
88+
"execution_count": 8,
8989
"metadata": {},
9090
"outputs": [],
9191
"source": [
@@ -118,7 +118,7 @@
118118
},
119119
{
120120
"cell_type": "code",
121-
"execution_count": null,
121+
"execution_count": 10,
122122
"metadata": {},
123123
"outputs": [],
124124
"source": [
@@ -152,12 +152,14 @@
152152
"metadata": {},
153153
"outputs": [],
154154
"source": [
155+
"map_data_gene_only = map_data.query(\"perturbation_type == 'CRISPR'\") # only use CRISPR perturbations for gene-gene benchmarks\n",
156+
"\n",
155157
"pert_signal_pval_cutoff = 0.05\n",
156158
"recall_thr_pairs = [(0.05, 0.95)]\n",
157159
"\n",
158160
"print(\"Computing recall...\")\n",
159161
"bmdb_metrics = known_relationship_benchmark(\n",
160-
" Bunch(metadata=map_data[metadata_cols], features=map_data[features_cols]),\n",
162+
" Bunch(metadata=map_data_gene_only[metadata_cols], features=map_data_gene_only[features_cols]),\n",
161163
" recall_thr_pairs=recall_thr_pairs,\n",
162164
" pert_col=pert_colname,\n",
163165
" log_stats=True,\n",
@@ -309,6 +311,13 @@
309311
"\n",
310312
" fig.show()"
311313
]
314+
},
315+
{
316+
"cell_type": "code",
317+
"execution_count": null,
318+
"metadata": {},
319+
"outputs": [],
320+
"source": []
312321
}
313322
],
314323
"metadata": {
@@ -327,7 +336,7 @@
327336
"name": "python",
328337
"nbconvert_exporter": "python",
329338
"pygments_lexer": "ipython3",
330-
"version": "3.11.6"
339+
"version": "3.11.9"
331340
}
332341
},
333342
"nbformat": 4,

0 commit comments

Comments
 (0)