Cookiecutter template for creating a Snakebids BIDS App
To use this template, follow the instructions below. You do not need to clone this repository.
Install cookiecutter (if not already installed):
pip install cookiecutter
Use cookiecutter to create the new app based on this template. This will prompt you for details, such as your name, github username, name of the app, etc..
cookiecutter gh:akhanf/snakebids-app
Your app will be found in a new folder, e.g. my_bids_app
. Note that you choose the name of the app when you run cookiecutter, but it will be referred to as my_bids_app
in this document.
The new workflow has a setup.py and arrives ready to be installed, simply:
cd my_bids_app
pip install -e .
Then you can run the app with:
my_bids_app
-
Go to github.com and create a new repository. Make sure you set it Public if you want to use the Documentation feature.
-
Change directory to your app
cd my_bids_app
- Initialize as a git repo and push all the files to main
git init
git add .
git commit -m "initial commit"
git branch -M main
git remote add origin https://github.com/path/to_your/repository.git
git push -u origin main
Snakebids apps come pre-packaged with sphinx documentation that can be automatically generated by readthedocs. To set-up your readthedocs website, follow these steps:
-
Go to https://readthedocs.org/ and create an account (or link to your github account)
-
Click the
Import a Project
button -
Either click the new repository in the list, or click on Import Manual, and enter in name and url. Enter
main
as the branch. -
Click the Build Latest button to build the documentation. Note: You will get an error if the repository is Private.
The config file for your new workflow is located here:
my_bids_app/my_bids_app/config/snakebids.yml
You can edit th parse_args
dict to add or change the command-line parameters of your app. By default it is set-up as a standard BIDS App. Command-line parameters are passed to the config
dict accessible in your snakemake workflow.
You can also edit the pybids_inputs
dict to change what BIDS files are grabbed by PyBIDS. These are also modifiable from the command-line with the --filter-<imgtype>
options.
Please see the snakebids documentation for more details.
The Snakemake file for the actual workflow is located here:
my_bids_app/my_bids_app/workflow/Snakefile
Here you can add more rules, or include additional snakefiles that define rules. The preamble at the top of the Snakefile
is required for snakebids and should not be altered.
TO DO: add this functionality