I’m working on a project where participants were alternating between resting state and answering probes about the contents of their thoughts during the resting state—we have recording from EEG and ECG channels. I’d like to analyze the heartbeat evoked potential (HEP) during the period before onset of a thought probe to test whether HEPs are different for different thought patterns.
I’m new to MNE and EEG analysis generally, and I wonder whether there’s an easy way to go about this analysis with the existing MNE API. This analysis would seem to require having nested epochs—I would first epoch ~5.5 s prior to thought probe onset, and then, within that epoch, create epochs extending some number of seconds after each heartbeat. The ideal result would be having epochs around each heartbeat be tagged according to their associated thought probe, as I’ll need to average over hearbeat epochs within each pre-thought-probe period, then analyze my probe data to determine how to average across probes in the experiment (ie, based on the self-reported thought patterns).
I was able to use methods from MNE to create epochs for probe events and heartbeat events separately, but I’m stumped about how to combine. I’ve approached the problem in two ways:
- I took each probe epoch, convert back to a mne.Raw, then run mne.preprocessing.create_ecg_epochs (as this function will only accept an mne.Raw object). The problem with this approach is that the zero-locked probe-relative timing in the probe epoched data seems to be lost when converting the epoch to raw (the first sample starts at time 0).
- Since I can compute events separately for probe onsets and heartbeats, I could loop through the heartbeat onsets and assess whether they fall within the pre-probe window, then update the event label, then try to construct epochs based on these new labels. I haven’t tried to implement this approach yet, but my sense is it would require nested loops and be inefficient, and I figured I’d reach out here before trying this approach.
Any insight you could offer about doing such an HEP analysis in MNE would be greatly appreciated!