Abstract
Woods and Himle developed a standardized tic suppression paradigm (TSP) for the experimental setting, to quantify the effects of intentional tic suppression in Tourette syndrome. The present article describes a Java program that automates record keeping and reward dispensing during the several experimental conditions of the TSP. The software can optionally be connected to a commercial reward token dispenser to further automate reward delivery to the participant. The timing of all tics, 10-second tic-free intervals, and dispensed rewards is recorded in plain text files for later analysis. Expected applications include research on Tourette syndrome and related disorders.
Keywords: tic disorders, Tourette syndrome, reward, reinforcement, psychology, software
Introduction
Woods and Himle developed a tic suppression paradigm (TSP) that could be used in the experimental setting to demonstrate and quantify the effects of intentional tic suppression on tic rate in Tourette syndrome (TS) and other tic disorders 1– 4. In this paradigm, each participant is observed during several experimental conditions, baseline and differential reinforcement of zero-rate ticcing (DRO), and sometimes also verbal instruction to suppress tics and noncontingent reinforcement (NCR).
In the course of conducting a longitudinal study of children with Provisional Tic Disorder 5, we found that tic suppression is seen within the first few months after a child’s first tic 6. We also found that the TSP required substantial investigator effort, and we started writing software with the following goals:
automated tic counting, timing and record-keeping;
automated reward delivery in the DRO condition;
automated reward delivery in the NCR condition.
The overall motivations included not only convenience but also improvement in accuracy. We present the software here to facilitate its use by others.
Methods
Implementation
TicTimer first has the user set up the details for a session, then it runs a clock for the specified session time while writing significant events to a log file. The program writes a line to the log file for each of the following events: session started and ended, tic detected, ten seconds passed without tics, and reward dispensed. Each line includes the time of the event. By parsing through each line in a log file, a python script can extract and summarize the key data.
The hardware allows reward tokens to be dispensed automatically to the study participant. One end of the long cable enters the token dispenser and its two wires attach to the two pins in the Passive Connection Panel that, when shorted, trigger release of a reward token. The Student Trainer Interface box provides power to the token dispenser box and a remote pushbutton for manually triggering token release. The other end of the long cable connects to the two normally open pins on the relay inside of the small plastic box. The USB to TTL serial cable attaches to the input pins on the relay, with the USB end of the cable leaving the box to attach to the computer running TicTimer. Figure 1 anchor the final assembly.
Parts list:
Med Associates token dispenser box, Part #ENV-703
Med Associates SG-595 Student Trainer Interface
Med Associates SG-215D3 Passive Connection Panel
5V Relay module (SainSmart part # 20-018-100)
USB to TTL serial cable (Adafruit part # 954)
Plastic project enclosure box (Velleman part # WCAH2855)
~6m cable with at least one pair of wires free
Operation
System software requirements are Java 8 and RXTX for Java, a library for serial port communication. Binaries for Windows and Linux are provided by fizzed.com. Python 3 was used for the log file reader script.
The program can be run with or without the relay and USB cable. If the hardware is set up and connected to the computer, the program can start in “link mode.” Otherwise, TicTimer can still be run in “button mode,” in which the automatic reward system is replaced by a human who presses the push button attached to the Student Trainer Interface when prompted by a beep and a red flash on the computer screen.
The following procedure applies to both reward modes. First, the user presses “Setup” to choose which type of session is being run and to specify where the session log should be saved. For the NCR condition, the user is also prompted to identify the log file from a previously completed DRO session in the same subject (which provides the timing for the rewards dispensed in the NCR condition). Once setup is completed, the session can be started. During a session, the person observing the subject records tics by clicking the “Tic Detected” button or by pressing “T” or the space bar. If the session type includes rewards (DRO and NCR), they are dispensed appropriately. The session ends when the predetermined time elapses or when the user ends it manually by pressing “End Session” or by closing the window.
If a session is ended manually and restarted, the new session log will be appended to the old one unless a new file was chosen in setup. If a log file contains multiple sessions, only the last session will be used by the NCR mode (which requires a DRO session file in setup) and the data reader script.
To summarize the data from a TicTimer log file, run the accompanying python script (TT_Data.py) with one or more log files as arguments. For each log file given, the script reports the length of the session and the number of tics, 10-second tic-free intervals, and rewards dispensed during the session.
Use cases
We have provided 8 sample session log files as Supplementary Files ( Supplementary files 1– Supplementary file 8) ( subject100_session*_TicTimer_log.txt). These are examples of the files that TicTimer creates during a session. Each line in a log file contains an event and the time at which it occurred. Log files are written in plain English, so they can be read directly if desired. These sample data originated from a participant in the study described by Greene et al. 6, but all identifying data were removed and these files no longer comprise human subjects data.
The file TT_Data_output.txt ( Supplementary file 9) contains output from the python script, summarizing those session files. This output is again in plain text, reporting the session length and the number of each type of event recorded for each log file.
Conclusions
The TicTimer program, now connected to the reward token dispenser, has simplified implementing the TSP and improved the accuracy of reward delivery (given inevitable limitations of human attention and response time in button mode). The software, while designed for our purposes in tic disorder research, may find other uses. The most obvious of these may be for research on traditional habit disorders; for instance, hair pulling and skin picking appear in the “Obsessive-compulsive and related disorders” section of DSM-5 7.
A preprint of this work has been published on Authorea.com 8.
Software availability
The source code is available on GitHub under a BSD 3-clause license.
The current release is available on Zenodo, at DOI 10.5281/zenodo.837884.
Acknowledgments
We gratefully acknowledge the initial tic suppression studies by Woods and Himle.
Funding Statement
Software development and manuscript preparation were funded in part by the U.S. National Institutes of Health (NIH), grant numbers K24 MH087913, R21 NS091635, and R01 MH104030.
The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
[version 1; referees: 1 approved
Supplementary material
The first 8 supplementary files are the output from running 8 TicTimer sessions in one subject.
Supplementary File 1: Baseline Log 1
This file came from the first baseline session.
Supplementary File 2: Verbal Log 1
Output from the first session with only verbal instruction to resist tics.
Supplementary File 3: DRO Log 1
Output from the first DRO session.
Supplementary File 4: NCR Log 1
Output from the first NCR session.
Supplementary File 5: Verbal Log 2
Output from the second session with only verbal instruction to resist tics.
Supplementary File 6: Baseline Log 2
Output from the second baseline session.
Supplementary File 7: DRO Log 2
Output from the second DRO session.
Supplementary File 8: NCR Log 2
Output from the second NCR session.
Supplementary File 9: Data Reader Script Output
Output from the command "python TT_Data.py *_log.txt" in the directory containing the 8 sample log files. It summarizes the data contained in those files.
References
- 1. Woods DW, Himle MB: Creating tic suppression: comparing the effects of verbal instruction to differential reinforcement. J Appl Behav Anal. 2004;37(3):417–20. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2. Himle MB, Woods DW: An experimental evaluation of tic suppression and the tic rebound effect. Behav Res Ther. 2005;43(11):1443–51. 10.1016/j.brat.2004.11.002 [DOI] [PubMed] [Google Scholar]
- 3. Himle MB, Woods DW, Bunaciu L: Evaluating the role of contingency in differentially reinforced tic suppression. J Appl Behav Anal. 2008;41(2):285–9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4. Lyon GJ, Samar SM, Conelea C, et al. : Testing tic suppression: comparing the effects of dexmethylphenidate to no medication in children and adolescents with attention-deficit/hyperactivity disorder and Tourette’s disorder. J Child Adolesc Psychopharmacol. 2010;20(4):283–9. 10.1089/cap.2010.0032 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5. Black KJ, Black ER, Greene DJ, et al. : Provisional Tic Disorder: What to tell parents when their child first starts ticcing [version 1; referees: 3 approved]. F1000Res. 2016;5:696. 10.12688/f1000research.8428.1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6. Greene DJ, Koller JM, Robichaux-Viehoever A, et al. : Reward enhances tic suppression in children within months of tic disorder onset. Dev Cogn Neurosci. 2015;11:65–74. 10.1016/j.dcn.2014.08.005 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7. American Psychiatric Association: Obsessive-Compulsive and Related Disorders. In: Diagnostic and Statistical Manual of Mental Disorders Fifth Edition. Arlington, VA: American Psychiatric Association;2013. 10.1176/appi.books.9780890425596.dsm06 [DOI] [Google Scholar]
- 8. Black JK, Koller JM, Black KJ: TicTimer software for measuring tic suppression. Authorea,2017. 10.22541/au.150161712.22184874 [DOI] [PMC free article] [PubMed] [Google Scholar]