diff --git a/bagel/cli.py b/bagel/cli.py index fb1bc0a..5bd0e48 100644 --- a/bagel/cli.py +++ b/bagel/cli.py @@ -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=""" @@ -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: @@ -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. diff --git a/bagel/tests/test_cli_derivatives.py b/bagel/tests/test_cli_derivatives.py index b6b3088..7917043 100644 --- a/bagel/tests/test_cli_derivatives.py +++ b/bagel/tests/test_cli_derivatives.py @@ -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"] diff --git a/bagel/tests/test_cli_pheno.py b/bagel/tests/test_cli_pheno.py index 8e08774..aa257fc 100644 --- a/bagel/tests/test_cli_pheno.py +++ b/bagel/tests/test_cli_pheno.py @@ -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(