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.

merge EDF and XML files in Python

3 posts
Was this reply useful? Learn more...
 
[-]
fmnoori +0 points · 6 months ago

Hi,

I recently got the access of dataset. I am abale to see the Obstructive Sleep Apnea(OSA) at moonlight using EDF and XML files.

My GOAL is to detect OSA vs Normal Sleep so I am trying to open both EDF & XML files in Python. So far I am unable to do so, can I get any guidance/help in this regard? Particularly I am interested in Respiratory or thoracic and abdominal excursions (THOR and ABDO) data.

Thanks in advance!

446 posts
bio
Was this reply useful? Learn more...
 
[-]
mrueschman +0 points · 6 months ago

I've heard of pyEDFlib for working with EDFs in Python - https://pypi.org/project/pyEDFlib/

I presume there are other Python tools to read in XML files, though it will probably be up to you to write code to specifically process/combine/analyze the NSRR files.

Thanks for using the site!

3 posts
Was this reply useful? Learn more...
 
[-]
fmnoori +0 points · 5 months ago

Thanks alot for your response, pyEDFlib is helpful, I am able to extract the data. :)

I have another two Questions 1) I´ve read in Gavidia et al (2023)* that The XML file includes annotations for every 30-second sample of sleep stages. Does that 30 seconds include annotation like Normal sleep vs OSA etc?

2) Do we have apnea-hypopnea index (AHI) score in SHHS

*DETECTION OF OBSTRUCTIVE SLEEP APNEA FROM WEARABLE PHYSIOLOGICAL DEVICES

446 posts
bio
Was this reply useful? Learn more...
 
[-]
mrueschman +0 points · 5 months ago
  1. The 30-second epoch sleep staging is separate from the respiratory event scoring. The ScoredEvent sections of the XML files give timestamps and durations of respiratory events (e.g., apnea, hypopnea).

  2. There are many AHI variables available, e.g., https://sleepdata.org/datasets/shhs/variables?search=ahi

3 posts
Was this reply useful? Learn more...
 
[-]
fmnoori +0 points · 5 months ago

Thanks for the response :) Good day!