TicTimer software for measuring tic suppression

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.

This article is included in the collection. Tics

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][2][3][4][5] . 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/or noncontingent reinforcement (NCR).
In the course of conducting a longitudinal study of children with Provisional Tic Disorder 6 , we found that tic suppression is seen within the first few months after a child's first tic 7 . 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. Note that "automated tic counting" here refers to minimizing an expert observer's record-keeping (simply pushing a button for each tic observed), not to machine detection of the tics. This software, and optional connection to hardware, were intended for use in the research session with the TSP as described above; later in Conclusions we describe possible adaptations for other settings. We present the software here to facilitate its use by others.

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 (also available on GitHub) 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 shows the final assembly.
Parts list: • 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

Amendments from Version 1
This revision addresses questions raised by the reviewers. The introduction is expanded to clarify that the software does not detect the tics; rather, it facilitates an observer's recording their timing. The introduction and conclusion also clarify that the intended use of the software is primarily for research in the office setting. Future adaptations of the software for clinical utility are possible, and discussed in conclusions. Finally, we now provide in the implementation section a direct link to the GitHub page for the python script that can be used to parse the log files.

REVISED
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. The choice of 10 seconds as the duration of rewarded tic-free intervals was made to replicate Woods and Himle's (2004) original methods, and because we have used that duration in all of our own studies.

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. 7 , 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 8 . The most obvious application to the clinical setting may be in documenting suppression ability in the office, before and after treatment. However, we have created loosely related web-based software designed for a potential clinical application 10 . Another potential future modification would be to add machine detection of tics, e.g. by online video analysis or accelerometry; such an improvement would be quite welcome but is difficult to reduce to practice.

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.

Competing interests
No competing interests were disclosed.

Grant information
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.

Acknowledgments
We gratefully acknowledge the initial tic suppression studies by Woods and Himle.

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.
Click here to access the data. This is a simple but functional piece of software for logging tics, and automating a reward schedule based on them.

Open Peer Review
The hardware/software combination will be useful for researchers and possibly for behavioural analysis/clinical training -though this publication does not aim to describe clinical outcomes.
The software does not appear to actually detect tics automatically -there is no interface to accelometry for example. Rather an examiner seems to have to observe the examinee constantly, and enter manually when a tic occurs, presumably by pressing a button. However, this requirement is unfortunately not specified directly in the text. It also means there is a subjective component: how does the examiner judge what is a tic and what is, for example, a voluntary action: these are tricky questions which face researchers in this area.
The data is logged in a simple way that is clearly explained, and suitable for postprocessing using standard packages -but the user seems to have to write their own scripts to produce synthetic reports. standard packages -but the user seems to have to write their own scripts to produce synthetic reports.
The package logs occurrence of a 10 s period in which no tic is reported -but this time window appears arbitrary: it would be useful (a) to justify it, and (b) to allow the user to change it, either at run time, or in subsequent sensitivity analysis of the log files: how long a period of tic-free behaviour should count as a success event?
The strength of the tool seems to be the automation of reward scheduling for studies of voluntary tic suppression in children.

Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Yes
Are the conclusions about the tool and its performance adequately supported by the findings presented in the article? Partly No competing interests were disclosed. The software doesn't detect tics automatically; the accuracy of any rater-identified tics depend on the skill of the rater. These points are all valid. The scope of the software is limited, primarily being useful to track and time the tics as noted by an expert observer, who indeed logs each tic by pressing a keyboard button or clicking a mouse. We have updated the text to clarify these details.
"The user seems to have to write their own scripts to produce synthetic reports." We do 1.

5.
"The user seems to have to write their own scripts to produce synthetic reports." We do supply (via GitHub) the python script TT_Data.py for summarizing each primary data file, but apparently we failed to provide a direct link to this script. We have corrected this omission in this revision.
The choice of 10 seconds as the tic-free interval of interest is arbitrary. We chose the 10s period because of its prior use in the studies cited, but you're correct that this choice is otherwise arbitrary. We have explained this choice in the revised ms. The suggestions in (b) are interesting, but to some extent outside of our plan for the software. We have modified the source code, however, to make a change in tic-free intervals easier to make at compile time.
"The strength of the tool seems to be the automation of reward scheduling for studies of voluntary tic suppression in children." Yes, we also see that as one of its key advantages. We expect TicTimer could be applied equally well to studies of adults. none 1.

Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others? Yes
Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Partly Are the conclusions about the tool and its performance adequately supported by the findings presented in the article? Yes No competing interests were disclosed. We thank Prof. Cath for her thoughtful comments. We failed to clarify adequately the primary purpose of this software tool. It was designed rather narrowly for use in a standardized Tic Suppression Protocol in a clinical research office setting. This fact affects many of the specific comments below. We have revised the Introduction to address this point.
Here are responses to each item in your review: comparing to other tic counting methods: This tool can be used (and we have used it) to facilitate counting tics on video recordings. The main drawback with using the software to count and time tics on video recordings is that one cannot give "live" feedback in the Differential Reinforcement of Other (zero-rate ticcing) condition. limitations: We have rewritten the introduction to clarify the limited intended purpose, and clarify in Discussion that use outside of the research office will require adaptations. graphs showing changes over time, for clinical use: This is a useful feature that may be added in the future. In the meantime, we point out that the information in Supplementary File 9 can be imported easily into a spreadsheet program for creating such graphs.
can't be used in more naturalistic settings: Correct. See our initial comment, above. We have in fact adapted some features of TicTimer for a web-based tool intended for more naturalistic (home-based) tic suppression timing. [1] comparison of TicTimer to conventional tic counting: We do not feel this is necessary, because (as we apparently failed to explain adequately) in each case an expert human is watching the person with tics. TicTimer adds the (more or less) precise timing of each tic to [1] 5.
watching the person with tics. TicTimer adds the (more or less) precise timing of each tic to the record. [ The benefits of publishing with F1000Research: Your article is published within days, with no editorial bias You can publish traditional articles, null/negative results, case reports, data notes and more The peer review process is transparent and collaborative Your article is indexed in PubMed after passing peer review Dedicated customer support at every stage For pre-submission enquiries, contact research@f1000.com