You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/post/2025-07-02-DataPipeOSF/index.md
+28-14Lines changed: 28 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,46 +34,60 @@ DataPipe is a tool that allows you to collect and save data in OSF (Open Science
34
34
1.**Create an OSF Project**: Start by creating a new project in [OSF](https://osf.io/). This will be the container for your data and any related files. You can set up an account if you don't have one already, quite easily!
35
35
36
36
- Go to the OSF homepage and log in or create an account. You can easily sign up through institutional access.
37
-
- Click on "Create a New Project" and fill in the necessary details such as project title, description, and visibility settings. ***DO NOT SET IT AS PUBLIC*** as the data being saved will not be anonymized and may contain sensitive information.
37
+
- Click on "Create New Project" and fill in the necessary details such as project title, description, and visibility settings. Choose "Germany - Frankfurt" as the server location; this is important for data privacy and compliance with regulations such as GDPR.***DO NOT SET YOUR PROJECT AS PUBLIC*** as the data being saved will not be anonymized and may contain sensitive information.
38
38
39
39
2.**Create OSF Token**: You will need to create a token to grant DataPipe the necessary permissions to access your OSF project.
40
40
41
-
- Go to your OSF account settings and navigate to the "personal access tokens" section.
42
-
- Click on "Create a new token" and give it a name (e.g., "DataPipe Token").
41
+
- Go to your OSF "Settings" tab and navigate to the "Personal Access Tokens" section.
42
+
- Click on "Create Token" and give it a name (e.g., "DataPipe Token").
43
43
- Set the permissions for the token, ensuring it has access to read and write data in your project.
44
44
- Copy the generated token; you will need it later.
45
45
46
-
3.**Link OSF to DataPipe**: In DataPipe, you will need to link your OSF project using the token you created.
46
+
3.**Link OSF to DataPipe**: In [DataPipe](https://pipe.jspsych.org/), you will need to link your OSF project using the token you created.
47
47
48
-
- Open DataPipe, click Account on the topright corner and select settings.
49
-
- Click on the 'Set OSF Token' button and paste the token you copied earlier.
48
+
- Open DataPipe, click "Account" in the top-right corner and select "Settings".
49
+
- Click on the "Set OSF Token" button and paste the token you copied earlier from OSF.
50
50
51
51
4.**Create new experiment on DataPipe**: Now that your OSF project is linked, you can create a new experiment in DataPipe.
52
52
53
-
-Click on "Create New Experiment" in DataPipe.
53
+
-In the "My Experiments" DataPipe tab, click on the "Create New Experiment" button.
54
54
- Give the experiment a name - I recommend using the same name as your OSF project for consistency.
55
55
- Add the OSF project ID to the experiment settings. You can find the project ID in the URL of your OSF project (it is the alphanumeric string after osf.io/)
56
-
- Create a new OSF Data component called 'data'. This will create a folder - named data - in your OSF project where all the data collected will be saved.
57
-
-Choose Germany - Frankfurt as the server location for your DataPipe experiment. This is important for data privacy and compliance with regulations such as GDPR.
56
+
- Create a New OSF Data Component called "data". This will create a folder - named "data" - in your OSF project where all the data collected will be saved.
57
+
-Again, choose "Germany - Frankfurt" as the server location for your DataPipe experiment.
58
58
59
-
5.**Configure Data Collection**: Once the experiment is set up on DataPipe enable data collection on the Status section. You can optionally enable base64 data collection if you wish to encode any video, audio or image files as strings. 'Condition assignment' can also be enabled- this makes DataPipe loop through the conditions when it requests the data. When deciding whether these features are suitable, it's best to consider how you will preprocess the data. It's advised that you only enable the minimum needed as a security measure.
59
+
5.**Configure Data Collection**: Once the experiment is set up on DataPipe, enable data collection on the "Status" section. You can optionally enable base64 data collection if you wish to encode any video, audio, or image files as strings. "Condition assignment" can also be enabled- this makes DataPipe loop through the conditions when it requests the data. When deciding whether these features are suitable, it's best to consider how you will preprocess the data. It's advised that you only enable the minimum needed as a security measure.
60
60
61
-
6.**Save the data from the experiment hosted on GitHub**: If you are using a GitHub repository to host your experiment, you can save the data collected by writing the below code to the experiment HTML file. This bit of code should be called at the end of your experiment to ensure that all data is saved to the OSF project
61
+
6.**Save the data from the experiment hosted on GitHub**: If you are using a GitHub repository to host your experiment, you can save the data collected by writing the following code within the experiment HTML file. Here is what that code might look like...
62
62
63
-
- Here is what the code should look like in your experiment HTML file:
63
+
- Ensure you load the jsPsych DataPipe plugin, along with the rest of your plugins, within the head of the HTML script:
- This next bit of code should be called at the end of your experiment (albeit before running the timeline) to ensure that all data is saved to the OSF project, using the unique participant ID generated from the step above:
64
78
65
79
``` javascript
66
80
// Save data via DataPipe
67
81
timeline.push({
68
82
type: jsPsychPipe,
69
83
action: "save",
70
84
experiment_id: "xxxxxxxxxx", // This in generated in the DataPipe interface
71
-
filename:`${participantID}.csv`,
85
+
filename: `${participant_ID}.csv`,
72
86
data_string: () => jsPsych.data.get().csv(),
73
87
})
74
88
```
75
89
76
-
- On the experiment created on DataPipe, there is an 'Experiment ID'field. This is the ID you need to add to the `experiment_id` field in the code above.
90
+
- On the experiment created in DataPipe, there is an 'Experiment ID'field. This is the ID you need to add to the `experiment_id` field in the code above.
77
91
78
92
- The `filename` field can be customized to include the participant ID or any other identifier you prefer.
0 commit comments