Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature demo: web application for YASA #186

Open
raphaelvallat opened this issue Dec 20, 2024 Discussed in #185 · 4 comments
Open

Feature demo: web application for YASA #186

raphaelvallat opened this issue Dec 20, 2024 Discussed in #185 · 4 comments

Comments

@raphaelvallat
Copy link
Owner

Discussed in #185

Originally posted by bartromb December 14, 2024
Hi everyone,

I’ve developed a web application that integrates the excellent yasa library into a user-friendly web platform. The application, named YASA Flaskified, is built with Flask, Gunicorn, and Nginx. I currently use it on internal servers as a quality control step after manual scoring. (I am a pulmonologist and somnologist.)

You can find it on my GitHub repository: YASA Flaskified.

I have used only Somnomedics EDF files so far, but the script attempts to automatically identify EEG channels, so I believe it is usable for other EDF files as well. It generates both a hypnogram PDF and a CSV output for further analysis. You can see a showcase on sleepai.be and sleepai.eu, though due to bandwidth constraints, only admin users can register new accounts. I can provide a test login and password upon request.

I want to thank Raphael for the fantastic yasa library—it has been incredibly useful for this project!
Contributions and feedback are more than welcome, and I’m happy to assist with any issues you encounter during deployment on a server.

Looking forward to hearing your thoughts!

Best regards,
Bart

@raphaelvallat
Copy link
Owner Author

Hi @bartromb,

Thanks so much for your work on this. Following up on our email conversation, I tried this on an example EDF file (not from a Somnomedics device), and it did work well in outputting the YASA-scored hypnogram and plot (see attached).

yasa_example_night_young.edf_hypnogram.pdf

yasa_example_night_young.edf.csv

I do have a few questions for you:

  • Intended use of this web app: can you confirm that the sleepai.be and sleepai.eu links are only provided for demo — the real intended use is that people would set up their own domain-based or local server, correct?

  • It would be great to have the ability to choose the EEG, EOG and EMG channels that are used for sleep scoring, as well as specify the metadata (demographics). There could be an automatic detection (as implemented now) and a manual option.

  • Do you see this expanding to other functions in YASA beyond sleep staging? e.g. spindles, slow-waves detection, etc.

Thanks again,
Raphael

@bartromb
Copy link

Hi Raphael,

Thank you for trying out the web app and for sharing your feedback. I’m glad to hear it worked well with your example EDF file and successfully generated the hypnogram and CSV outputs.

To address your questions:

Channel Selection and Metadata Specification
The web app has been updated to include the ability to select specific EEG, EOG, and EMG channels for sleep scoring. This feature complements the existing automatic detection and allows for greater flexibility. While metadata such as patient demographics is not yet directly modifiable through the interface, I can adapt the app further to accommodate this if needed.
I have updated the github repository.

Intended Use
Yes, you are correct that the links to sleepai.be and sleepai.eu are intended as showcases for demonstration purposes. The recommended use is for users to deploy the application locally, either on a real or virtual server, to achieve the best performance. The deploy.sh install the server automatically.

Expanding to Other YASA Functions
Expanding to additional YASA functionalities, such as spindle and slow-wave detection, is a great idea and something I can implement if there’s demand. The modular design of the app makes it feasible to incorporate these features in future updates.

Please let me know if you have any other suggestions or requirements. I’d be happy to adapt the app further to align with your vision for YASA's broader use cases.

Best regards,
Bartromb

@raphaelvallat
Copy link
Owner Author

Thanks @bartromb — great that you added the channel selection!

I think we can add the link to YASA Flaskified in both the README of YASA and the FAQ. If that's okay with you, feel free to submit a PR.

Thanks,
Raphael

@bartromb
Copy link

bartromb commented Dec 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants