diff --git a/cohort_creator/_utils.py b/cohort_creator/_utils.py index 8d83a11..eabaaa6 100644 --- a/cohort_creator/_utils.py +++ b/cohort_creator/_utils.py @@ -40,7 +40,7 @@ def create_tsv_participant_session_in_datasets(output_dir: Path, dataset_paths: "DatasetID": [], "SubjectID": [], "SessionID": [], - "SessionPath": [], + "SessionFilePath": [], } for dataset in dataset_paths: @@ -60,7 +60,7 @@ def create_tsv_participant_session_in_datasets(output_dir: Path, dataset_paths: ses += "/" else: ses = "" - content["SessionPath"].append(f"{dataset.name}/sub-{sub}/{ses}") + content["SessionFilePath"].append(f"{dataset.name}/sub-{sub}/{ses}") df = pd.DataFrame(content) output_file = output_dir.parent / "code" / "participants.tsv" @@ -153,7 +153,7 @@ def check_tsv_content(tsv_file: Path | str) -> pd.DataFrame: def check_participant_listing(participant_listing: pd.DataFrame) -> None: - for col in ["SubjectID", "SessionPath"]: + for col in ["SubjectID", "SessionFilePath"]: if col not in participant_listing.columns: raise ValueError( f"Column '{col}' not found in participants listing data.\n" diff --git a/docs/visualize_neurobagel.py b/docs/visualize_neurobagel.py index 84604d6..a00c92c 100644 --- a/docs/visualize_neurobagel.py +++ b/docs/visualize_neurobagel.py @@ -54,7 +54,7 @@ def wrangle(df: pd.DataFrame) -> pd.DataFrame: present.append(i) df = df[mask] - df["dataset_name"] = df["SessionPath"].apply(lambda x: x.split("/")[1]) + df["dataset_name"] = df["SessionFilePath"].apply(lambda x: x.split("/")[1]) df["missing_age"] = df["Age"].isnull() diff --git a/inputs/participant-results.tsv b/inputs/participant-results.tsv index 14e2527..6602b4f 100644 --- a/inputs/participant-results.tsv +++ b/inputs/participant-results.tsv @@ -1,4 +1,4 @@ - DatasetID SubjectID Age Sex Diagnosis Assessment SessionID SessionPath NumSessions Modality + DatasetID SubjectID Age Sex Diagnosis Assessment SessionID SessionFilePath NumSessions Modality http://neurobagel.org/vocab/0f2f957a-7979-442c-92fc-b1f68c0d3b50 sub-01 38.0 http://purl.bioontology.org/ontology/SNOMEDCT/248153007 , , ses-1 /ds001454/sub-01/ses-1 2 http://purl.org/nidash/nidm#FlowWeighted, http://purl.org/nidash/nidm#T1Weighted http://neurobagel.org/vocab/0f2f957a-7979-442c-92fc-b1f68c0d3b50 sub-01 38.0 http://purl.bioontology.org/ontology/SNOMEDCT/248153007 , , ses-2 /ds001454/sub-01/ses-2 2 http://purl.org/nidash/nidm#FlowWeighted, http://purl.org/nidash/nidm#T1Weighted http://neurobagel.org/vocab/15abcd42-0f61-4b44-81bf-7b51ba15b14e sub-control05 36.0 http://purl.bioontology.org/ontology/SNOMEDCT/248153007 , , ses-1preEEG /ds001408/sub-control05/ses-1preEEG 2 http://purl.org/nidash/nidm#FlowWeighted, http://purl.org/nidash/nidm#T1Weighted diff --git a/tests/data/participants.tsv b/tests/data/participants.tsv index 25acbc3..28e2abc 100644 --- a/tests/data/participants.tsv +++ b/tests/data/participants.tsv @@ -1,4 +1,4 @@ -DatasetID SubjectID Age Sex Diagnosis SessionID SessionPath NumSessions Modality +DatasetID SubjectID Age Sex Diagnosis SessionID SessionFilePath NumSessions Modality ds000001 sub-03 26 Female PD n/a 1 [T1,T2,bold] ds000001 sub-17 25 Female CTL n/a 1 [T1,T2,bold] ds000002 sub-12 25 Female n/a 1 [T1,T2,bold] diff --git a/tests/test_utils.py b/tests/test_utils.py index 2b3a9f8..1dc5b2f 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -64,7 +64,7 @@ def test_create_tsv_participant_session_in_datasets(bids_examples, tmp_path): assert tsv_file.exists() df = pd.read_csv(tsv_file, sep="\t") - assert df.columns.tolist() == ["DatasetID", "SubjectID", "SessionID", "SessionPath"] + assert df.columns.tolist() == ["DatasetID", "SubjectID", "SessionID", "SessionFilePath"] assert df["DatasetID"].unique().tolist() == ["ds001", "ds006"]