From 4b01cce2dad1564608b440dd625cdd6bffb225ab Mon Sep 17 00:00:00 2001 From: Peyman-N Date: Tue, 10 Sep 2024 17:00:03 +0200 Subject: [PATCH 1/5] correct problems caused by changes in bids examples --- test/bids_examples_eeg_rest_fmri.jsonld | 181 +++++++++++------------- test/test_bids_examples.py | 2 +- 2 files changed, 80 insertions(+), 103 deletions(-) diff --git a/test/bids_examples_eeg_rest_fmri.jsonld b/test/bids_examples_eeg_rest_fmri.jsonld index 81e256d..0067dfd 100644 --- a/test/bids_examples_eeg_rest_fmri.jsonld +++ b/test/bids_examples_eeg_rest_fmri.jsonld @@ -118,7 +118,7 @@ { "@id": "_:000010", "@type": "https://openminds.ebrains.eu/core/FileRepository", - "IRI": "file:///home/peyman-user/Desktop/data/bids_test/bids-examples/eeg_rest_fmri", + "IRI": "file:///home/peyman-user/Desktop/Code/bids-examples/eeg_rest_fmri", "format": { "@id": "https://openminds.ebrains.eu/instances/contentTypes/application_vnd.bids" }, @@ -127,7 +127,7 @@ "unit": { "@id": "https://openminds.ebrains.eu/instances/unitOfMeasurement/byte" }, - "value": 1209081 + "value": 1208812 } }, { @@ -507,29 +507,6 @@ { "@id": "_:000035", "@type": "https://openminds.ebrains.eu/core/File", - "IRI": "PREFIXacq-NODDI66DIR_dwi.json", - "fileRepository": { - "@id": "_:000010" - }, - "hash": [ - { - "@type": "https://openminds.ebrains.eu/core/Hash", - "algorithm": "MD5", - "digest": "d5bfe26e13e1c579ddc7436e34696202" - } - ], - "name": "acq-NODDI66DIR_dwi.json", - "storageSize": { - "@type": "https://openminds.ebrains.eu/core/QuantitativeValue", - "unit": { - "@id": "https://openminds.ebrains.eu/instances/unitOfMeasurement/byte" - }, - "value": 269 - } - }, - { - "@id": "_:000036", - "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXacq-y224_T1w.json", "fileRepository": { "@id": "_:000010" @@ -551,7 +528,7 @@ } }, { - "@id": "_:000037", + "@id": "_:000036", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXacq-y232_T1w.json", "fileRepository": { @@ -574,7 +551,7 @@ } }, { - "@id": "_:000038", + "@id": "_:000037", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXdataset_description.json", "fileRepository": { @@ -597,7 +574,7 @@ } }, { - "@id": "_:000039", + "@id": "_:000038", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXparticipants.tsv", "fileRepository": { @@ -620,7 +597,7 @@ } }, { - "@id": "_:000040", + "@id": "_:000039", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/anat/sub-32_acq-y224_T1w.nii.gz", "contentDescription": "Data file for T1w of subject 32", @@ -659,7 +636,7 @@ "name": "voxel data" }, { - "@id": "_:000042", + "@id": "_:000041", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/anat/sub-32_acq-y232_T1w.nii.gz", "contentDescription": "Data file for T1w of subject 32", @@ -692,7 +669,7 @@ } }, { - "@id": "_:000043", + "@id": "_:000042", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/dwi/sub-32_acq-NODDI10DIR_dwi.bval", "fileRepository": { @@ -720,7 +697,7 @@ } }, { - "@id": "_:000044", + "@id": "_:000043", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/dwi/sub-32_acq-NODDI10DIR_dwi.bvec", "fileRepository": { @@ -748,7 +725,7 @@ } }, { - "@id": "_:000045", + "@id": "_:000044", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/dwi/sub-32_acq-NODDI10DIR_dwi.nii.gz", "contentDescription": "Data file for dwi of subject 32", @@ -781,7 +758,7 @@ } }, { - "@id": "_:000046", + "@id": "_:000045", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/dwi/sub-32_acq-NODDI33DIR_dwi.bval", "fileRepository": { @@ -809,7 +786,7 @@ } }, { - "@id": "_:000047", + "@id": "_:000046", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/dwi/sub-32_acq-NODDI33DIR_dwi.bvec", "fileRepository": { @@ -837,7 +814,7 @@ } }, { - "@id": "_:000048", + "@id": "_:000047", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/dwi/sub-32_acq-NODDI33DIR_dwi.nii.gz", "contentDescription": "Data file for dwi of subject 32", @@ -870,7 +847,7 @@ } }, { - "@id": "_:000049", + "@id": "_:000048", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/eeg/sub-32_task-rest_eeg.eeg", "fileRepository": { @@ -897,7 +874,7 @@ } }, { - "@id": "_:000050", + "@id": "_:000049", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/eeg/sub-32_task-rest_eeg.vhdr", "fileRepository": { @@ -925,7 +902,7 @@ } }, { - "@id": "_:000051", + "@id": "_:000050", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/eeg/sub-32_task-rest_eeg.vmrk", "fileRepository": { @@ -953,7 +930,7 @@ } }, { - "@id": "_:000052", + "@id": "_:000051", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-32/func/sub-32_task-rest_bold.nii.gz", "contentDescription": "Data file for bold of subject 32", @@ -986,7 +963,7 @@ } }, { - "@id": "_:000053", + "@id": "_:000052", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/anat/sub-35_acq-y224_T1w.nii.gz", "contentDescription": "Data file for T1w of subject 35", @@ -1019,7 +996,7 @@ } }, { - "@id": "_:000054", + "@id": "_:000053", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/anat/sub-35_acq-y232_T1w.nii.gz", "contentDescription": "Data file for T1w of subject 35", @@ -1052,7 +1029,7 @@ } }, { - "@id": "_:000055", + "@id": "_:000054", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/dwi/sub-35_acq-NODDI10DIR_dwi.bval", "fileRepository": { @@ -1080,7 +1057,7 @@ } }, { - "@id": "_:000056", + "@id": "_:000055", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/dwi/sub-35_acq-NODDI10DIR_dwi.bvec", "fileRepository": { @@ -1108,7 +1085,7 @@ } }, { - "@id": "_:000057", + "@id": "_:000056", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/dwi/sub-35_acq-NODDI10DIR_dwi.nii.gz", "contentDescription": "Data file for dwi of subject 35", @@ -1141,7 +1118,7 @@ } }, { - "@id": "_:000058", + "@id": "_:000057", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/dwi/sub-35_acq-NODDI33DIR_dwi.bval", "fileRepository": { @@ -1169,7 +1146,7 @@ } }, { - "@id": "_:000059", + "@id": "_:000058", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/dwi/sub-35_acq-NODDI33DIR_dwi.bvec", "fileRepository": { @@ -1197,7 +1174,7 @@ } }, { - "@id": "_:000060", + "@id": "_:000059", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/dwi/sub-35_acq-NODDI33DIR_dwi.nii.gz", "contentDescription": "Data file for dwi of subject 35", @@ -1230,7 +1207,7 @@ } }, { - "@id": "_:000061", + "@id": "_:000060", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/eeg/sub-35_task-rest_eeg.eeg", "fileRepository": { @@ -1257,7 +1234,7 @@ } }, { - "@id": "_:000062", + "@id": "_:000061", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/eeg/sub-35_task-rest_eeg.vhdr", "fileRepository": { @@ -1285,7 +1262,7 @@ } }, { - "@id": "_:000063", + "@id": "_:000062", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/eeg/sub-35_task-rest_eeg.vmrk", "fileRepository": { @@ -1313,7 +1290,7 @@ } }, { - "@id": "_:000064", + "@id": "_:000063", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-35/func/sub-35_task-rest_bold.nii.gz", "contentDescription": "Data file for bold of subject 35", @@ -1346,7 +1323,7 @@ } }, { - "@id": "_:000065", + "@id": "_:000064", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/anat/sub-36_acq-y224_T1w.nii.gz", "contentDescription": "Data file for T1w of subject 36", @@ -1379,7 +1356,7 @@ } }, { - "@id": "_:000066", + "@id": "_:000065", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/anat/sub-36_acq-y232_T1w.nii.gz", "contentDescription": "Data file for T1w of subject 36", @@ -1412,7 +1389,7 @@ } }, { - "@id": "_:000067", + "@id": "_:000066", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/dwi/sub-36_acq-NODDI10DIR_dwi.bval", "fileRepository": { @@ -1440,7 +1417,7 @@ } }, { - "@id": "_:000068", + "@id": "_:000067", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/dwi/sub-36_acq-NODDI10DIR_dwi.bvec", "fileRepository": { @@ -1468,7 +1445,7 @@ } }, { - "@id": "_:000069", + "@id": "_:000068", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/dwi/sub-36_acq-NODDI10DIR_dwi.nii.gz", "contentDescription": "Data file for dwi of subject 36", @@ -1501,7 +1478,7 @@ } }, { - "@id": "_:000070", + "@id": "_:000069", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/dwi/sub-36_acq-NODDI33DIR_dwi.bval", "fileRepository": { @@ -1529,7 +1506,7 @@ } }, { - "@id": "_:000071", + "@id": "_:000070", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/dwi/sub-36_acq-NODDI33DIR_dwi.bvec", "fileRepository": { @@ -1557,7 +1534,7 @@ } }, { - "@id": "_:000072", + "@id": "_:000071", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/dwi/sub-36_acq-NODDI33DIR_dwi.nii.gz", "contentDescription": "Data file for dwi of subject 36", @@ -1590,7 +1567,7 @@ } }, { - "@id": "_:000073", + "@id": "_:000072", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/eeg/sub-36_task-rest_eeg.eeg", "fileRepository": { @@ -1617,7 +1594,7 @@ } }, { - "@id": "_:000074", + "@id": "_:000073", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/eeg/sub-36_task-rest_eeg.vhdr", "fileRepository": { @@ -1645,7 +1622,7 @@ } }, { - "@id": "_:000075", + "@id": "_:000074", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/eeg/sub-36_task-rest_eeg.vmrk", "fileRepository": { @@ -1673,7 +1650,7 @@ } }, { - "@id": "_:000076", + "@id": "_:000075", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXsub-36/func/sub-36_task-rest_bold.nii.gz", "contentDescription": "Data file for bold of subject 36", @@ -1706,7 +1683,7 @@ } }, { - "@id": "_:000077", + "@id": "_:000076", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXtask-rest_bold.json", "fileRepository": { @@ -1729,7 +1706,7 @@ } }, { - "@id": "_:000078", + "@id": "_:000077", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXtask-rest_eeg.json", "fileRepository": { @@ -1752,7 +1729,7 @@ } }, { - "@id": "_:000079", + "@id": "_:000078", "@type": "https://openminds.ebrains.eu/core/File", "IRI": "PREFIXREADME", "fileRepository": { @@ -1775,45 +1752,48 @@ } }, { - "@id": "_:000080", + "@id": "_:000079", "@type": "https://openminds.ebrains.eu/core/Person", "familyName": "Deligianni", "givenName": "F." }, { - "@id": "_:000081", + "@id": "_:000080", "@type": "https://openminds.ebrains.eu/core/Person", "familyName": "Centeno", "givenName": "M." }, { - "@id": "_:000082", + "@id": "_:000081", "@type": "https://openminds.ebrains.eu/core/Person", "familyName": "Carmichael", "givenName": "D.W." }, { - "@id": "_:000083", + "@id": "_:000082", "@type": "https://openminds.ebrains.eu/core/Person", "familyName": "Zhang", "givenName": "G.H." }, { - "@id": "_:000084", + "@id": "_:000083", "@type": "https://openminds.ebrains.eu/core/Person", "familyName": "Clark", "givenName": "C.A." }, { - "@id": "_:000085", + "@id": "_:000084", "@type": "https://openminds.ebrains.eu/core/Person", "familyName": "Clayden", "givenName": "J.D." }, { - "@id": "_:000086", + "@id": "_:000085", "@type": "https://openminds.ebrains.eu/core/DatasetVersion", "author": [ + { + "@id": "_:000079" + }, { "@id": "_:000080" }, @@ -1828,9 +1808,6 @@ }, { "@id": "_:000084" - }, - { - "@id": "_:000085" } ], "behavioralProtocol": [ @@ -1845,16 +1822,16 @@ ], "experimentalApproach": [ { - "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/anatomy" + "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/neuroimaging" }, { - "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/electrophysiology" + "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/neuralConnectivity" }, { - "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/neuroimaging" + "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/anatomy" }, { - "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/neuralConnectivity" + "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/electrophysiology" } ], "fullName": "EEG, fMRI and NODDI at rest'", @@ -1887,6 +1864,22 @@ "@type": "https://openminds.ebrains.eu/controlledTerms/SemanticDataType", "name": "raw data" }, + { + "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/neuroimaging", + "@type": "https://openminds.ebrains.eu/controlledTerms/ExperimentalApproach", + "definition": "Any experimental approach focused on the non-invasive direct or indirect imaging of the structure, function, or pharmacology of the nervous system.", + "interlexIdentifier": "http://uri.interlex.org/base/ilx_0741206", + "name": "neuroimaging", + "preferredOntologyIdentifier": "http://uri.interlex.org/tgbugs/uris/readable/modality/Neuroimaging" + }, + { + "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/neuralConnectivity", + "@type": "https://openminds.ebrains.eu/controlledTerms/ExperimentalApproach", + "definition": "Any experimental approach focused on functional or anatomical connections between single neurons or populations of neurons in defined anatomical regions.", + "interlexIdentifier": "http://uri.interlex.org/base/ilx_0739393", + "name": "neural connectivity", + "preferredOntologyIdentifier": "http://uri.interlex.org/tgbugs/uris/readable/modality/Connectivity" + }, { "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/anatomy", "@type": "https://openminds.ebrains.eu/controlledTerms/ExperimentalApproach", @@ -1906,22 +1899,6 @@ "name": "electrophysiology", "preferredOntologyIdentifier": "http://uri.interlex.org/tgbugs/uris/readable/modality/Electrophysiology" }, - { - "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/neuroimaging", - "@type": "https://openminds.ebrains.eu/controlledTerms/ExperimentalApproach", - "definition": "Any experimental approach focused on the non-invasive direct or indirect imaging of the structure, function, or pharmacology of the nervous system.", - "interlexIdentifier": "http://uri.interlex.org/base/ilx_0741206", - "name": "neuroimaging", - "preferredOntologyIdentifier": "http://uri.interlex.org/tgbugs/uris/readable/modality/Neuroimaging" - }, - { - "@id": "https://openminds.ebrains.eu/instances/experimentalApproach/neuralConnectivity", - "@type": "https://openminds.ebrains.eu/controlledTerms/ExperimentalApproach", - "definition": "Any experimental approach focused on functional or anatomical connections between single neurons or populations of neurons in defined anatomical regions.", - "interlexIdentifier": "http://uri.interlex.org/base/ilx_0739393", - "name": "neural connectivity", - "preferredOntologyIdentifier": "http://uri.interlex.org/tgbugs/uris/readable/modality/Connectivity" - }, { "@id": "https://openminds.ebrains.eu/instances/technique/diffusionWeightedImaging", "@type": "https://openminds.ebrains.eu/controlledTerms/Technique", @@ -1933,9 +1910,12 @@ "name": "electroencephalography" }, { - "@id": "_:000094", + "@id": "_:000093", "@type": "https://openminds.ebrains.eu/core/Dataset", "author": [ + { + "@id": "_:000079" + }, { "@id": "_:000080" }, @@ -1950,15 +1930,12 @@ }, { "@id": "_:000084" - }, - { - "@id": "_:000085" } ], "fullName": "EEG, fMRI and NODDI at rest'", "hasVersion": [ { - "@id": "_:000086" + "@id": "_:000085" } ], "shortName": "EEG, fMRI and NODDI at rest'" diff --git a/test/test_bids_examples.py b/test/test_bids_examples.py index 6ceaeb2..7f3ed24 100644 --- a/test/test_bids_examples.py +++ b/test/test_bids_examples.py @@ -11,7 +11,7 @@ ("eeg_cbm", 20, 20, 2, 104, 40, 1), ("asl001", 1, 1, 2, 8, 3, 0), # Number of files in 'eeg_rest_fmri' is not correct as it doesn't contain files in derivated (issue raied #42) - ("eeg_rest_fmri", 3, 3, 6, 46, 22, 1)] + ("eeg_rest_fmri", 3, 3, 6, 45, 22, 1)] @pytest.mark.parametrize("dataset_label, dataset_subject_number, dataset_subject_state_number, dataset_person_number, dataset_files_number, dataset_file_bundles_number, dataset_behavioral_protocol_number", example_dataset) From 71a346a68a00a04ef3edc3f7d734f51db14fa972 Mon Sep 17 00:00:00 2001 From: Peyman-N Date: Mon, 16 Sep 2024 17:30:17 +0200 Subject: [PATCH 2/5] tying down bids-validator version --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c659fe2..6a46a3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,7 @@ name = "bids2openminds" version = "0.1.0" dependencies = [ + "bids-validator"== 1.14.6 "bids", "openminds >= 0.2.3", "click>=8.1", From 6fed1d08765e8f006173e3384bf177156675fc53 Mon Sep 17 00:00:00 2001 From: Peyman-N Date: Mon, 16 Sep 2024 17:33:39 +0200 Subject: [PATCH 3/5] typo --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6a46a3d..f8d2f84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "bids2openminds" version = "0.1.0" dependencies = [ - "bids-validator"== 1.14.6 + "bids-validator" == 1.14.6, "bids", "openminds >= 0.2.3", "click>=8.1", From 1241845b8cad2ba067d2c67ff6f413960640cfc0 Mon Sep 17 00:00:00 2001 From: Peyman-N Date: Mon, 16 Sep 2024 17:44:27 +0200 Subject: [PATCH 4/5] bids-standard ref --- .github/workflows/test.yml | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb7a358..1bc822e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,7 @@ jobs: with: repository: bids-standard/bids-examples path: bids-examples + ref: 7c18d6840982518a0251cfeb59fe5c4610099ea1 - name: Set up Python 3.11 uses: actions/setup-python@v5 diff --git a/pyproject.toml b/pyproject.toml index f8d2f84..794aaec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "bids2openminds" version = "0.1.0" dependencies = [ - "bids-validator" == 1.14.6, + "bids-validator == 1.14.6" , "bids", "openminds >= 0.2.3", "click>=8.1", From 6f6f03f0fe0a39edd7aef4b7bdd3529ccf2c7b9c Mon Sep 17 00:00:00 2001 From: Peyman-N Date: Mon, 16 Sep 2024 17:50:46 +0200 Subject: [PATCH 5/5] a little reminder --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1bc822e..6d4f33f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,7 @@ jobs: with: repository: bids-standard/bids-examples path: bids-examples + #Ties down to the current version of bids-examples as of 2024-09-16. If updated, please update the tests accordingly. ref: 7c18d6840982518a0251cfeb59fe5c4610099ea1 - name: Set up Python 3.11