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

PR addressing issues I raised recently #346

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
25 changes: 17 additions & 8 deletions cubids/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _parse_apply():
)
parser.add_argument(
"edited_summary_tsv",
type=IsFile,
type=Path,
action="store",
help=(
"path to the _summary.tsv that has been edited "
Expand All @@ -273,7 +273,7 @@ def _parse_apply():
)
parser.add_argument(
"files_tsv",
type=IsFile,
type=Path,
action="store",
help=(
"path to the _files.tsv that has been edited "
Expand Down Expand Up @@ -440,23 +440,26 @@ def _parse_copy_exemplars():
)
parser.add_argument(
"exemplars_dir",
type=PathExists,
type=Path,
action="store",
help=(
"absolute path to the root of a BIDS dataset "
"containing one subject from each Acquisition Group. "
"name of the directory to create where to store exemplar dataset. "
"It will include one subject from each Acquisition Group. "
"It should contain sub-X directories and "
"dataset_description.json."
),
)
parser.add_argument(
"exemplars_tsv",
type=IsFile,
type=Path,
action="store",
help=(
"absolute path to the .tsv file that lists one "
"path to the .tsv that lists one "
"subject from each Acquisition Group "
"(*_AcqGrouping.tsv from the cubids-group output)"
"(*_AcqGrouping.tsv from the cubids-group output). "
"If the file is located in the code/CuBIDS "
"directory, then users can just pass the .tsv "
"filename instead of the full path "
),
)
parser.add_argument(
Expand Down Expand Up @@ -489,6 +492,12 @@ def _parse_copy_exemplars():
action="store",
help="Docker image tag or Singularity image file.",
)
parser.add_argument(
"--force-unlock",
action="store_true",
default=False,
help="unlock dataset before adding nifti info ",
)
return parser


Expand Down
6 changes: 5 additions & 1 deletion cubids/cubids.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def apply_tsv_changes(self, summary_tsv, files_tsv, new_prefix, raise_on_error=T

full_cmd = "\n".join(merge_commands + move_ops)
if full_cmd:
renames = new_prefix + "_full_cmd.sh"
renames = str(Path(self.path) / (new_prefix + "_full_cmd.sh"))

# write full_cmd to a .sh file
with open(renames, "w") as fo:
Expand Down Expand Up @@ -683,6 +683,10 @@ def copy_exemplars(self, exemplars_dir, exemplars_tsv, min_group_size):
exemplars_dir,
]
)
if "/" not in str(exemplars_tsv):
if not self.cubids_code_dir:
self.create_cubids_code_dir()
exemplars_tsv = self.path + "/code/CuBIDS/" + exemplars_tsv

# load the exemplars tsv
subs = pd.read_table(exemplars_tsv)
Expand Down