We use cookies and other tools to enhance your experience on our website and to analyze our web traffic.
For more information about these cookies and the data collected, please refer to our Privacy Policy.

PSG Actigraphy Synchronization Followup

8 posts
Was this reply useful? Learn more...
 
[-]
dpanesar +0 points · over 1 year ago

Hi,

I noticed a topic was started quite a while ago about synchronizing the MESA actigraphy and PSG data. (https://sleepdata.org/forum/joint-psg-actigraphy). I was wondering if it would be still possible to get the conversation and links you mentioned in the past posts as I am also in a similar situation.

My email address is

I also had some addition questions:

  1. I read the note posted under the Actigraphy Tab (https://sleepdata.org/datasets/mesa/pages/actigraphy-introduction.md) and wanted some clarification.

From my understanding I would import the XML annotations to the actigraphy CSV based on the epoch allignment in the reference document (i.e. this would be more or less a cut and paste?).

  1. I also found these csv files which look like they have sleep wake data "annotations-rpoints" can these be merged with the respective ACT data. I believe they have a sleep stage variable which I assume is the scored (by technician) sleep wake and stage scoring derived from PSG.

  2. Would there be any other variables or recommendations that would give me sleep/wake or would be directly comparable to the actigraphy data?

Thank you in advance for you assistance.

462 posts
bio
Was this reply useful? Learn more...
 
[-]
mrueschman +0 points · over 1 year ago

Thanks for checking out the site.

The information I emailed to the user in that old forum thread is available in the Actigraphy and polysomnography overlap section on the other documentation link you provided (https://sleepdata.org/datasets/mesa/pages/actigraphy-introduction.md).

Yes, the process could "more or less be a cut and paste". The Profusion XML files contain a SleepStaging section that provides 30-second by 30-second sleep staging output (https://sleepdata.org/datasets/mesa/pages/polysomnography-introduction.md). You could take those staging indicators and paste/insert them into the actigraphy CSV files at the epoch line number indicated in the special overlap dataset. The rpoints files utilized the staging information from the XML files, so you could also merge them with the actigraphy CSVs.

I can't think of any other variables to give sleep/wake to compare with the actigraphy data.

8 posts
Was this reply useful? Learn more...
 
[-]
dpanesar +0 points · over 1 year ago

Perfect! Thankyou for your assistance.

8 posts
Was this reply useful? Learn more...
 
[-]
dpanesar +0 points · over 1 year ago

Hi,

I had a follow up clarification question about the PSG data. As I understand it is 1 night only (from what I can see the first night of actigraphy).

For the XML file it only mentions the epoch length, the sleep stage measurements seem to start quite a bit into the file. Is it safe to assume that the the first sleep stage measurement in the XML corresponds to the start time for the PSG mentioned in the overlap document (i.e., the first overlap time indicated in the reference document)?

Thank-you for you help.

462 posts
bio
Was this reply useful? Learn more...
 
[-]
mrueschman +0 points · over 1 year ago

Yes, the PSG was only one night and it was intended to overlap with the first night of actigraphy.

The XML sleep staging section begins at the PSG recording start time (starttime_psg). Most PSG files will have varying periods of wake before the first epoch of scored sleep (N1/N2/N3/REM). As part of this "overlapping" process you should include all epochs from the XML file (though you may only ultimately concern yourself with staged NREM/REM sleep).

8 posts
Was this reply useful? Learn more...
 
[-]
dpanesar +0 points · over 1 year ago

Perfect thankyou so much.

I had a few more clarification, in the XML files there are several blank cells before I start to see values in the sleep stage. Would the start time be at the top (i.e., first blank cell) or when the first number in the sleep stage column appears? (i.e., would we skip the blank cells? Are they indicitive of a sleep stage e.g., active?)

The total time for the PSG recording would be until the values are present in the sleep staging column? Would there be a reference time length for each PSG recording?

Thanks again for all your help.

462 posts
bio
Was this reply useful? Learn more...
 
[-]
mrueschman +0 points · over 1 year ago

Can you clarify what you mean by "several blank cells" and provide example filenames for me to look at? I opened mesa-sleep-0085-profusion.xml and see this at the beginning of the <SleepStages> section, which corresponds to the first 3 epochs of the recording being scored as wake.

<SleepStages><SleepStage>0</SleepStage><SleepStage>0</SleepStage><SleepStage>0</SleepStage>

Note the reference for the Profusion XML stage coding can be found here: https://github.com/nsrr/edf-editor-translator/wiki/Compumedics-Annotation-Format

Sleep stages: hypnogram is broken into periods of 30 seconds (epoch). 0 is wake stage, 1-4: sleep stage 1-4 and 5 is REM sleep. 9 is Active.

The total recording time (TRT) for PSG is available: https://sleepdata.org/datasets/mesa/variables/stdurm5 (column is present in 'mesa-sleep-dataset' CSV file here: https://sleepdata.org/datasets/mesa/files/datasets)

8 posts
Was this reply useful? Learn more...
 
[-]
dpanesar +0 points · over 1 year ago

Thankyou again for you detailed reply.

For the blank cells. When we open the profusion xml file (e.g., 0001) in excel the format gives us a series of blank cells before we get values for sleep stage. We think it may just be the way excel converts the xml but we want to confirm incase the blank cells are important.

Thanks.

462 posts
bio
Was this reply useful? Learn more...
 
[-]
mrueschman +0 points · over 1 year ago

(Moving things down so they don't get so nested)

Yes, I agree the blank cells are likely some quirk then of opening the XML in Excel. You can open the XML in a text editor and the beginning of the SleepStages element should look like what I posted above.

8 posts
Was this reply useful? Learn more...
 
[-]
dpanesar +0 points · over 1 year ago

Perfect, thankyou again.