A, Processing pipeline for handling artifacts in TMS-EEG datasets. When dealing with TMS-EEG datasets, it is important to remove the TMS-related artifacts as early as possible in the processing pipeline (before any filtering preceding downsampling) to avoid introduction of additional “ringing artifacts” due to interaction of filter kernels with existing artifacts. First, the types and extent of artifacts were assessed from TMS-locked averages (B, C). Colored lines indicate artifacts. The data were then (1) segmented to exclude the “initial ringing” artifact (B, C, red line, D, shaded area) before conducting an ICA (2). Time-locked averages of independent components were used to identify independent components capturing TMS-related artifacts (E, F), taking into account topographical representations with extrema close to the stimulation site and adjacent cranial muscles. At this stage, other components related to non-TMS artifacts were identified as well. Then the data were back-projected to channel space (3) without the artifactual components. At this stage, the gap around the TMS pulse was interpolated. If the muscle artifact was not removed completely, this period was interpolated as well. TMS-locked averages were inspected afterward to check that the cleaning was successful (G). (For a tutorial with example scripts on how to deal with TMS-EEG datasets, see http://www.fieldtriptoolbox.org/tutorial/tms-eeg).