Skip to content

Commit ebed40e

Browse files
committed
fix requirements and preprocess string
1 parent 568e83d commit ebed40e

File tree

2 files changed

+198
-197
lines changed

2 files changed

+198
-197
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
git+https://github.com/neurostuff/nsc-runner.git#egg=pynsc
1+
git+https://github.com/neurostuff/nsc-runner.git#egg=compose-runner

run_and_explore.ipynb

Lines changed: 197 additions & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -1,198 +1,199 @@
11
{
2-
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"id": "69c306a1-f24a-410a-b034-f002bc0b7a97",
6-
"metadata": {
7-
"id": "69c306a1-f24a-410a-b034-f002bc0b7a97"
8-
},
9-
"source": [
10-
"# Neurosynth Compose Notebook\n",
11-
"\n",
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."
13-
]
14-
},
15-
{
16-
"cell_type": "code",
17-
"execution_count": null,
18-
"id": "28d0e8b6-9bbd-4256-a19a-ff36eeca5cfd",
19-
"metadata": {
20-
"id": "28d0e8b6-9bbd-4256-a19a-ff36eeca5cfd",
21-
"cellView": "form"
22-
},
23-
"outputs": [],
24-
"source": [
25-
"#@title Run once to install NiMARE (~1 minute)\n",
26-
"%%capture --no-display --no-stderr\n",
27-
"%%bash\n",
28-
"wget https://raw.githubusercontent.com/neurostuff/neurosynth-compose-notebook/main/requirements.txt\n",
29-
"pip install -r requirements.txt"
30-
]
31-
},
32-
{
33-
"cell_type": "markdown",
34-
"id": "7dccf070-a1cc-4471-97f1-d386374a80df",
35-
"metadata": {
36-
"id": "7dccf070-a1cc-4471-97f1-d386374a80df"
37-
},
38-
"source": [
39-
"## Run your selected Meta-Analysis\n",
40-
"\n",
41-
"A workflow in NiMARE will interpret the meta-analysis you specified and\n",
42-
"run the selected algorithm and corrector (optional) on the studyset selected."
43-
]
44-
},
45-
{
46-
"cell_type": "code",
47-
"execution_count": null,
48-
"id": "51a1e194-af1a-461c-a73f-3e79a31db95f",
49-
"metadata": {
50-
"id": "51a1e194-af1a-461c-a73f-3e79a31db95f",
51-
"cellView": "form"
52-
},
53-
"outputs": [],
54-
"source": [
55-
"#@title Insert the Meta-Analysis ID and Execute your Meta-Analysis { vertical-output: true }\n",
56-
"from pynsc.run import run # special workflow to run meta-analysis\n",
57-
"META_ID = \"\" #@param {type:\"string\"}\n",
58-
"url = meta_result = None\n",
59-
"if META_ID is not None:\n",
60-
" url, meta_result = run(META_ID)\n",
61-
"else:\n",
62-
" print(\"UPDATE META_ID VARIABLE TO YOUR META-ANALYSIS\")\n",
63-
"\n",
64-
"if url is not None:\n",
65-
" print(f\"view the completed meta-analysis here: {url}\")"
66-
]
67-
},
68-
{
69-
"cell_type": "markdown",
70-
"id": "36d13a9a-b29c-48b3-87d3-4b37cf14cf63",
71-
"metadata": {
72-
"id": "36d13a9a-b29c-48b3-87d3-4b37cf14cf63",
73-
"tags": []
74-
},
75-
"source": [
76-
"## Create a Report\n",
77-
"\n",
78-
"NiMARE can generate a report of the meta-analysis for you to view and explore. The report provides an overview of the coordinates input into the meta-analysis, key statistical maps, statistically significant clusters, and diagnostics to view the contributions of individual studies to each cluster.\n"
79-
]
80-
},
81-
{
82-
"cell_type": "code",
83-
"execution_count": null,
84-
"id": "5767b0b3-8085-4c6a-9812-a1845b036266",
85-
"metadata": {
86-
"id": "5767b0b3-8085-4c6a-9812-a1845b036266"
87-
},
88-
"outputs": [],
89-
"source": [
90-
"from nimare.reports import run_reports\n",
91-
"run_reports(meta_result, 'report')"
92-
]
93-
},
94-
{
95-
"cell_type": "markdown",
96-
"source": [
97-
"## View the Report\n",
98-
"\n",
99-
"You can either download the report using the cell below, or view the contents in google colab two cells below."
100-
],
101-
"metadata": {
102-
"id": "Bywzroq08EnR"
103-
},
104-
"id": "Bywzroq08EnR"
105-
},
106-
{
107-
"cell_type": "code",
108-
"source": [
109-
"#@title Download the Report\n",
110-
"from google.colab import files\n",
111-
"import shutil\n",
112-
"\n",
113-
"folder_path = '/content/report' # Replace with the path to your folder\n",
114-
"\n",
115-
"# Zip the folder\n",
116-
"shutil.make_archive('/content/report', 'zip', folder_path)\n",
117-
"\n",
118-
"\n",
119-
"\n",
120-
"# Download the zip file\n",
121-
"files.download('/content/report.zip')\n",
122-
"\n"
123-
],
124-
"metadata": {
125-
"id": "1g7ewj1h2Xtw",
126-
"cellView": "form"
127-
},
128-
"id": "1g7ewj1h2Xtw",
129-
"execution_count": null,
130-
"outputs": []
131-
},
132-
{
133-
"cell_type": "code",
134-
"execution_count": null,
135-
"metadata": {
136-
"id": "9OyC1_bSEccg",
137-
"cellView": "form"
138-
},
139-
"outputs": [],
140-
"source": [
141-
"#@title Display the Report\n",
142-
"import portpicker\n",
143-
"import threading\n",
144-
"import socket\n",
145-
"import IPython\n",
146-
"\n",
147-
"from six.moves import socketserver\n",
148-
"from six.moves import SimpleHTTPServer\n",
149-
"\n",
150-
"class V6Server(socketserver.TCPServer):\n",
151-
" address_family = socket.AF_INET6\n",
152-
"\n",
153-
"class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):\n",
154-
" def end_headers(self):\n",
155-
" self.send_header('Access-Control-Allow-Origin', '*')\n",
156-
" super().end_headers()\n",
157-
"\n",
158-
"port = portpicker.pick_unused_port()\n",
159-
"\n",
160-
"def server_entry():\n",
161-
" httpd = V6Server(('::', port), Handler)\n",
162-
" # Handle a single request then exit the thread.\n",
163-
" httpd.serve_forever()\n",
164-
"\n",
165-
"thread = threading.Thread(target=server_entry)\n",
166-
"thread.start()\n",
167-
"\n",
168-
"from google.colab import output\n",
169-
"output.serve_kernel_port_as_iframe(port, path='/report/report.html')"
170-
],
171-
"id": "9OyC1_bSEccg"
172-
}
173-
],
174-
"metadata": {
175-
"colab": {
176-
"provenance": []
177-
},
178-
"kernelspec": {
179-
"display_name": "Python 3 (ipykernel)",
180-
"language": "python",
181-
"name": "python3"
182-
},
183-
"language_info": {
184-
"codemirror_mode": {
185-
"name": "ipython",
186-
"version": 3
187-
},
188-
"file_extension": ".py",
189-
"mimetype": "text/x-python",
190-
"name": "python",
191-
"nbconvert_exporter": "python",
192-
"pygments_lexer": "ipython3",
193-
"version": "3.8.10"
194-
}
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "69c306a1-f24a-410a-b034-f002bc0b7a97",
6+
"metadata": {
7+
"id": "69c306a1-f24a-410a-b034-f002bc0b7a97"
8+
},
9+
"source": [
10+
"# Neurosynth Compose Notebook\n",
11+
"\n",
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."
13+
]
19514
},
196-
"nbformat": 4,
197-
"nbformat_minor": 5
198-
}
15+
{
16+
"cell_type": "code",
17+
"execution_count": null,
18+
"id": "28d0e8b6-9bbd-4256-a19a-ff36eeca5cfd",
19+
"metadata": {
20+
"cellView": "form",
21+
"id": "28d0e8b6-9bbd-4256-a19a-ff36eeca5cfd"
22+
},
23+
"outputs": [],
24+
"source": [
25+
"#@title Run once to install NiMARE (~1 minute)\n",
26+
"%%capture --no-display --no-stderr\n",
27+
"%%bash\n",
28+
"wget https://raw.githubusercontent.com/neurostuff/neurosynth-compose-notebook/main/requirements.txt\n",
29+
"pip install -r requirements.txt"
30+
]
31+
},
32+
{
33+
"cell_type": "markdown",
34+
"id": "7dccf070-a1cc-4471-97f1-d386374a80df",
35+
"metadata": {
36+
"id": "7dccf070-a1cc-4471-97f1-d386374a80df"
37+
},
38+
"source": [
39+
"## Run your selected Meta-Analysis\n",
40+
"\n",
41+
"A workflow in NiMARE will interpret the meta-analysis you specified and\n",
42+
"run the selected algorithm and corrector (optional) on the studyset selected."
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": null,
48+
"id": "51a1e194-af1a-461c-a73f-3e79a31db95f",
49+
"metadata": {
50+
"cellView": "form",
51+
"id": "51a1e194-af1a-461c-a73f-3e79a31db95f"
52+
},
53+
"outputs": [],
54+
"source": [
55+
"#@title Insert the Meta-Analysis ID and Execute your Meta-Analysis { vertical-output: true }\n",
56+
"from pynsc.run import run # special workflow to run meta-analysis\n",
57+
"META_ID = \"\" #@param {type:\"string\"}\n",
58+
"META_ID = ''.join(META_ID.split()) # preprocess string\n",
59+
"url = meta_result = None\n",
60+
"if META_ID is not None:\n",
61+
" url, meta_result = run(META_ID)\n",
62+
"else:\n",
63+
" print(\"UPDATE META_ID VARIABLE TO YOUR META-ANALYSIS\")\n",
64+
"\n",
65+
"if url is not None:\n",
66+
" print(f\"view the completed meta-analysis here: {url}\")"
67+
]
68+
},
69+
{
70+
"cell_type": "markdown",
71+
"id": "36d13a9a-b29c-48b3-87d3-4b37cf14cf63",
72+
"metadata": {
73+
"id": "36d13a9a-b29c-48b3-87d3-4b37cf14cf63",
74+
"tags": []
75+
},
76+
"source": [
77+
"## Create a Report\n",
78+
"\n",
79+
"NiMARE can generate a report of the meta-analysis for you to view and explore. The report provides an overview of the coordinates input into the meta-analysis, key statistical maps, statistically significant clusters, and diagnostics to view the contributions of individual studies to each cluster.\n"
80+
]
81+
},
82+
{
83+
"cell_type": "code",
84+
"execution_count": null,
85+
"id": "5767b0b3-8085-4c6a-9812-a1845b036266",
86+
"metadata": {
87+
"id": "5767b0b3-8085-4c6a-9812-a1845b036266"
88+
},
89+
"outputs": [],
90+
"source": [
91+
"from nimare.reports import run_reports\n",
92+
"run_reports(meta_result, 'report')"
93+
]
94+
},
95+
{
96+
"cell_type": "markdown",
97+
"id": "Bywzroq08EnR",
98+
"metadata": {
99+
"id": "Bywzroq08EnR"
100+
},
101+
"source": [
102+
"## View the Report\n",
103+
"\n",
104+
"You can either download the report using the cell below, or view the contents in google colab two cells below."
105+
]
106+
},
107+
{
108+
"cell_type": "code",
109+
"execution_count": null,
110+
"id": "1g7ewj1h2Xtw",
111+
"metadata": {
112+
"cellView": "form",
113+
"id": "1g7ewj1h2Xtw"
114+
},
115+
"outputs": [],
116+
"source": [
117+
"#@title Download the Report\n",
118+
"from google.colab import files\n",
119+
"import shutil\n",
120+
"\n",
121+
"folder_path = '/content/report' # Replace with the path to your folder\n",
122+
"\n",
123+
"# Zip the folder\n",
124+
"shutil.make_archive('/content/report', 'zip', folder_path)\n",
125+
"\n",
126+
"\n",
127+
"\n",
128+
"# Download the zip file\n",
129+
"files.download('/content/report.zip')\n",
130+
"\n"
131+
]
132+
},
133+
{
134+
"cell_type": "code",
135+
"execution_count": null,
136+
"id": "9OyC1_bSEccg",
137+
"metadata": {
138+
"cellView": "form",
139+
"id": "9OyC1_bSEccg"
140+
},
141+
"outputs": [],
142+
"source": [
143+
"#@title Display the Report\n",
144+
"import portpicker\n",
145+
"import threading\n",
146+
"import socket\n",
147+
"import IPython\n",
148+
"\n",
149+
"from six.moves import socketserver\n",
150+
"from six.moves import SimpleHTTPServer\n",
151+
"\n",
152+
"class V6Server(socketserver.TCPServer):\n",
153+
" address_family = socket.AF_INET6\n",
154+
"\n",
155+
"class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):\n",
156+
" def end_headers(self):\n",
157+
" self.send_header('Access-Control-Allow-Origin', '*')\n",
158+
" super().end_headers()\n",
159+
"\n",
160+
"port = portpicker.pick_unused_port()\n",
161+
"\n",
162+
"def server_entry():\n",
163+
" httpd = V6Server(('::', port), Handler)\n",
164+
" # Handle a single request then exit the thread.\n",
165+
" httpd.serve_forever()\n",
166+
"\n",
167+
"thread = threading.Thread(target=server_entry)\n",
168+
"thread.start()\n",
169+
"\n",
170+
"from google.colab import output\n",
171+
"output.serve_kernel_port_as_iframe(port, path='/report/report.html')"
172+
]
173+
}
174+
],
175+
"metadata": {
176+
"colab": {
177+
"provenance": []
178+
},
179+
"kernelspec": {
180+
"display_name": "Python 3 (ipykernel)",
181+
"language": "python",
182+
"name": "python3"
183+
},
184+
"language_info": {
185+
"codemirror_mode": {
186+
"name": "ipython",
187+
"version": 3
188+
},
189+
"file_extension": ".py",
190+
"mimetype": "text/x-python",
191+
"name": "python",
192+
"nbconvert_exporter": "python",
193+
"pygments_lexer": "ipython3",
194+
"version": "3.8.10"
195+
}
196+
},
197+
"nbformat": 4,
198+
"nbformat_minor": 5
199+
}

0 commit comments

Comments
 (0)