Skip to content

Commit

Permalink
[REF] Rename Neurobagel-created session to ses-unnamed (#358)
Browse files Browse the repository at this point in the history
* rename Neurobagel-created session

---------

Co-authored-by: Sebastian Urchs <[email protected]>
  • Loading branch information
alyssadai and surchs authored Oct 9, 2024
1 parent 826bc93 commit 7c82333
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
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

0 comments on commit 7c82333

Please sign in to comment.