Skip to content

Commit d9f5fc0

Browse files
authored
Merge pull request #345 from PennLINC/doc/purge_txt
Add specification to use relative path for files listed in scans.txt used in `cubids purge`
2 parents 376c097 + 44bca6f commit d9f5fc0

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

cubids/cli.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,12 @@ def _parse_purge():
578578
"scans",
579579
type=IsFile,
580580
action="store",
581-
help="path to the txt file of scans whose associations should be purged.",
581+
help=(
582+
"path to the txt file of scans whose associations should be purged. "
583+
"When specifying files in this txt file, "
584+
"always use relative paths starting from your BIDS directory. "
585+
"e.g., ``sub-01/ses-01/func/sub-01_ses-01_task-rest_bold.nii.gz``"
586+
),
582587
)
583588
parser.add_argument(
584589
"--use-datalad",

cubids/cubids.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ def purge(self, scans_txt):
726726
scans_txt : str
727727
path to the .txt file that lists the scans
728728
you want to be deleted from the dataset, along
729-
with thier associations.
729+
with their associations.
730730
example path: /Users/Covitz/CCNP/scans_to_delete.txt
731731
"""
732732
self.scans_txt = scans_txt

docs/example.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,15 @@ To do this, we run the ``cubids purge`` command.
211211
``cubids purge`` requires as input a list of files to cleanly "purge" from the dataset.
212212
You can create this file in any text editor,
213213
as long as it is saved as plain text ``.txt``.
214+
When specifying files in this text file,
215+
always use relative paths starting from your BIDS directory.
214216
For this example, we created the following file:
215217

216218
.. code-block:: console
217219
218220
$ cat no_ped.txt
219221
220-
/AN/EXAMPLE/PATH/CuBIDS_Test/BIDS_Dataset_Datalad/sub-02/ses-phdiff/func/sub-02_ses-phdiff_task-rest_bold.nii.gz
222+
sub-02/ses-phdiff/func/sub-02_ses-phdiff_task-rest_bold.nii.gz
221223
222224
223225
and saved it in our ``CuBIDS_Test directory``.

0 commit comments

Comments
 (0)