Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve help message, README #6

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,27 @@ This is a command line interface (CLI) running BrainSpace on BIDS-compliant data

## Installation

A PyPi installation will follow soon. Until then, the recommended approaches for installing ba-timeseries-gradients is through Docker. To build it, download the repository and run the following command from the repository root:
The recommended approaches for installing ba-timeseries-gradients is through Docker or PyPi. To build it as a Docker image, download the repository and run the following command from the repository root:

```bash
docker build -t ba_timeseries_gradients .
```
docker build -t ba-timeseries-gradients .

To install through PyPi, run the following command:

```bash
pip install ba_timeseries_gradients
```

## Usage

The basic usage of the ba-timeseries-gradients CLI is as follows:
The basic usage of the ba_timeseries_gradients CLI is as follows, depending on whether you've installed through PyPi or Docker:

```
docker run ba-timeseries-gradients [OPTIONS] BIDS_DIR OUTPUT_DIR ANALYSIS_LEVEL
```bash
docker run --volume LOCAL_BIDS_DIR:BIDS_DIR --volume LOCAL_OUTPUT_DIR:OUTPUT_DIR ba_timeseries_gradients [OPTIONS] BIDS_DIR OUTPUT_DIR ANALYSIS_LEVEL
ba_timeseries_gradients [OPTIONS] BIDS_DIR OUTPUT_DIR ANALYSIS_LEVEL
```

For details on all the options, simply run:
The `BIDS_DIR` is the path to the BIDS directory containing the dataset to be analyzed. The `OUTPUT_DIR` is the path to the directory where the output will be saved. The `ANALYSIS_LEVEL` is the level of analysis to be performed, which can currently only be `group`.

```
docker run ba-timeseries-gradients -h
```
For a complete list of options see `ba_timeseries_gradients -h`. It is highly recommended to include options to filter the dataset for specific files. See the BIDS arguments section in the help for more details.
17 changes: 9 additions & 8 deletions src/ba_timeseries_gradients/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _get_parser() -> argparse.ArgumentParser:
files are volumetric, they must be in NIFTI format, and a parcellation
file must be provided.""",
epilog="""Issues can be reported at: https://github.com/cmi-dair/ba_timeseries_gradients.""",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)

mandatory_group = parser.add_argument_group("Mandatory arguments")
Expand Down Expand Up @@ -85,7 +86,7 @@ def _get_parser() -> argparse.ArgumentParser:
type=str,
action="append",
dest="sub",
help="The subject to include for finding BIDS files. Defaults to all subjects.",
help="The subject to include for finding BIDS files.",
)
bids_group.add_argument(
"--session",
Expand All @@ -94,38 +95,38 @@ def _get_parser() -> argparse.ArgumentParser:
type=int,
action="append",
dest="ses",
help="The session to include for finding BIDS files. Defaults to all sessions.",
help="The session to include for finding BIDS files.",
)
bids_group.add_argument(
"--suffix",
required=False,
default="bold",
type=str,
help="Suffix to use for finding BIDS files. Defaults to 'bold'.",
help="Suffix to use for finding BIDS files.",
)
bids_group.add_argument(
"--run",
required=False,
default=None,
type=int,
action="append",
help="The runs to include, may be supplied multiple times. Defaults to all runs.",
help="The runs to include, may be supplied multiple times.",
)
bids_group.add_argument(
"--task",
required=False,
default=None,
type=str,
action="append",
help="The tasks to include, may be supplied multiple times. Defaults to all tasks.",
help="The tasks to include, may be supplied multiple times.",
)
bids_group.add_argument(
"--extension",
required=False,
default=".nii.gz",
type=str,
dest="ext",
help="Extension to use for finding BIDS files. Defaults to '.nii.gz'.",
help="Extension to use for finding BIDS files.",
)
bids_group.add_argument(
"--datatype",
Expand Down Expand Up @@ -179,14 +180,14 @@ def _get_parser() -> argparse.ArgumentParser:
required=False,
default=logging.INFO,
type=int,
help="Verbosity level. Must be one of: 10 (DEBUG), 20 (INFO), 30 (WARNING), 40 (ERROR), 50 (CRITICAL). Defaults to 10.",
help="Verbosity level. Must be one of: 10 (DEBUG), 20 (INFO), 30 (WARNING), 40 (ERROR), 50 (CRITICAL).",
)
other_group.add_argument(
"--output_format",
required=False,
default="hdf5",
type=str,
help="Output format. Must be one of: 'hdf5', or 'json'. Defaults to 'hdf5'.",
help="Output format. Must be one of: 'hdf5', or 'json'.",
)
return parser

Expand Down