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.


Joined May 2014
Joined May 2014


Pls check out the Luna documentation, specifically this and the tutorials

In general, you need to specify the EDF and any associated annotation files together (i.e. even if the analysis only happens to use data from the annotation file). The handful of commands such as "--xml" are special cases.

Assuming you're using the most recent version of Luna:

1) Create a 'sample list', e.g. assuming I've downloaded the data in /data/nsrr/datasets/

luna --build /data/nsrr/datasets/shhs/polysomnography/edfs/ /data/nsrr/datasets/shhs/polysomnography/annotations-events-nsrr/ -ext=-nsrr.xml > s.lst

Each row will be 3 tab-delimited columns (note, lines may wrap in this browser view), which matches up the EDF and the XMLs (i.e. ~5000 rows to this file, the first of which will look like this:)

shhs1-200001 /data/nsrr/datasets/shhs/polysomnography/edfs/shhs1/shhs1-200001.edf /data/nsrr/datasets/shhs/polysomnography/annotations-events-nsrr/shhs1/shhs1-200001-nsrr.xml

2) Run STAGES command using that sample list

luna s.lst 1 5 -t o1 -s STAGE

e.g. here just for first five people, sending output to a folder "o1"

3) Confirm output:

$ ls o1/

shhs1-200001 shhs1-200002 shhs1-200003 shhs1-200004 shhs1-200005

$ head o1/shhs1-200001/STAGE-E.txt


shhs1-200001 1 22.00.00 0 wake 1

shhs1-200001 2 22.00.30 0.5 wake 1

shhs1-200001 3 22.01.00 1 wake 1


4) To run for all people, remove the "1 5" from the command line. To dump to a database instead of text, use "-o" etc, etc. as described in the Luna Docs. The output are tab-delimited, you can easily extract fifth column and concatenate across samples, etc, as desired.