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

[REF] Rename Neurobagel-created session to ses-unnamed #358

Merged
merged 3 commits into from
Oct 9, 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
10 changes: 6 additions & 4 deletions bagel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
get_subject_instances,
)

# TODO: Coordinate with Nipoppy about what we want to name this
CUSTOM_SESSION_LABEL = "ses-nb01"
CUSTOM_SESSION_LABEL = "ses-unnamed"

bagel = typer.Typer(
help="""
Expand Down Expand Up @@ -128,7 +127,9 @@ def pheno(

sessions = []
for session_row_idx, session_row in _sub_pheno.iterrows():
# If there is no session column, we create a session with a custom label "ses-nb01" to assign each subject's phenotypic data to
# Our data model requires a session. To support phenotypic data without sessions,
# we create a session with a fixed, but unusual CUSTOM_SESSION_LABEL and add the
# phenotypic data to that session.
if session_column is None:
session_label = CUSTOM_SESSION_LABEL
else:
Expand Down Expand Up @@ -309,7 +310,8 @@ def bids(
continue

# TODO: Currently if a subject has BIDS data but no "ses-" directories (e.g., only 1 session),
# we create a session for that subject with a custom label "ses-nb01" to be added to the graph.
# we create a session with a fixed, but unusual CUSTOM_SESSION_LABEL
# and add the imaging data info to a session with that label (or create it first).
# However, we still provide the BIDS SUBJECT directory as the session path, instead of making up a path.
# This should be revisited in the future as for these cases the resulting dataset object is not
# an exact representation of what's on disk.
Expand Down
2 changes: 1 addition & 1 deletion bagel/tests/test_cli_derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_custom_imaging_sessions_created_for_missing_session_labels(
for ses in sub["hasSession"]:
if (
ses["schemaKey"] == "ImagingSession"
and ses["hasLabel"] == "ses-nb01"
and ses["hasLabel"] == "ses-unnamed"
):
custom_ses_completed_pipes[sub["hasLabel"]] = len(
ses["hasCompletedPipeline"]
Expand Down
2 changes: 1 addition & 1 deletion bagel/tests/test_cli_pheno.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ def test_pheno_session_created_for_missing_session_column(
for sub in pheno["hasSamples"]:
assert 1 == len(sub["hasSession"])
assert sub["hasSession"][0]["schemaKey"] == "PhenotypicSession"
assert sub["hasSession"][0]["hasLabel"] == "ses-nb01"
assert sub["hasSession"][0]["hasLabel"] == "ses-unnamed"


def test_multicolumn_diagnosis_annot_is_handled(
Expand Down
Loading