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

Add CLI command for summer school data preparation #57

Merged
merged 2 commits into from
Jun 12, 2024
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
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pip install b2aiprep
```

## Usage
Four commands are available through the CLI:
See commands available through the CLI:

```bash
b2aiprep-cli --help
Expand Down Expand Up @@ -119,10 +119,11 @@ See the [tutorial.ipynb](docs/tutorial.ipynb) for a few use examples of data in
This command organizes the data with the BIDS-like conversion tool, extracts audio features, and saves the whole thing
as a .tar file for easy distribution for the Bridge2AI Summer School:

```python3 b2aiprep/src/b2aiprep/summer_school_data.py \
--redcap_csv_path [path to RedCap CSV] \
--audio_dir_path [path to Wasabi export directory] \
--bids_dir_path [desired path to BIDS output] \
--tar_file_path [desired output path for .tar file]
```sh
b2aiprep-cli prepsummerdata \
[path to RedCap CSV] \
[path to Wasabi export directory] \
[desired path to BIDS output] \
[desired output path for .tar file]
```

21 changes: 21 additions & 0 deletions src/b2aiprep/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from b2aiprep.prepare import (
redcap_to_bids,
)
from b2aiprep.summer_school_data import prepare_summer_school_data
from b2aiprep.process import (
Audio,
SpeechToText,
Expand Down Expand Up @@ -55,6 +56,26 @@ def redcap2bids(
audiodir=audiodir,
)


@main.command()
@click.argument("redcap_csv_path", type=click.Path(exists=True))
@click.argument("audio_dir_path", type=click.Path(exists=True))
@click.argument("bids_dir_path", type=click.Path())
@click.argument("tar_file_path", type=click.Path())
def prepsummerdata(
redcap_csv_path,
audio_dir_path,
bids_dir_path,
tar_file_path
):
prepare_summer_school_data(
redcap_csv_path=Path(redcap_csv_path),
audio_dir_path=Path(audio_dir_path),
bids_dir_path=Path(bids_dir_path),
tar_file_path=Path(tar_file_path)
)


@main.command()
@click.argument("filename", type=click.Path(exists=True))
@click.option("-s", "--subject", type=str, default=None)
Expand Down
Loading