Skip to content

Commit b2e0450

Browse files
committed
update notebook
1 parent 36b4f58 commit b2e0450

File tree

1 file changed

+37
-45
lines changed

1 file changed

+37
-45
lines changed

run_and_explore.ipynb

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"source": [
1010
"# Neurosynth Compose Notebook\n",
1111
"\n",
12-
"After you've built your meta-analysis on [neurosynth compose](compose.neurosynth.org), you can use this notebook to execute and view the meta-analytic results."
12+
"After you've built your meta-analysis on [neurosynth compose](https://compose.neurosynth.org), you can use this notebook to execute and view the meta-analytic results."
1313
]
1414
},
1515
{
@@ -45,21 +45,9 @@
4545
"execution_count": null,
4646
"id": "178c5406-2625-4048-af3c-c01bdb5e1b56",
4747
"metadata": {
48-
"colab": {
49-
"base_uri": "https://localhost:8080/"
50-
},
51-
"id": "178c5406-2625-4048-af3c-c01bdb5e1b56",
52-
"outputId": "ed849b76-32ee-40a4-8279-b5d9a998da44"
53-
},
54-
"outputs": [
55-
{
56-
"name": "stdout",
57-
"output_type": "stream",
58-
"text": [
59-
"Paste the 12 character ID of the meta-analysis here: 6YA5FqTPNJEq\n"
60-
]
61-
}
62-
],
48+
"id": "178c5406-2625-4048-af3c-c01bdb5e1b56"
49+
},
50+
"outputs": [],
6351
"source": [
6452
"#@title Set your Neurosynth-Compose Meta-Analysis ID { run: \"auto\" }\n",
6553
"META_ID = input(\"Paste the 12 character ID of the meta-analysis here: \") # for example: \"8dJ6tG7wfbyS\"\n",
@@ -88,7 +76,7 @@
8876
},
8977
"outputs": [],
9078
"source": [
91-
"from nimare.workflows import compose_workflow # special workflow to run meta-analysis"
79+
"from pynsc.run import run # special workflow to run meta-analysis"
9280
]
9381
},
9482
{
@@ -101,7 +89,7 @@
10189
"outputs": [],
10290
"source": [
10391
"if META_ID is not None:\n",
104-
" meta_result = compose_workflow(META_ID)\n",
92+
" _, meta_result = run(META_ID)\n",
10593
"else:\n",
10694
" print(\"UPDATE META_ID VARIABLE TO YOUR META-ANALYSIS\")"
10795
]
@@ -154,7 +142,7 @@
154142
},
155143
"outputs": [],
156144
"source": [
157-
"STAT_NAME = \"z\"\n",
145+
"STAT_NAME = \"z\" # you will typically only want to look at corrected output\n",
158146
"stat_map = meta_result.get_map(STAT_NAME)"
159147
]
160148
},
@@ -171,52 +159,56 @@
171159
]
172160
},
173161
{
174-
"cell_type": "markdown",
175-
"id": "b43d40b3-9c1d-490c-a3a2-173e04755932",
162+
"cell_type": "code",
163+
"source": [
164+
"# here are your for tables\n",
165+
"print(\"\\n\".join(list(meta_result.tables.keys())))"
166+
],
176167
"metadata": {
177-
"id": "b43d40b3-9c1d-490c-a3a2-173e04755932"
168+
"id": "sFqMmeQ-xNvM"
178169
},
179-
"source": [
180-
"## Investigate what studies contributed to which clusters\n",
181-
"\n",
182-
"Dive into your results to discover which analyses are driving your results."
183-
]
170+
"id": "sFqMmeQ-xNvM",
171+
"execution_count": null,
172+
"outputs": []
184173
},
185174
{
186175
"cell_type": "code",
187-
"execution_count": null,
188-
"id": "5732cece-ec55-44cb-996c-e56a26ba1639",
176+
"source": [
177+
"# get a cluster table\n",
178+
"cluster_key = next(t for t in meta_result.tables.keys() if \"clust\" in t)\n",
179+
"meta_result.tables[cluster_key]"
180+
],
189181
"metadata": {
190-
"id": "5732cece-ec55-44cb-996c-e56a26ba1639"
182+
"id": "qgm3KfxqyD34"
191183
},
192-
"outputs": [],
193-
"source": [
194-
"from nimare.diagnostics import FocusCounter # Only works for coordinate-based meta-analyses\n",
195-
"fc = FocusCounter(target_image=STAT_NAME)"
196-
]
184+
"id": "qgm3KfxqyD34",
185+
"execution_count": null,
186+
"outputs": []
197187
},
198188
{
199-
"cell_type": "code",
200-
"execution_count": null,
201-
"id": "2908b852-a2c4-4f8e-92ce-436ab79ce5f9",
189+
"cell_type": "markdown",
190+
"id": "b43d40b3-9c1d-490c-a3a2-173e04755932",
202191
"metadata": {
203-
"id": "2908b852-a2c4-4f8e-92ce-436ab79ce5f9"
192+
"id": "b43d40b3-9c1d-490c-a3a2-173e04755932"
204193
},
205-
"outputs": [],
206194
"source": [
207-
"contribution_table, cluster_img = fc.transform(meta_result)"
195+
"## Investigate what studies contributed to which clusters\n",
196+
"\n",
197+
"Dive into your results to discover which analyses are driving your results."
208198
]
209199
},
210200
{
211201
"cell_type": "code",
212202
"execution_count": null,
213-
"id": "eaa9b534-d3ac-4b02-bc90-2aa60fec62c1",
203+
"id": "5732cece-ec55-44cb-996c-e56a26ba1639",
214204
"metadata": {
215-
"id": "eaa9b534-d3ac-4b02-bc90-2aa60fec62c1"
205+
"id": "5732cece-ec55-44cb-996c-e56a26ba1639"
216206
},
217207
"outputs": [],
218208
"source": [
219-
"contribution_table"
209+
"# Only works for coordinate-based meta-analyses\n",
210+
"diagnostic_key = next(t for t in meta_result.tables.keys() if \"clust\" not in t)\n",
211+
"meta_result.tables[diagnostic_key]"
220212
]
221213
}
222214
],
@@ -244,4 +236,4 @@
244236
},
245237
"nbformat": 4,
246238
"nbformat_minor": 5
247-
}
239+
}

0 commit comments

Comments
 (0)