-
Notifications
You must be signed in to change notification settings - Fork 0
/
03-research_protocols.Rmd
994 lines (625 loc) · 58.3 KB
/
03-research_protocols.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
# Research Protocols
----------
## Data Management
----------
### Storing Active Datasets
Lab data can be stored on Box, the psychology department server, and on external hard drives and CD's. Any data with personally identifying information can only be stored on non-networked, encrypted, external harddrives, flash drives, and CD's.
Although the the data is routinely backed up, the backup is only on-site – so make extra backups! Each lab member should back up raw data on an external hard drive, as well as the code needed to reproduce all analyses. You should not store data locally on your computer (but logging into your Box/server account on your computer is ok).
----------
### Data Organization
General notes on file naming:
- It is very important that files are named in a clear and consistent way to avoid confusion
- Generally, versions of data files, scripts, etc. that are kept in study folders are final versions, meaning that they are "master" copies rather than versions that are being edited by individual lab members.
- If you would like to edit a script for some reason, please copy it to your user folder and rename it adding \_\<your initials\>, eg., _fq to mark it as being edited by you. If we would like to use it for general study use, it will need to be checked and approved. If the check is successful and it is approved, only then can it replace the "master" script and the initials be removed.
- Data should generally be named in the following way: \<measure\>\_\<status\>\_\<if relevant, date in form YYYYMMDD\>\_\<if personal copy, initials\> (e.g., cbcl_raw_20201118_fq). Date is the date the data file was generated. If it was generated by a script, date needs to be updated each time the script is run.
If you have already run several independent projects and have a data organization structure that works well for you, feel free to use it. If not (or if you are looking for a change), the following structure is recommended (based on Neuropipe):
- projectName/subjects
- individual directories for each of your participants
- projectName/subjects/{subj}/analysis
- subject-specific analyses (e.g., 1st and 2nd level analysis – at the run level and experiment level)
- projectName/subjects/{subj}/data
- raw data for that participant, with the following directories…
- behavioralData (for, well, behavioral data)
- eyetrackingData (if applicable)
- nifti (raw nifti files / raw MRI and fMRI data)
- rois (participant-specific ROIs)
- projectName/subjects/{subj}/design
- timing files for that participant, with different directories for the different GLMs you’re running (and the different runs in the experiment)
- projectName/subjects/{subj}/fsf
- if you’re using FSL, put the .fsf fies here. If you’re using SPM or something else, save the files for setting up preprocessing and GLMs here
- projectName/subjects/{subj}/scripts
- Matlab, Python, R, or bash scripts that you used for that participant. You should keep the ‘template’ scripts elsewhere, but you can store scripts you modified specifically for that participant here
- projectName/scripts
- template scripts and that you may modify for each participant, as well as scripts and functions used for all participants and group analyses
- recommend making subdirectories for each type of analysis (e.g., behavior, pattern analysis, functional connectivity, univariate)
- if you have scripts that are the same for each participant, you can have symbolic links for them in your participant-specific scripts directories
- **naming convention for scripts**: Note that BABLab has decided on this naming conventions for scripts - \<measure or study\>\_\<purpose\>\_\<if personal copy or editing, initials\> (examples: mbb_cleaning_fq, cbcl_scoring_fq)
- projectName/results
- figures with main results, powerpoint or keynote presentations, manuscripts if you wish
- projectName/notes
- detailed notes about the design, analysis pipeline, relevant papers, etc
- projectName/group
- group analyses
- recommend making subdirectories for each type of analysis (e.g., behavior, pattern analysis, functional connectivity, univariate)
- projectName/task
- code for your behavioral experiment, stimuli, piloting information
- if you are running your presentation code off of the server, it will still be good to have a copy of the code here (but you can keep the stimuli only on the server if you’d like)
When you leave the lab, your projects directories should be set up like this, or something similarly transparent, so that other people can look at your data and code. You must do this, otherwise your analysis pipeline and data structure will be uninterpretable to others once you leave, and this will slow everyone down (and cause us to bug you repeatedly to clean up your project directory or answer questions about it).
Agreed upon organizational structure specific to MBB:
- /../Studies/Mind_Brain_Body/Scripts/\<wave\>/Data: This contains all data that are used in the scripts (including raw data, inputs, and outputs of the scripts). Each file needs to be named clearly (see naming convention for data above).
- /../Studies/Mind_Brain_Body/Scripts/\<wave\>/\<purpose, eg. scoring\>/\<if necessary, sub-folder for measure\>: scripts go here (e.g., /Scripts/Wave1/scoring/cbcl would contain script to score the cbcl)
----------
### Archiving Inactive Datasets
Before you leave, or upon completion of a project, you must archive old datasets and back them up. We will develop the instructions for this when we reach our first inactive dataset.
----------
## Ethics
----------
### IRB
**Consent, Assent, and Screening**
Links to [templates](https://ohrpp.research.ucla.edu/consent-templates/) from the UCLA research administration group.
#### How to request an IRB account
Click [here](https://webirb.research.ucla.edu/WEBIRB/Rooms/DisplayPages/LayoutInitial?Container=com.webridge.entity.Entity[OID[8990716E5E076B40BFE2D4D479617FD3]]) for steps on how to request of an IRB account
----------
### IBC
**What is the IBC?**
The IBC is the Institutional Biosafety Committee, which has the same purpose as the IRB but specific to research involving biohazards materials. The IBC is an arm of the UCLA Environment Health & Safety office (EH&S).
**How to Apply for Approval**
1. DBS approval and approval to collect any other biological samples is processed through UCLA SafetyNet, the IBC online system, which is the IBC’s equivalent to webIRB. SafetyNet is accessible [here](https://safetynet.research.ucla.edu/) with UCLA logon ID.
- IBC approval IS needed for blood samples
- IBC approval IS NOT needed for saliva, stool, or hair samples unless —
- Saliva is collected from dental procedures
- Stool or hair samples are contaminated with blood or infected with pathogens (e.g. HBV, HIV)
2. Once signed in, a new protocol is created by clicking ‘Create BUA’. A BUA is a Biological Use Authorization, which is synonymous with IBC protocol. Completing the BUA is just like completing an IRB protocol, but with a focus on the collection of biological samples.
3. A BUA (or IBC protocol) requires the following document in addition to information supplied in the online form:
- Lab Specific Biosafety Manual (includes the following)
- Laboratory Specific SOPs (based on general template available [here](https://ucla.app.box.com/v/ehs-bio-lab-biomanual))
- Bloodborne Pathogens Exposure Control Plan (based on general template available [here](https://ucla.app.box.com/v/ehs-bbp-ecp-template))
*NOTE:*
- Consultation with an EH&S is likely necessary to complete the BUA protocol. Contact EH&S or IBC employees with questions at [email protected] or [email protected].
- All EH&S documents are available [here](https://www.ehs.ucla.edu/documents).
- Additional documents may be required depending on the kind of biological material that’s going to be collected.
4. Once a BUA is completed, it will appear under ‘Submissions.’
5. IBC staff may require that modifications be made to the protocol, just as the IRB would. You may reply to modification requests and make modifications in the same way that you would for an IRB protocol, by logging your response to a reviewers comment and then making the necessary change in the protocol itself.
6. Once all modifications are made, there are two more requirements before a BUA can be approved:
- Staff involved in collecting biological samples must acquire necessary training
- Training may be completed via the UCLA [WorkSafe](https://worksafe.ucla.edu/Ability/Programs/Standard/Control/elmLearner.wml?PortalID=LearnerWeb) portal accessible with UCLA logon ID.
- For Dried Blood Spot collection, the following trainings are required of any staff working directly with samples:
- NIH Guidelines for UCLA Researchers IBC Compliance Training (online)
- Laboratory Safety Fundamentals (online)
- Blood-borne Pathogens Training (online)
- Medical Waste Management (online)
- Biological Safety Cabinet (BSC) (online)
- Biosafety ABC's - Biosafety Level 2 Training (in-person)
- The PI is required to complete two courses :
- NIH Guidelines for UCLA Researchers: IBC Compliance Training (online)
- Laboratory Safety for PIs and Lab Supervisors (in-person)
- Training must be up to date. Training certificates are maintained on the BAB Lab Box at BABLAB/Lab/Training/IBC
- A room inspection must be done to approve the use of physical space for sample collection and storage.
- The room inspection is arranged directly with EH&S staff.
----------
## Questionnaire Database
In Box you can find a questionnaire database for the BABLab. This is different from the study specific questionnaire folders! This database is a repository for all of the questionnaires we have used or thought about using in our research. Organizing them here makes it easy for future BABLab members to plan, organize, and reproduce studies!
This includes the questionnaires used in all of our studies, including source material. In addition, the questionnaire database excel file contains information such as a brief description and reference (needed for IRB protocols and the like).
You can find the questionnaire database at the following path:
- Box/BABLAB/Lab/Questionnaires
You can find the questionnaire database spreadsheet at the following path:
- Box/BABLAB/Lab/Questionnaires/Questionnaire_database.xlsx
When making a new study, please add your questions to the database, including a category and a reference! Adding a category makes it easy to filter this sheet by category when exploring measures.
![<!--- Q database --->](images/lab_protocols/questionnaire_database/1.png)
Please create a folder for each questionnaire within the database to allow for the organization of source material. For example, the scq (social cravings questionnaire) was adapted from the fcq (food cravings questionnaire). Therefore, in the scq folder I included the original measure for the fcq, and a paper in which it is desribed and validated. In addition, if you have created this questionnaire as an instrument in REDCap - please upload the zipped file of the instrument to this folder! This will save a great deal of time for future researchers!
![<!--- Q database --->](images/lab_protocols/questionnaire_database/2.png)
![<!--- Q database --->](images/lab_protocols/questionnaire_database/3.png)
----------
## Interviews
### KSADS
- Align expectations from the start (semi-structured interview)
- Encourage brief responses
- Can write down details later
- Dive in and direct participant
- Read the threshold criteria
----------
## Tests
----------
### WASI
----------
#### WASI Administration
Ensure you have all necessary materials (WASI/WIAT administration instruction sheet, WASI score sheet, pencil with NO eraser, WASI administration booklet, WASI score book)
**Part I: Vocabulary**
*General Instruction*: You will be pointing to each item in the WASI administration booklet and asking the child/adolescent what this item is/if they can describe what this item means to you
1. Start audio recording
2. Flip the WASI administration booklet to page 41, item #4 (what is a shirt?)
3. Flip WASI scoring booklet to page 74, beginning with item #4 (what is a shirt?)
- Use the WASI scoring booklet to determine if child/adolescent’s description of each item shall be categorized as score 0, 1, or 2
- *Note*: Q indicated on the scoring booklet refers to prompt/query the child further- “Can you tell me more?”
- Provide queries as often as necessary- marginal responses, generalized responses, functional responses, and gand gestures, but NOT answers that are clearly incorrect
4. Note score on the WASI score sheet: Vocabulary
5. If the child does not obtain a perfect score on either item 4 or item 5, administer the preceding items in reverse order until two consecutive perfect scores are obtained
6. Stop administering when the child/adolescent receives 3 consecutive Zeros *OR* participant hits max score for age group (age 6: item 22; age 7-11: item 25; age 12-14: item 28)
7. Keep audio recording for Part II: Matrix Reasoning
*Note: These will be audio recorded and can sometimes move quickly- can be scored later*
**Part II: Matrix Reasoning**
*General Instruction*: You will be pointing to each matrix reasoning question in the WASI administration booklet and asking the child/adolescent where this item belongs in the missing box
1. Flip the WASI administration booklet to page 57- Practice Questions
- Explain you will do a few practice questions first then walk through 2 practice questions
- You may acknowledge correct responses/explain why answers may be incorrect
2. Flip to correct start page/item to begin (age 6-8: item 1; age 9+: item 4)
- Do NOT give verbal acknowledgement to their answers (e.g. Correct! That’s right!)
3. If adolescents age 9+ do not obtain a perfect score on either item 4 or item 5, administer the preceding items in reverse order until two consecutive perfect scores are obtained
4. Note score on the WASI score sheet: Matrix Reasoning
5. Stop administering when the child/adolescent receives 3 consecutive Zeros *OR* participant hits max score for age group (age 6-8: item 24)
6. Stop audio recording
----------
#### WASI Scoring
**Part I**
1. Examiner writes “scored by: NAME” at the top of the sheet
2. Fill in any missing scores in Vocabulary or Matrix Reasoning tests using audio file if questions are missing (e.g. scores continue before and after this missing question, NOT because the administrator left questions blank because they have stopped the test)
3. Add up the Vocabulary total raw score:
- *Note*: Even if a participant begins at item 4 due to age, the total raw score should still include items 1-3
4. Add up Matrix Reasoning total raw score
5. Transfer both total raw scores to front sheet under “Total Raw Score to T-Score Conversion” chart in column titled “Raw Score"
**Part II**
1. Ensure you have the participant’s correct age at day of testing in the upper right corner
2. Open WASI-II Manual book > page 151 for T-Score Conversions
- Flip to correct chart by age group (age group indicated at top of chart using year:month format)
- Under the correct chart by age group of the participant, view VC column for Vocabulary and MR column for Matrix Reasoning
- Scroll down VC column for correct Vocabulary total raw score and acquire T-Score equivalent (horizontally)
- Scroll down MR column for correct Matrix Reasoning total raw score and acquire T-Score equivalent (horizontally)
- Write T-Score number in the boxes under “Total Raw Score to T-Score Conversion” chart in column titled “T-Scores”
- Add T-Scores totals for box titled “Full Scale-2”
- Copy this total number to “Sum of T-Scores to Composite Score Conversion” chart in column titled “Sum of T-Scores"
3. Flip WASI-II Manual book > page 188 for FSIQ, Percentile Rank, and Confidence Interval
- **To obtain FSIQ**: Scroll down Sum of T-Scores column and compare horizontally to FSIQ-2 column
- **To obtain Percentile Rank**: Scroll down Sum of T-Scores column and compare horizontally to Percentile Rank column
- **To obtain Confidence Interval (always circle/indicate 95%)**: Scroll down Sum of T-Scores column and compare horizontally to 95% column in correct age group
----------
### WIAT
----------
#### WIAT Administration
Ensure you have all necessary materials (WASI/WIAT administration instruction sheet, WIAT score sheet, 2 pencils with NO erasers, WIAT word reading list, WIAT Math problems sheet)
**Part I: Word Reading**
*General Instruction*: You will be asking the child/adolescent to read off the WIAT word reading list left to right, top to bottom until they can no longer read the words
1. Start audio recording
2. Note in scoring sheet what grade participant is in
3. Note the following basic scoring instructions:
- **(1)** if fluent/correct
- **(DK)** if the child does not know
- **(>3)** if it took the child longer than 3 seconds to say
- **(SC)** if the child said the word wrong but self-corrected
4. If multiple attempts are made to read a word, score only the last attempt
5. If the child is sounding the word out/verbalizes the word in a choppy manner, ask the child to “read the word altogether” immediately after
- If the next attempt is not fluent, score as 0 and say “try the next one”
6. If the child skips a word or row, redirect the child to the appropriate place immediately after and make a note in the scoring sheet
7. If the child was unclear when reading a word/you did not hear the child correctly, ask the child to repeat the whole row of words where this particular word was located at the very end after they have finished reading all they can
8. Discontinue after the child has reached 4 consecutive Zeros
**Part II: Numerical Operations**
1. You will be asking the child to fill out the “math worksheet” him/herself
- Indicate where to begin based on age (Grades K-1: item 1; grades 2-4: item 14; grades 5-12+: item 18)
- Explain to the child/adolescent to work on problems from left to right, top to bottom in order and if they do not know a question they may skip it
- If beginning at item 1, refer to WIAT scoring sheet for specific verbal administration instructions
2. If child does not reach 3 consecutive scores of 1, reverse backward until child has reached a correct response
3. Be sure to pay attention to the child’s responses- if the numbers they write are illegible or mirrored, ask the child to verbally indicate the response they meant
- Note that you obtained a verbal response and note the actual response in your WIAT score sheet
4. Discontinue this task when they have reached 4 consecutive Zeros
5. Stop audio recording
----------
#### WIAT Scoring
**Part I**
1. Examiner writes “scored by: NAME” at the top of the sheet
2. Fill in any missing scores in Vocabulary or Matrix Reasoning tests using audio file if questions are missing (e.g. scores continue before and after this missing question, NOT because the administrator left questions blank because they have stopped the test)
3. Add up the Word Reading Total Raw Score:
- Add up Word Reading Total Score Box
- Add up Total >3" Box
- Add up Total SC Box
4. Word Reading Speed Total Raw Score:
- Listen to the audio file and note time participant began to read words
- Count 30 seconds forward
- Note the word the participant completed at 30 seconds; write item number of this word in box
5. Add up the Numerical Operations Total Raw Score
- *Note*: Even if a participant begins at item 8 due to age, the total raw score should still include items 1-7
6. Transfer both Word Reading Total Raw Score and Numerical Operations Total Raw Score to front page under “Composite Score Summary” chart
**Part II**
1. Ensure you have the participant’s correct age at day of testing in the upper right corner
2. To obtain the Composite Standard Score:
- Flip WIAT-III Manual book > page 252-387 for Table C.1 based on age of participant (noted at top of chart by year, month, days range)
- Scroll down Word Reading column and compare horizontally to Standard Score column; write standard score in “Composite Standard Score” box
- Scroll down Numerical Operations column and compare horizontally to Standard Score column; write standard score in “Composite Standard Score” box
3. To obtain the Confidence Interval (always at 95%):
- Flip WIAT-III Manual book > page 392 for Table C.3
- Follow column for correct age > 95% > Word Reading
- Add and subtract this number to/from the Composite Standard Score: Word Reading to create highest and lowest numbers for the Confidence Interval
- Follow column for correct age > 95% > Numerical Operations
- Add and subtract this number to/from the Composite Standard Score: Numerical Operations to create highest and lowest numbers for the Confidence Interval
4. To obtain GRADE-LEVEL equivalents of score: (*Note: No longer doing percentile*)
- Flip WIAT-III Manual book > page 398 for Table D.2
- Scroll down through Word Reading column and look for raw score, view to left column for grade equivalent
- Flip WIAT-III Manual book > page 402 for Table D.2
- Scroll down through Numerical Operations column and look for raw score, view to left column for grade equivalent
----------
## Behavioral Coding
----------
### FIMS
- Always code positive video first (could be colored by negative video)
- When not obvious use the process of elimination
- Make notes while coding
- Maturity for child for their age
- Attunement = harmonious
[FIMS Behavioral Training Protocol](https://docs.google.com/document/d/1oLEg1gAdpcrDWg1Vlh0z_esq9fBy9CKBrNuU-ZokaKg/edit?usp=sharing)
[FIMS Behavioral Coding Protocol](https://docs.google.com/document/d/1zd4BD7-yQZxle4bH_cXrEaqFAd3MCVKATnVE1PnWn_4/edit?usp=sharing)
----------
## Physiological Measurement
----------
### ECG
Electrocardiogram (ECG) measures a subject’s heart rate and waveform pattern. With each heartbeat, an electrical signal travels through the heart. This electrical wave causes the muscle to squeeze and pump blood from the heart. ECG measures this wave through electrodes placed across the torso. By collecting ECG, you can detect changes in heart function due to certain stimuli. Things like stress, excitement, fear, and other emotional responses can be physiologically measured based on changes in the ECG readouts.
**Biopac Setup**
- In our ECG setup, we have one transmitter with one channel.
- The red and white leads are the signal, the black lead is the ground.
- Because we are using a wireless setup, there needs to be a clear line of sight between the transmitter and the receiver.
**Electrode Placement**
- We will be placing 2 electrodes just below the collarbones and one electrode on the lowest left rib.
**Filtering and Signal Frequency**
- We will sample ECG at a rate of 2kHz, or 2000 samples/second. This gives us a resolution high enough to catch all of the important parts of the heartbeat waveform.
- Noise is not much of an issue with collecting ECG in a 3-electrode setup.
**Subject Position**
- Ensure that the subject is in a comfortable position, so that body movement can be completely avoided or reduced to the minimal. The subject should be asked not to talk, move, read or make phone calls during the procedure.
- Ensure that the position of the subject is the same if there are multiple sessions. Timing of unavoidable body movement or motion artifacts should be noted and the recording periods with motion artifacts must be removed before analysis.
**Gathering ECG Data**
- Lightly abrade the skin at the electrode sites with EL-Prep Gel
- Wipe off excess with a wet wipe or tissue
- After prepping the electrodes with Gel-100, attach electrodes to the skin at the three positions indicated above
- Let these sit as long as possible to adhere and for the gel to soak in
- Ask the participant to put on the module like a belt around their torso
- Make sure the electrode lead inputs are pointed up towards their head
- Connect the white lead to the Right Collarbone electrode, connect the black lead to the Left Collarbone electrode, and connect the red lead to the Left Rib electrode
- Turn on the transmitter and ensure that both the light on the Biopac receiver module and the transmitter are green (the transmitter should be flashing, whereas the receiver should be solid)
- Make sure there is a clear, unobstructed line of sight between the transmitter and receiver antenna
- Open AcqKnowledge by selecting the template file on the desktop
- If the system is not connected to the hardware, make sure the wifi is turned off and restart AcqKnowledge
- Ensure all devices are connected and lead wires attached properly
- Hit the green “Start” button and click through all of the dialog boxes that you’re prompted with
-----------
### EGG
**Biopac Setup**
- In our EGG setup we have one transmitter with two channels (A and B).
- The white leads are the reference, the red are the signal, and the black is the ground.
- Each transmitter needs to have a ground.
- Because we are using a wireless setup, there needs to be a clear line of sight between the transmitter and the receiver.
**Electrode Placement**
- We will place the two white electrodes side-by-side on the xyphoid (which is the lower part of the sternum).
- We will place the two red electrodes in position 1 and 4 in the diagram above.
- We will place the black electrode (the ground) on the second from bottom rib on the left. Try to get it over the bone as much as possible.
- Position 1 should be in line with the reference electrode, and position 4 should be in line with the ground.
- Next, we need to have the transmitter up high on the participants chest so there is line of sight between the transmitter and receiver (antenna).
*Alternative*:
- Regular electrocardiogram (ECG) electrodes can be used for EGG recordings.
- The most commonly used configuration for recording 1-channel EGG is to place one electrode at the midpoint on a line connecting the xiphoid and umbilicus, and the other electrode 5 cm away (up and 45 degree) to the patient’s left.
- The ground electrode is placed on the left costal margin horizontal to the first active electrode.
**Filtering and signal frequency**
- *Amplification*: the EGG signal is usually in a range of 50-500 μV and adequate amplification needs to be provided by a recording device so that the amplified signal is of an appropriate range for display and analysis
- *Filter setting*: determines the frequency range of the EGG signal to be maximally amplified. The interested range of the EGG signal is in the range of 0.5-9.0 cpm or 0.0083 to 0.15 Hz which is much lower than that of most of extracellular recordings.
- In addition to the basic fundamental frequencies of 0.5-9.0 cpm, it is also important to record certain harmonics (multiples of the fundamental frequency). Accordingly, an appropriate frequency setting is in the range of 0.0083 to 1 Hz.
**Skin Preparation**
- First, the abdominal skin where the electrodes are to be positioned should be thoroughly cleaned to ensure that the impedance between the pair of electrodes is below 10 kΩ.
- To do so, it is advised to abrade the skin until it turns pinkish using some sandy skin-preparation jelly, and then apply a thin layer of electrode jelly for 1 minute for the jelly to penetrate into the skin.
- Before placing the electrode, the excessive jelly must be completely wiped out.
**Subject Position**
- Ensure that the subject is in a comfortable position, most commonly supine, so that body movement can be completely avoided or reduced to the minimal. The subject should be asked not to talk, move, read or make phone calls during the procedure.
- Ensure that the position of the subject is the same if there are multiple sessions. Timing of unavoidable body movement or motion artifacts should be noted and the recording periods with motion artifacts must be removed before analysis.
**Duration of Recording**
- A common mistake in recording the EGG is that the recording is too short. Unlike the ECG in which there are about 60 waves every minute, the EGG is composed of only 3 waves every minute. That is, if the recording is of a short duration of 5 minutes, there are only 15 waves which are obviously insufficient for analysis and interpretation.
- Ideally, at least a 30-minute period is needed to ensure an accurate measure of gastric slow waves in a particular state, such as fasting, fed, baseline or after intervention.
**Meals**
- We will ask participants to eat something about 1 hour before they come into the lab.
- Then we will give them water (as a test meal) immediately before performing the EGG.
- The subjects should all drink the same amount of water.
**Analysis**
- The EGG also contains respiration artifact that is between 12-25 cpm and sometimes the ECG artifacts (< 60 cpm). Occasionally, the slow wave of the small intestine may also be recorded in the EGG (9-12 cpm).
- Although these interferences distort gastric slow waves in the EGG, their frequencies do not overlap with that of the gastric slow waves. Consequently, spectral analysis can be performed to separate the gastric slow waves from interferences.
- Before spectral analysis is performed, any periods with motion artifacts must be identified and deleted because motion artifacts can not be separated from the gastric slow waves even with spectral analysis. So we will need to record their motion during the task.
**Dominant Frequency and Power**
- The dominant frequency and power of the EGG can be derived from the power spectral density assessed by the periodogram method. The normal range of the dominant frequency of the EGG is between 2 to 4 cpm.
- The EGG is called bradygastria if its dominant frequency is lower than 2 cpm, tachygastria if its dominant frequency is higher than 4 cpm but lower than 9 cpm, and arrhythmia if there is no dominant peak power in the spectrum
**Power Ratio or Relative Electrogastrography**
- *Power Change*: The ratio of dominant EGG powers after and before an intervention is a commonly used parameter that is associated with alteration in gastric contractions. It is generally accepted that a ratio of > 1 reflects an increase in gastric contractility due to the intervention, whereas a ratio of < 1 reflects a decrease in gastric contractility.
- If the decibel (dB) unit is used, the ratio should be replaced by the difference between the baseline and after intervention.
- *Percentage of Normal Gastric Slow Waves*: The percentage of normal slow waves is a quantitative assessment of the regularity of the gastric slow wave measured from the EGG. It is defined as the percentage of time during which normal gastric slow waves are observed in the EGG. The percentage of normal slow waves can be computed from the running power spectra of the EGG.
- In this method, 1 spectrum is derived from every 1 minute (or some other short period) of EGG data; the minute is considered normal if its EGG spectrum exhibits a dominant power in the range of 2-4 cpm. In humans, the normal percentage of gastric slow wave is defined as 70%.
- *Percentage of Gastric Dysrhythmia*: The percentage of gastric dysrhythmia is defined as the percentage of time during which gastric dysrhythmia is observed in the EGG. It is computed in the same way as that for the percentage of normal slow waves.
- It is further classified into the percentage of bradygastria, the percentage of tachygastria and the percentage of arrhythmia.
------------
### GSR
Electrodermal response (EDR) measurements (including Galvanic Skin Response, GSR) show the activity of the eccrine sweat glands. Typically, one will place electrodes where the concentration of these glands is the highest: namely, the fingertips. The activity of the eccrine sweat glands as a response to physiological excitation (stress, fear, etc.) serves to increase the conductivity of the skin when activated. When one applies a very small electric voltage (0.5 V) between two electrodes, the manifested electrical conductance varies in direct proportion to the electric current flowing between the electrodes. For instance, if a subject is presented a stimulus and the palms start to sweat, this response indicates a highly-stimulated state. The EDR of this subject will then be higher than the subject’s baseline. If another subject receives the same stimulus and the palms remain as "cool as a cucumber," the EDA reading will remain unchanged with respect to the baseline. EDR undergoes relatively fast habituation (decrease of amplitude) in the event the same stimulus is repeated over and over to the same subject.
**Biopac Setup**
- In our GSR setup, we have one transmitter with one channel.
- The red lead is the signal, the black lead is the ground.
- Because we are using a wireless setup, there needs to be a clear line of sight between the transmitter and the receiver.
**Electrode Placement**
- We will be placing the signal electrode on the middle finger of the child’s non-dominant hand.
- This has been noted to be the region of the hand with the most concentrated and reactive eccrine sweat glands, and using the non-dominant ensures that the participants will be able to continue with other activities that they may be tasked with while hooked up to the GSR module.
- The ground electrode can be attached anywhere within reach of the transmitter leads. While the above paper grounded to a position on the participant’s arm, for the sake of consistency and simplicity, we are attaching the second electrode to the participants’ index finger (on the same hand).
- This provides an effective ground, consolidates the leads into one area (preventing potential interference or having the electrodes pulled off by strain on the leads), and also standardizes the placement across all the participants.
**Filtering and Signal Frequency BioPac Recommendation**
- The sample rate can be set quite low for long-term ambulatory measurements or experiments that do not require a high level of temporal precision (i.e., 1-5 samples per second). However, lower sample rates cannot ensure that specific events are accurately represented in what is relayed and graphed, and a degree of timing error might occur.
- To avoid this, BioPac recommends the sampling rate be set to a minimum of 2000 samps/sec (2KHz). Higher sample rates are useful for a number of methodological reasons and for improvements in precision.
- For EDA/GSR measurements, it is typical to filter the data at 35Hz. Some recommendations are that a sample rate of 200Hz - 400Hz are a minimum to ensure enough samples for accurate separation of phasic waveforms from tonic signals and a more accurate representation of signal shape.
- A general approach is to always err on the side of caution and probably seek to sample higher than you really need. As a general rule 1000Hz - 2000Hz sample rates are more than sufficient and easily achievable. The decision for the present study is to collect at a sampling rate of 2000Hz.
**Subject Position**
- Ensure that the subject is in a comfortable position, so that body movement can be completely avoided or reduced to the minimal. The subject should be asked not to talk, move, read or make phone calls during the procedure.
- Ensure that the position of the subject is the same if there are multiple sessions. Timing of unavoidable body movement or motion artifacts should be noted and the recording periods with motion artifacts must be removed before analysis.
**Gathering GSR Data**
- Don’t abrade the skin
- After prepping 2 electrodes with a dab of Gel101, attach them to the child’s middle and ring fingers
- Let these rest to let the adhesive set and gel soak in for 5 minutes
- Ask the child to put on the PPGED transmitter like a wrist watch. Assist if needed.
- Attach the transmitter leads to the electrodes (red to middle, black to pointer)
- These should be the only two leads connected to the device
- If there are more leads present, ensure you have the correct transmitter and that the correct lead set is plugged in
- Turn on the transmitter and ensure that both the light on the Biopac receiver module and the transmitter are green (the transmitter should be flashing, whereas the receiver should be solid)
- Make sure there is a clear, unobstructed line of sight between the transmitter and receiver antenna
- Open AcqKnowledge by selecting the template file on the desktop
- If the system is not connected to the hardware, make sure the wifi is turned off and restart AcqKnowledge
- Ensure all devices are connected and lead wires attached properly
- Hit the green “Start” button and click through all of the dialog boxes that you’re prompted with
----------------
## ASA
Loading Users into ASA Protocol
ASA is a 24-hour dietary assessment tool that we use as part of MBB for participants to enter information regarding their diet and generate a nutrition report. Each MBB participant requires their own unique ASA username and password to complete this task.
To load new users into ASA:
Go to the following website: https://asa24.nci.nih.gov/
Log in using username and password found on the BabLab Internal Site.
![<!--- ASA --->](images/research_protocols/asa/asa_1.png)
Click on “Respondent Accounts” to add new accounts to ASA
![<!--- ASA --->](images/research_protocols/asa/asa_2.png)
Click “Start Wizard” to set up additional account usernames and passwords.
![<!--- ASA --->](images/research_protocols/asa/asa_3.png)
Respondent usernames will automatically begin with MBB and an ID number of your choice. Confirm with Lab Manager what the MBB ID numbers should be for the study, and how many participants accounts should be created. Because participants complete ASA for different waves, the MBB ID numbers need to be different for each Wave.
Ex: Wave 1 MBB participant usernames are MBB001-MBB150
Wave 2 MBB participant usernames are MBB2001-MBB2150
*It is possible that Wave 3 participants will be MBB3001-MBB3150 BUT confirm with Lab Manager.
Enter the Starting ID Number, and ensure that the Example contains MBBXXXX with the starting ID number you have entered.
![<!--- ASA --->](images/research_protocols/asa/asa_4.png)
Next, enter the number of respondent accounts you require to add for the study. (Previous studies have added 150 respondent accounts).
![<!--- ASA --->](images/research_protocols/asa/asa_5.png)
Next, the number of recalls will automatically be entered as specified in the original study details. You can leave this unchanged and click next.
![<!--- ASA --->](images/research_protocols/asa/asa_6.png)
Confirm Study details before clicking next.
![<!--- ASA --->](images/research_protocols/asa/asa_7.png)
Next, we will be autogenerating passwords for each respondent account. Select the option to provide a root word for each password and enter “Bablab” as the root word. (This will autogenerate passwords such as “Bablab@194”). Click Finish.
![<!--- ASA --->](images/research_protocols/asa/asa_8.png)
ASA will generate two files with the date of creation: one file with the Usernames and Passwords, and one Template File. Download and save the Username and Password File, which will contain the autogenerated username and password information for each participant.
Save this file on Box, under Bablab > studies > Mind_Brain_Body > ID_Drive as “MBB_asa_usernames_passwords.csv”
This file should remain confidential and not be paired with any identifying information.
![<!--- ASA --->](images/research_protocols/asa/asa_9.png)
These usernames and passwords can now be shared with participants to allow them to complete the ASA task under their own respondent accounts.
----------------
## Gorilla
**Creating Tasks on Gorilla Protocol**
Gorilla is an online experiment builder that allows scientists to collect behavioral data, with an easy-to-use graphical interface. It allows for building of tasks, and questionnaires, to be administered online to participants. The BABLab has commonly used Gorilla for the Halloween task as part of the Mind, Brain, Body Study.
Go to the following website: https://gorilla.sc/
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla1.png)
Log in using username and password found on the BabLab Internal Site.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla2.png)
Once logged in, click on “Projects” to access the labs current studies.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla3.png)
If you are working on a current study or a new wave of a current study, click on that study. If not, create a new project in the upper right-hand corner.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla4.png)
For example, the project page for MBB contains “experiments” which are the completed experiments that participants complete, as well as “tasks & questionnaires” that must be created first, and then inputted into the final experiment.
**IF you are updating a current project:**
**IMPORTANT** It is imperative that you do NOT edit any current tasks, questionnaires, or experiments that are in use within the lab, UNLESS explicitly instructed to do so.
IF you are building a new experiment within a current study such as MBB, you may CLONE the experiment or task, so that it stays separate from previous tasks/experiments. (As seen by the naming conventions below)
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla5.png)
To clone an experiment or task, select the item you’d like to clone, and under settings, select “clone”, and rename it, following the previous naming conventions.
Ex: “MBB_wave_x” or “task_wave_x”
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla6.png)
**IF you are creating a new project:**
Select “Create a New Project” and name it accordingly. Your project will contain all of your tasks, questionnaires, and experiments. Tasks and Questionnaires are components of Experiments.
**To create a Questionnaire**, select the “Create” button, and select the type you’d like to create.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla7.png)
Enter a name for your questionnaire and select OK. If you’d like to clone a previous task, you have the option to do so here as well.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla8.png)
Gorilla offers many different options for types of Questionnaires that can be included in your online experiments, as seen below. In this example, we will select **“Rating Scale/Likert”**
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla9.png)
This is the format you will see when creating a task. On the left, you enter the questions that make up your questionnaire, as well as any variables and titles. On the right side, you will see a live preview of how your question will appear during your experiment.
For example, we have created a likert scale, where a participant can rate their experience from 1 to 5. We included the rating options of 1,2,3,4,5, and labeled 1 as worst, and 5 as best.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla10.png)
To add additional questions within your questionnaire, you can select “Add Widget Here”, and continue your questionnaire.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla11.png)
When you complete your questionnaire, select “Commit Version x” to save it as a completed task. You can go back and edit this questionnaire as necessary and commit the questionnaire to a newer version as well.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla12.png)
To create a task, select the “Create” button, and select the “Task builder task” and name it accordingly.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla13.png)
We first begin with task structure. Depending on the nature of your study, you will most likely begin with an instructions screen. Select the first + symbol, and title your first display “instructions”.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla14.png)
The following steps are specific to your current study, but generally the next displays will be the trials in your experiment, followed by an end/debrief screen. Select the next + symbols, and enter names for each of the displays you require for your study. In this example, we’ve added a display for trials, and a display for the ending of the experiment.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla15.png)
The instruction and end pages can be customized by clicking the “+” icon, where you can choose a template for these displays. In this example, we will select “rich text” as this is the most common display we use for providing instructions and debriefing.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla16.png)
For your trials, you can also choose between a variety of templates, depending on the nature of your research. You can select multiple different screens in your preferred order, such as a fixation screen, followed by a screen with an image, and three buttons.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla17.png)
Now your task will look something like this, and next you can click each display to edit them for your experiment.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla18.png)
To customize the displays you have chosen, click on the display, and select the red box to enter the instructions for your study. You can also customize the button for participant to enter to continue through the study.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla19.png)
Similarly, your trials page can be tailored to your study, depending on your stimuli and answer choices.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla20.png)
The number of trials, and the content within each trial will be determined by a spreadsheet you create. Under the spreadsheet tab, click “Download Spreadsheet” to download a template for which you will enter your trial information. This spreadsheet drives the information that will be shown to the participant.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla21.png)
This will download and xlsx file, where you can specify your display, stimuli, answers, and the randomization of the trials. Here is an example below of an experiment with instructions, three randomized trials, and an ending page.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla22.png)
You can then upload this spreadsheet to Gorilla. **it is necessary that the displays match exactly as they are formatted in your task structure page (ex: entries are case sensitive) Any items in green have been identified and connected to your task structure – if an item is not green, gorilla has not recognized it, and it should be double-checked.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla23.png)
Once your task looks complete, you can preview the task to test its functionality. Once you are happy with its functionality, you may commit the task to complete it.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla24.png)
Once your task and questionnaires are completed, you can then create your experiment. Under your project, create a new experiment and name it accordingly.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla25.png)
Your experiment page will begin with start and finish nodes. You can then select the option “+ Add New Node” to add any task or questionnaire to your study.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla26.png)
Select the type of node(s) you’d like to include in your experiment, and drag the arrow bar to and from each node in the order you’d like your experiment to function.
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla27.png)
For example, you can include your test task in your experiment with connecting arrows, and your experiment will appear as seen below. At this point, you can preview and commit your experiment, and it will be ready to run!
![<!--- Gorilla --->](images/research_protocols/gorilla/gorilla28.png)
For additional instructions on creating a task in Gorilla, see the following instructional video: https://www.youtube.com/watch?v=syw-7XKLCM4
----------------
## Git
To use GitHub and other Git applications, you will need to install Git on your local computer. Git runs in the background and performs tracking and version control for you. This is similar to the way that RStudio runs on top of R.
To install Git:
1. Go [here](https://git-scm.com/downloads)
2. Use the [homebrew](https://brew.sh/) method
- Type this line of code into your terminal and press enter
- When you see the instructions RETURN - press enter again
- You may have to enter your password, if it looks like you aren't entering text, you really are, so just type and press enter
```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```
3. Once that has installed, type this code into your terminal and press enter
```
brew install git
```
4. Git should now be installed
----------------
## GitHub
1. Download [GitHub Desktop](https://desktop.github.com/)
![<!--- GitHub --->](images/research_protocols/github/1.png)
2. Create new repository on GitHub Desktop
![<!--- GitHub --->](images/research_protocols/github/2.png)
- Make sure to select the correct parent folder
![<!--- GitHub --->](images/research_protocols/github/3.png)
3. Initialize the repository
![<!--- GitHub Desktop --->](images/research_protocols/github/4.png)
- If you press command + shift + . you can see the hidden git files
![<!--- GitHub Desktop --->](images/research_protocols/github/5.png)
4. Add your files to the folder
5. Open back to GitHub Desktop
- The blue dot means there are changes in that folder to commit
6. Publish the repository (this sets up the repository online - choose which organization it should go to)
![<!--- GitHub Desktop --->](images/research_protocols/github/6.png)
7. Create the first commit and publish the repository (add a comment and select your organization)
- Committing saves the changes to your local git (your local computer record of changes)(local changes)
![<!--- GitHub Desktop --->](images/research_protocols/github/11.png)
![<!--- GitHub Desktop --->](images/research_protocols/github/7.png)
![<!--- GitHub Desktop --->](images/research_protocols/github/8.png)
8. Push the repository
- Push the changes that git has catalogued to the online GitHub
![<!--- GitHub Desktop --->](images/research_protocols/github/9.png)
![<!--- GitHub Desktop --->](images/research_protocols/github/10.png)
![<!--- GitHub Desktop --->](images/research_protocols/github/12.png)
9. Go to GitHub online and you can see your repository with all of your files and latest commits
- Important to note that the README file will display as the main page for the repository
![<!--- GitHub Desktop --->](images/research_protocols/github/13.png)
![<!--- GitHub Desktop --->](images/research_protocols/github/14.png)
10. If you click on the commits button, you can browse your entire history of commits, explore the file, and download the version from any point in it's history
![<!--- GitHub Desktop --->](images/research_protocols/github/15.png)
![<!--- GitHub Desktop --->](images/research_protocols/github/16.png)
![<!--- GitHub Desktop --->](images/research_protocols/github/17.png)
11. Adding a .gitignore file will allow you to "skip" over certain types of files that you don't want to commit
![<!--- GitHub Desktop --->](images/research_protocols/github/18.png)
12. You can change the name of the root folder on your local directory - just be sure to use the "locate" function in GitHub Desktop to locate it
![<!--- GitHub Desktop --->](images/research_protocols/github/20.png)
13. Make your respository public
![<!--- GitHub Desktop --->](images/research_protocols/github/19.png)
**For a more thorough description of Git, see this [article](https://vuorre.netlify.app/publication/2018/06/01/curating-research-assets-a-tutorial-on-the-git-version-control-system/vuorre-curating-research-assets-2018.pdf).**
**Vuorre, M., & Curley, J. P. (2018). Curating Research Assets: A Tutorial on the Git Version Control System. Advances in Methods and Practices in Psychological Science, 1(2), 219–236. https://doi.org/10.1177/2515245918754826**
### How to use GitHub like a Software Developer
The above method is great if you are working alone in your own repository, but it doesn't work well for collaboration, because only one git repository can be linked to a folder at one time. GitHub has an integrated workflow for this.
**Collaborative Workflow**
1. Open GitHub Desktop
2. Clone repo down or fetch origin if you've already cloned it
3. Create branch
4. Go to folder in your Finder
5. Open .rproj
6. Edit .Rmd of interest
7. Save
8. Build tab --> "Build book" (Build is for Wiki's/Books - Knit is for regular Rmarkdown files)
9. Commit
10. Push/publish branch
11. Pull
12. Merge your branch with main branch
13. Delete branch on github AND on local computer via GitHub desktop
14. Check to make sure changes are correctly reflected on online wiki (usually takes ~4 min to update)
--
1. The first step is to fetch origin (or clone down if this is your first time working in this repository)
If fetching:
![<!--- GitHub --->](images/research_protocols/github/30.png)
If cloning: clone the repository from your organization into a local directory on your computer using GitHub Desktop
- Anywhere is fine as long as it's not a shared folder
- Box, Dropbox, Google Drive folders are fine as long as you are the ONLY user (i.e. your personal Google Drive etc.)
![<!--- GitHub --->](images/research_protocols/github/22.png)
2. The next step in a collaborative repository is to create your own branch on the GitHub Desktop app
- NEVER work directly in the master branch - you might break something
- Name it after yourself (this will be your workspace)
![<!--- GitHub --->](images/research_protocols/github/29.png)
3. Now you can begin coding! (make/add/remove things etc. directly in the folders on your computer)
- Make sure you are working in the correct project on R
4. Build/Knit - when you are done making your desired changes, click build or knit
5. Commit - Commit your changes using GitHub Desktop
- This is kind of like saving the changes to your local computer change tracker
- Make sure you put a comment in the box (no description necessary)
- Make your comment useful to those reviewing it
![<!--- GitHub --->](images/research_protocols/github/25.png)
6. Push - now push your changes to github.com - this is like saving your local changes online (or publish branch)
![<!--- GitHub --->](images/research_protocols/github/26.png)
7. Pull - Now, in order to integrate your changes with the master copy (which hosts the public facing ebsite) you need to submit a pull request.
- This means that you want the owner of the repository to pull in your changes to the master branch
- This will take you to github.com, follow the instructions to create your pull request
- Make as detailed notes as possible on what changes you have created in this round of updates
![<!--- GitHub --->](images/research_protocols/github/27.png)
8. Merge - on github.com, the owner of the repository will then be able to review your pull request, fix any conflicts, and merge the branch into the master. Usually, this is pretty simple if there aren't any conflicts!
![<!--- GitHub --->](images/research_protocols/github/28.png)
9. After the merge - delete your branch on your local computer AND on the remote (github.com)
- You can do both simultaneously by navigating to your GitHub Desktop app and pressing
Mac: COMMAND + SHIFT + D
Windows: WINDOWS + SHIFT + D
- Check the box to delete branch on remote
![<!--- GitHub --->](images/research_protocols/github/31.png)
10. Repeat - now before you start new work, make sure to fetch origin and repeat the process.
----------------
## OSF
1. Create a new project on OSF
![<!--- OSF --->](images/research_protocols/osf/1.png)
2. Title it and choose storage location (US)
![<!--- OSF --->](images/research_protocols/osf/2.png)
3. Navigate to the new project and click Add Ons
![<!--- OSF --->](images/research_protocols/osf/3.png)
4. Enable GitHub
![<!--- OSF --->](images/research_protocols/osf/4.png)
5. Link OSF to your GitHub account
![<!--- OSF --->](images/research_protocols/osf/5.png)
![<!--- OSF --->](images/research_protocols/osf/6.png)
6. Select the repository you want to link
![<!--- OSF --->](images/research_protocols/osf/7.png)
![<!--- OSF --->](images/research_protocols/osf/8.png)
7. Now all of your files are visible in the OSF project
![<!--- OSF --->](images/research_protocols/osf/9.png)
8. Make your OSF project public
![<!--- OSF --->](images/research_protocols/osf/10.png)
----------------
## Wiki Creation
**In order to properly build the wiki you will neet to install [LaTex](https://www.latex-project.org/)**
*This is a huge installation, so leave plenty of time*
**You will also need to have the bookdown package installed in R-Studio**
*To install and load bookdown in R run the following code*
`install.packages('bookdown')`
`library(bookdown)`
1. Create a new project based on the wiki template (duplicate and rename for your project/study)
![<!--- Wiki --->](images/research_protocols/wiki/1.png)
![<!--- Wiki --->](images/research_protocols/wiki/2.png)
2. Rename any instance of "Template" to your project's title (open using RStudio)
- .Rproj itself (YOU MUST OPEN THIS PROJECT FILE TO GET STARTED)
- _bookdown.yml file
- _output.yml file
- index.rmd file
3. Each .Rmd file creates a section
- Index is always the home page
- You can create subsections by creating new .Rmd files -
- These files use markdown syntax
4. Create a new repository using GitHub Desktop for the wiki
5. Move all the files from your draft into the repository folder, commit, and push
- Make sure to always BUILD before you commit and push so that all the necessary files are updated
6. Go into settings in GitHub online
- Scroll down to GitHub pages
- Select master/branch/docs folder to set your GitHub Pages site to the docs folder within your bookdown files
![<!--- Wiki --->](images/research_protocols/wiki/3.png)
![<!--- Wiki --->](images/research_protocols/wiki/4.png)
![<!--- Wiki --->](images/research_protocols/wiki/5.png)
![<!--- Wiki --->](images/research_protocols/wiki/6.png)
7. Put the link on OSF to the wiki
![<!--- Wiki --->](images/research_protocols/wiki/7.png)