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

  1. Create a Project Folder:
    • Inside the projectdata/ directory, create a new folder named after your project (e.g., YourProjectName).
  2. Copy Templates:
    • Copy template.xlsx from the templates/ folder to your project folder. Rename the file to YourProjectName.xlsx and 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.xlsx from the templates/ folder, rename it to YourProjectName_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.xlsx from the templates/ folder. Rename it to YourProjectName_id.xlsx, and fill the old id (same as in raw data) in the old_id column and the new id in the new_id column. 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.

Step 2: Organizing Raw Data

  1. Create Raw Data Folder:
    • Inside the rawdata/ directory, create a folder named after your project (e.g., YourProjectName).
  2. 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.

  1. 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

Step 3: Managing Questionnaires

  1. Creating New Questionnaires:
    • If a required questionnaire is not present in the resources folder, you can create it. Use the questionnairetemplate.xlsx file from the templates folder, and save the new questionnaire in resources with the appropriate name (e.g., TEST.xlsx for a test questionnaire).
  2. Modifying Questionnaires:
    • If you modify an existing questionnaire, save it in the projectdata folder to give it priority over the one in resources.

Final Data Structure

The completed data structure should look like this:

  • projectdata/:
    • YourProjectName/
      • YourProjectName.xlsx
      • YourProjectName_info.xlsx
      • TEST.xlsx (Modified version of a questionnaire, if applicable)
  • rawdata/:
    • YourProjectName/
      • Rawdatafile1.xlsx
      • Rawdatafile2.xlsx
  • resources/:
    • Questionnaire1.xlsx
    • Questionnaire2.xlsx

Running BEHDS.R

  1. Open behds.R in RStudio.
  2. In the second line of the script, enter your project name (e.g., proj = "YourProjectName").
  3. Click the Source button in the upper-right corner of RStudio.
  4. Wait for the process to complete.
  5. The converted BIDS structure will be saved in bids/YourProjectName/rawdata/.
  6. The feedback file YourProjectName.html and finished .csv files will be in bids/YourProjectName/derivatives/.

By following these steps, you can successfully organize and convert your data into the BIDS format using BEHDS.R.