BIDS Format and Validation
This page provides a detailed guide for running BEHDS. Follow the steps below to ensure proper data structure and usage of the tool.
For an example walkthrough using fictional questionnaires and data, click here.
Initial Setup
Download BEHDS from here.
After downloading and extracting BEHDS, you should have the following folder structure:
BEHDS 1.0.0/code/projectdata/rawdata/resources/templates/behds.R
Step 1: Setting Up Project Data
- Create a Project Folder:
- Inside the
projectdata/directory, create a new folder named after your project (e.g.,YourProjectName).
- Inside the
- Copy Templates:
- Copy
template.xlsxfrom thetemplates/folder to your project folder. Rename the file toYourProjectName.xlsxand fill it in with demographic data or variables not collected via questionnaires. Ensure that the variable names in the “ItemName” column match those used in the raw data. - Also, copy
template_info.xlsxfrom thetemplates/folder, rename it toYourProjectName_info.xlsx, and fill in the required information. - (optional) If you want to change the participant_id of your raw data to a new id, copy
template_id.xlsxfrom thetemplates/folder. Rename it toYourProjectName_id.xlsx, and fill the old id (same as in raw data) in theold_idcolumn and the new id in thenew_idcolumn. This could be useful if you use a different id on your behavioral data and you need to give it the same id as the MRI data.
- Copy
Step 2: Organizing Raw Data
- Create Raw Data Folder:
- Inside the
rawdata/directory, create a folder named after your project (e.g.,YourProjectName).
- Inside the
- Prepare and Structure Data:
- Modify your raw data in a spreadsheet program such as Excel. The data should be organized according to the program’s requirements (see next section).
- Save your modified raw data file as
YourProjectName_raw.xlsx(or any other name). Consistency in naming conventions will help keep things organized.
Structuring the Raw Data Files
- First Column (ID):
- The first column must be labeled “id” and contain a unique identifier for each participant. This identifier must be consistent across all files.
- Second Column (Session):
- The second column should be labeled “ses” and must indicate the session or measurement time point (e.g., 1, 2, 3). If there is only one session, enter “1.”. If there is a prescreening, you can give that the the time pint 0. Ensure each measurement time point has its row in the file.
Note: You can create multiple files containing all your data; it does not all have to be in one file. Ensure the “id” and “ses” columns are correct in each file.
- File Naming Guidelines:
- non-questionnaire data
- The subsequent columns for non questionnaire data should be named and filled according to all the items provided in the project data step.
- questionnaire data
- The columns for questionnaire items must be in the correct order.
- Column names must include the name of the questionnaire and must not be immediately preceded or followed by a letter.
- Example for the questionnaire “TEST”:
- Correct: TEST-01, TEST01, TEST_01, [TEST01], TEST[TEST01]
- Incorrect: QTEST01, TESTshort01, kTEST01, test01
- non-questionnaire data
Step 3: Managing Questionnaires
- Creating New Questionnaires:
- If a required questionnaire is not present in the
resourcesfolder, you can create it. Use thequestionnairetemplate.xlsxfile from thetemplatesfolder, and save the new questionnaire inresourceswith the appropriate name (e.g.,TEST.xlsxfor a test questionnaire).
- If a required questionnaire is not present in the
- Modifying Questionnaires:
- If you modify an existing questionnaire, save it in the
projectdatafolder to give it priority over the one inresources.
- If you modify an existing questionnaire, save it in the
Final Data Structure
The completed data structure should look like this:
- projectdata/:
YourProjectName/YourProjectName.xlsxYourProjectName_info.xlsxTEST.xlsx(Modified version of a questionnaire, if applicable)
- rawdata/:
YourProjectName/Rawdatafile1.xlsxRawdatafile2.xlsx
- resources/:
Questionnaire1.xlsxQuestionnaire2.xlsx
Running BEHDS.R
- Open
behds.Rin RStudio. - In the second line of the script, enter your project name (e.g.,
proj = "YourProjectName"). - Click the
Sourcebutton in the upper-right corner of RStudio. - Wait for the process to complete.
- The converted BIDS structure will be saved in
bids/YourProjectName/rawdata/. - The feedback file
YourProjectName.htmland finished.csvfiles will be inbids/YourProjectName/derivatives/.
By following these steps, you can successfully organize and convert your data into the BIDS format using BEHDS.R.