Skip to content

Commit

Permalink
[DOC] command line tools
Browse files Browse the repository at this point in the history
  • Loading branch information
bclenet committed Jan 10, 2024
1 parent 4c6c894 commit 0f71b31
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 26 deletions.
27 changes: 15 additions & 12 deletions docs/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,31 @@ for team in teams:
collection.rectify() # Rectified versions are created
```

> [! TIP]
> In the following examples, use `narps_results` or `python narps_open/data/results` indifferently to launch the command line tool.
```bash
# From the command line
$ python narps_open/data/results -h
usage: results [-h] (-t TEAMS [TEAMS ...] | -a) [-r]
narps_results -h
usage: results [-h] (-t TEAMS [TEAMS ...] | -a) [-r]

Get Neurovault collection of results from NARPS teams.
Get Neurovault collection of results from NARPS teams.

options:
-h, --help show this help message and exit
-t TEAMS [TEAMS ...], --teams TEAMS [TEAMS ...]
a list of team IDs
-a, --all download results from all teams
-r, --rectify rectify the results
options:
-h, --help show this help message and exit
-t TEAMS [TEAMS ...], --teams TEAMS [TEAMS ...]
a list of team IDs
-a, --all download results from all teams
-r, --rectify rectify the results

# Either download all collections
python narps_open/utils/results -a
narps_results -a

# Or select the ones you need
python narps_open/utils/results -t 2T6S C88N L1A8
narps_results -t 2T6S C88N L1A8

# Download and rectify the collections
python narps_open/utils/results -r -t 2T6S C88N L1A8
narps_results -r -t 2T6S C88N L1A8
```

The collections are also available [here](https://zenodo.org/record/3528329/) as one release on Zenodo that you can download.
Expand Down
11 changes: 7 additions & 4 deletions docs/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ The class `TeamDescription` of module `narps_open.data.description` acts as a pa

You can use the command-line tool as so. Option `-t` is for the team id, option `-d` allows to print only one of the sub parts of the description among : `general`, `exclusions`, `preprocessing`, `analysis`, `categorized_for_analysis`, `derived`, and `comments`. Options `--json` and `--md` allow to choose the export format you prefer between JSON and Markdown.

> [! TIP]
> In the following examples, use `narps_description` or `python narps_open/data/description` indifferently to launch the command line tool.
```bash
python narps_open/data/description -h
narps_description -h
# usage: __init__.py [-h] -t TEAM [-d {general,exclusions,preprocessing,analysis,categorized_for_analysis,derived,comments}]
#
# Get description of a NARPS pipeline.
Expand All @@ -26,7 +29,7 @@ python narps_open/data/description -h
# --json output team description as JSON
# --md output team description as Markdown

python narps_open/data/description -t 2T6S --json
narps_description -t 2T6S --json
# {
# "general.teamID": "2T6S",
# "general.NV_collection_link": "https://neurovault.org/collections/4881/",
Expand All @@ -41,7 +44,7 @@ python narps_open/data/description -t 2T6S --json
# "preprocessing.preprocessing_order": "We used the provided preprocessed data by fMRIPprep 1.1.4 (Esteban, Markiewicz, et al. (2018); Esteban, Blair, et al. (2018); RRID:SCR_016216), which is based on Nipype 1.1.1 (Gorgolewski et al. (2011); Gorgolewski et al. (2018); RRID:SCR_002502) and we additionally conducted a spatial smoothing using the provided preprocessed data set and SPM12. Here, we attach the preprocessing steps described in the provided data set. \nAnatomical data preprocessing\nThe T1-weighted (T1w) image was corrected for intensity non-uniformity (INU) using N4BiasFieldCorrection (Tustison et al. 2010, ANTs 2.2.0), and used as T1w-reference throughout the workflow. The T1w-reference was then skull-stripped using antsBrainExtraction.sh (ANTs 2.2.0), using OASIS as target template. Brain surfaces we
# ...

python narps_open/data/description -t 2T6S -d general --json
narps_description -t 2T6S -d general --json
# {
# "teamID": "2T6S",
# "NV_collection_link": "https://neurovault.org/collections/4881/",
Expand All @@ -53,7 +56,7 @@ python narps_open/data/description -t 2T6S -d general --json
# "general_comments": "NA"
# }

python narps_open/data/description -t 2T6S --md
narps_description -t 2T6S --md
# # NARPS team description : 2T6S
# ## General
# * `teamID` : 2T6S
Expand Down
18 changes: 11 additions & 7 deletions docs/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

## Using the runner application

The `narps_open.runner` module allows to run pipelines from the command line :
The `narps_open.runner` module allows to run pipelines from the command line.

> [! TIP]
> In the following examples, use `narps_open_runner` or `python narps_open/runner.py` indifferently to launch the command line tool.
```bash
python narps_open/runner.py -h
narps_open_runner -h
usage: runner.py [-h] -t TEAM (-r RANDOM | -s SUBJECTS [SUBJECTS ...]) [-g | -f]

Run the pipelines from NARPS.
Expand All @@ -19,13 +22,14 @@ python narps_open/runner.py -h
-f, --first run the first levels only (preprocessing + subjects + runs)
-c, --check check pipeline outputs (runner is not launched)

python narps_open/runner.py -t 2T6S -s 001 006 020 100
python narps_open/runner.py -t 2T6S -r 4
python narps_open/runner.py -t 2T6S -r 4 -f
python narps_open/runner.py -t 2T6S -r 4 -f -c # Check the output files without launching the runner
narps_open_runner -t 2T6S -s 001 006 020 100
narps_open_runner -t 2T6S -r 4
narps_open_runner -t 2T6S -r 4 -f
narps_open_runner -t 2T6S -r 4 -f -c # Check the output files without launching the runner
```

In this usecase, the paths where to store the outputs and to the dataset are picked by the runner from the [configuration](docs/configuration.md).
> [! NOTE]
> In this usecase, the paths where to store the outputs and to the dataset are picked by the runner from the [configuration](docs/configuration.md).
## Using the `PipelineRunner` object

Expand Down
9 changes: 6 additions & 3 deletions docs/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ report.markdown() # Returns a string containing the markdown

You can also use the command-line tool as so.

> [! TIP]
> In the following examples, use `narps_open_status` or `python narps_open/utils/status.py` indifferently to launch the command line tool.
```bash
python narps_open/utils/status -h
narps_open_status -h
# usage: status.py [-h] [--json | --md]
#
# Get a work progress status report for pipelines.
Expand All @@ -57,7 +60,7 @@ python narps_open/utils/status -h
# --json output the report as JSON
# --md output the report as Markdown

python narps_open/utils/status --json
narps_open_status --json
# {
# "08MQ": {
# "softwares": "FSL",
Expand All @@ -83,7 +86,7 @@ python narps_open/utils/status --json
# },
# ...

python narps_open/utils/status --md
narps_open_status --md
# ...
# | team_id | status | main software | fmriprep used ? | related issues | related pull requests | excluded from NARPS analysis | reproducibility |
# | --- |:---:| --- | --- | --- | --- | --- | --- |
Expand Down

0 comments on commit 0f71b31

Please sign in to comment.