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 specification to use relative path for files listed in scans.txt used in cubids purge #345

Merged
merged 3 commits into from
Dec 19, 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
7 changes: 6 additions & 1 deletion cubids/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,12 @@ def _parse_purge():
"scans",
type=IsFile,
action="store",
help="path to the txt file of scans whose associations should be purged.",
help=(
"path to the txt file of scans whose associations should be purged. "
"When specifying files in this txt file, "
"always use relative paths starting from your BIDS directory. "
"e.g., ``sub-01/ses-01/func/sub-01_ses-01_task-rest_bold.nii.gz``"
),
)
parser.add_argument(
"--use-datalad",
Expand Down
2 changes: 1 addition & 1 deletion cubids/cubids.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def purge(self, scans_txt):
scans_txt : str
path to the .txt file that lists the scans
you want to be deleted from the dataset, along
with thier associations.
with their associations.
example path: /Users/Covitz/CCNP/scans_to_delete.txt
"""
self.scans_txt = scans_txt
Expand Down
4 changes: 3 additions & 1 deletion docs/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,15 @@ To do this, we run the ``cubids purge`` command.
``cubids purge`` requires as input a list of files to cleanly "purge" from the dataset.
You can create this file in any text editor,
as long as it is saved as plain text ``.txt``.
When specifying files in this text file,
always use relative paths starting from your BIDS directory.
For this example, we created the following file:

.. code-block:: console
$ cat no_ped.txt
/AN/EXAMPLE/PATH/CuBIDS_Test/BIDS_Dataset_Datalad/sub-02/ses-phdiff/func/sub-02_ses-phdiff_task-rest_bold.nii.gz
sub-02/ses-phdiff/func/sub-02_ses-phdiff_task-rest_bold.nii.gz
and saved it in our ``CuBIDS_Test directory``.
Expand Down
Loading