|
| 1 | +--- |
| 2 | +title: Running Analyses |
| 3 | +sidebar_position: 2 |
| 4 | +--- |
| 5 | + |
| 6 | +# Running Analyses |
| 7 | + |
| 8 | +You have a several options for running the analysis. In all cases, you will need your unique `<meta-analysis-id>`, which you can access for each Meta-Analysis within your Project. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +Under the hood, analyses are managed by the [nsc-runner](https://github.com/neurostuff/nsc-runner) Python package, and executed by the [NiMARE](https://nimare.readthedocs.io/en/stable/) (Neuroimaging Meta-Analysis Research Environment) Python package. |
| 13 | + |
| 14 | +## Google Colab |
| 15 | + |
| 16 | +[](https://colab.research.google.com/github/neurostuff/neurosynth-compose-notebook/blob/main/run_and_explore.ipynb) |
| 17 | + |
| 18 | +The easiest way to run an analysis is to use the [Google Colab](https://colab.research.google.com/) notebook linked above. |
| 19 | + |
| 20 | +The provided notebook runs entirely in the cloud, and does not require any local installation of software. |
| 21 | +To use simply paste your analysis ID into the first cell (`META_ID`), and using the Toolbar selet (Runtime -> Run All) |
| 22 | +or the keyboard shortcut (Ctrl or ⌘ + F9) to run the notebook. |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +The notebook will install all required software, run the analysis, and upload the results to Neurosynth Compose. |
| 27 | +Once the analysis is complete, you can use the notebook to explore the results using the interative report, download an archive |
| 28 | +of the results, or browse the results in the Neurosynth Compose web interface, in the Meta-Analysis section of your Project. |
| 29 | + |
| 30 | +:::tip |
| 31 | +The Colab notebook has limited and varying freely available resources, and may not be able to run large analyses. |
| 32 | +If your analysis fails, try running it again, or using one of the other methods below. |
| 33 | +::: |
| 34 | + |
| 35 | +## Docker |
| 36 | + |
| 37 | +The easiest way to run analyses locally is to use the `nsc-runner` [Docker](https://www.docker.com/) image provided by Neurosynth Compose. |
| 38 | + |
| 39 | +Docker is a containerization technology that allows you to run software in a consistent environment, regardless of the underlying operating system. |
| 40 | + |
| 41 | +To run the Docker image, you will need to install Docker on your local machine. |
| 42 | +Instructions for installing Docker can be found [here](https://docs.docker.com/get-docker/). |
| 43 | + |
| 44 | +Once Docker is installed, you can run your analysis using the using the following command: |
| 45 | + |
| 46 | +``` |
| 47 | +docker run -it -v -v /local/dir:/results ghcr.io/neurostuff/nsc-runner:latest <meta-analysis-id> |
| 48 | +``` |
| 49 | + |
| 50 | +where `/local/dir` is the path to a local directory where you would like to save the results of your analysis, and `<meta-analysis-id>` is the ID of the meta-analysis you would like to run. |
| 51 | + |
| 52 | +The Docker image will download all required software, run the analysis, and upload the results to Neurovault & Neurosynth Compose. |
| 53 | +An HTML report will be saved in the results directory, and the results will be available in the Meta-Analysis section of your Project on Neurosynth Compose. |
| 54 | + |
| 55 | +### Updating the Docker image |
| 56 | + |
| 57 | +For every release of `nsc-runner`, we publish a corresponding Docker image. |
| 58 | + |
| 59 | +You can manually download a specific neuroscout-cli release as follows: |
| 60 | + |
| 61 | +``` |
| 62 | +docker pull ghcr.io/neurostuff/nsc-runner:<version> |
| 63 | +``` |
| 64 | + |
| 65 | +where `<version>` is the version of `nsc-runner` that you want to download. If you omit version, the latest stable version will be downloaded. |
| 66 | + |
| 67 | +You can see the tags available for download on [GitHub](https://github.com/neurostuff/compose-runner/pkgs/container/nsc-runner) |
| 68 | + |
| 69 | +## Manually prepared environment using pip |
| 70 | + |
| 71 | +:::warning |
| 72 | +Manually installing `nsc-runner` may be difficult due to complex dependencies in the SciPy stack, or fMRI-specific tooling. Proceed only if you know what you’re doing. |
| 73 | +::: |
| 74 | + |
| 75 | +Use pip to install `nsc-runner` from PyPI: |
| 76 | + |
| 77 | +``` |
| 78 | +pip install nsc-runner |
| 79 | +``` |
| 80 | + |
| 81 | +and then run the analysis using the following command: |
| 82 | + |
| 83 | +``` |
| 84 | +nsc-runner <meta-analysis-id> |
| 85 | +``` |
0 commit comments