Updates, additions and fixes
Current stable version: v1.2.2 (main downloads page)
v1.2.2 (07-Mar-2025)
Various minor additions and a few fixes.
Signals
-
for
GPA, if variable name issexorgender, transformM/Fto1/0values; also, added the ability to specify fixed factors oninputs/make-specscommands (file|group|F1|F2/LVL, e.g. addsF2w/ fixed valuesLVL) -
added
sig=root*wildcard matching -
added
head=NtoMATRIXto show only the first N epochs -
added
modalto MTM (only for MTM, WREL and MTM currently), which givesCHlevel output, for whole signals only (WREL_PK_FREQ,WREL_PK_AMPL, etc)
Annotations
-
for
MAKE-ANNOTS, added several new options:w/w-left/w-rightadded, to add flanking edges;midpoint/start/stopto set zero-duration time-points; andpool, that takes multiple annotations and combines but does not flatten, c.f. union/intersection modes -
added
pos/negandpos-pct/neg-pctoptions toS2A -
added more label options (e.g. to include channel labelss) to
S2A -
added
remaptoWRITE-ANNOTSto specify on-the-fly mappings that do not change the internal annotations (e.g.pN1-->N1) -
fixed occasional issue with AM/PM encoding of times in annotation files
-
fixed a bug in
S2Awhen spanning gaps in an EDF+D
Generic
-
added the
REPORTcommand (withcmd,facandvarsoptions), to explicitly request outputs in text-table mode that might not otherwise be emitted -
added
n/mnumeric slicing of sample lists, i.e. to facilitate batch submission of jobs to a cluster -
added
force-prefixtoPOPS, i.e. to always outputpN1,pN2, etc, whether we have orig staging or not
v1.2.0/1 (03-Jan-2025)
New Luna "walk-through" didactic material
- a comprehensive step-by-step guide to using Luna as applied to real-life datasets; the web pages are available https://zzz.bwh.harvard.edu/luna-walkthrough/ and we'll post the accompanying walk-through data on NSRR within the coming month.
General phenotype association (GPA) command
-
major new
GPAcommand for efficient (permutation-based) linear models via--gpa-prepand--gpacommands -
new binary format created by
--gpa-prep, read by--gpa -
allow kNN missing data imputation with
knn=Koption -
added
desc,statsanddumpto give a description, output statistics (mean, SD, N) or dump raw values from a binary file; addedmake-specsto generate JSON specification files -
added asymptotic significance values (nominal and adjusted, e.g. FDR)
Other new commands
-
METAcommand to calculate/append annotation meta-data -
DERIVEcommand to generate summary statistics from annotation meta-data values -
SCALEto enforce normalized scale (min/max based, withmin-max,clip-minandclip-max) -
ESPANcommand to give per-epoch statistics about annotation coverage -
statistics to quantify ultradian dynamics from epoch-level metrics; typically invoked via
dynamadded toPSD,COH,SPINDLES,SO,PSI,CORREL, -
COMBINEcommand, to make a new channel that is the mean or median of others -
--bindcommand, to combine different EDFs into a single EDF (where the files have the same interval but have different signals, i.e. the complement of--merge -
RUN-POPScommand (wrapper aroundPOPS)
Lunapi
-
new Moonbeam functionality in lunapi, allowing NSRR users to directly pull individual recordings from select cohorts
-
new
empty_inst()function to create an empty EDF within Lunapi (i.e. one can then attach other signals withinsert_signal()to use Luna functionality on data not from EDF -
documentation added for the
scope()viewer
Signal inputs
-
new
preloadspecial variable to load entire file, avoiding random access calls (which can be desirable when working on systems with slowfseek()I/O calls, e.g. network drives, etc. -
extended the
CANONICALformat, to allow templates and+=variable appends -
the special variable
idcan now take a comma-delimited list:id=id1,id2; also,skip=id1,id2will skip these IDs; (note:include/excludeprovide similar functionality but take files of IDs, not the IDs themselves) -
added
retain-caseto keep the case of a channel is it (case-insensitive) matches a primary; e.g. for aliasFp1|EEG-Fp1, if we haveFP1as a query, Luna will now (as of v1.1) change this toFp1(as it matches the primary). If you wish to retain the case of the original, setretain-case=T. -
added
order-signals=Tto make all inputs alphabetically ordered; this can help to align outputs, e.g. fromHEADERS signalsor forCH1xCH2pairwise outputs, i.e. so that one doesn't get a mixture ofAxBin some outputs butBxAin others (as typically the order of channels is determined by position in the EDF rather than alphabetically)
Annotations
-
extended
.annotformat to allow meta-data in additional columns (7 onwards); this type of tabular meta-data can be enforced withWRITE-ANNOTSby addingtab-meta(ortab-meta=T); also addedmetaoption to control column 6 output -
support different annotation date formats via
date-format(for annotation files) andedf-date-format(for EDF headers, even though EDF headers are meant to be European DMY format). e.g. can setdate-format=YMDorMDYorDMY(default).YMDindicatesyyyy-mm-ddformat. -
allow
d1,d2format for annotation files, where this indicates the first, second, etc day based on the EDF start date:d1-hh:mm:ss(ord1 hh:mm:ss),d2-hh:mm:ss, etc. -
added
annot-meta-default-num(which acceptsT/Fvalues) to set the default type of annotation meta-data to be numeric rather than string (this is useful for theDERIVEcommand that will typically assume numeric meta-data) -
added
num-atype,txt-atype,bool-atypeandint-atypespecial variables to set particular meta-data fields to a particular type -
allow
;as well as|delimiters for annotation meta-data in.annotfiles; these can be changed withannot-meta-delim1andannot-meta-delim2special variables (and can both be set to the same value if needed) -
added
SEED_ANNOT,SEED_CH,OTHER_ANNOTandOTHER_CHtoOVERLAPoutput (OTHERxSEEDstrata) -
annot=can now accept expanded values
Hypnograms
-
fixed error where
HYPNO's baselinePOSTvariable (post-sleep recording time) was one epoch smaller than it should be -
added
pre_sleepandpost_sleepannotations fromHYPNO annot -
known issue: for long (multi-day) recordings, the timing of some
HYPNOvariables is incorrect (e.g.TX_statistics); arguably, this is not a big issue as values such as sleep-midpoint etc, have no intrinsic meaning if the recording contains multiple sleep periods; _in future, we'll aim to add a flag / not calculate various hypnogram metrics when there appears to be multiple sleep periods (either based on recording time or other heuristics) - although this could get messy)
lunapi (Python interface)
-
finalized
scope()interactive viewer -
added
moonbeam()tolunapi
Misc additions, changes and fixes
-
added
default-starttime,no-default-starttimeand date equivalents -
new
log=file.txtspecial option to mirror log output to a file; also--logto output the command to std::cerr (which can be useful when tracking outputs) -
added
key+=value key+=value2-->key=value1,value2to allow repeated options, building up a comma-delimited listluna s.lst -s PSD sig+=C3 sig+=C4 sig+=F3,F4 luna s.lst -s PSD sig=C3,C4,F3,F4 -
added
force-digital-minmax(andforce-digital-min/force-digital-max) special options -
SOAPnow iterates over channels and stratifies all outputs byCH -
revised
SOvariable naming scheme (e.g.SO_P2PnowSO_AMP_P2P, etc) -
added
uppercase-keystoCACHE record -
added
scaleadded toPSC(for scaled-PCA implementation) -
PSCnow takescmd-var=SPINDLES,DENSetc to select only specific variables -
added
qoption toS2Ae.g.q=10 -
fixed issue in decimal-place resolution of time tracks in EDF+D (i.e. now using same number of decimal places as
.annotoutput, 1e-4s by default -
fixed bug in qall-by-allq
CORRELwhere off-diagonal elements had flipped signs (i.e. treated as directed measures of connectivity) -
added decimal-place outputs to HMS times in
SEGMENTS -
known issue:
dynamdoes not work with-toutput (i.e. cannot register the col names for arbitrary commands yet...) -
added
so-fast-transandso-slow-trans(w/ arg in Hz as trans freq) to return only FS or SS (SO fast/slow swtichers) -
added
winsoroption toSPINDLES; also changed the implementation of Q-score filtering; newq-frq={freq},{cycles},{freq2},{cycles2}option; alsoq-verboseandq-verbose-allandq-max -
added outputs from
show-coefforSPINDLES
v1.00 (10-Jul-2024)
This major release contains a number of new analysis features as well as support for a Python interface to Luna, lunapi. It also contains a number fixes and smaller additions.
New interfaces
- a new lunapi Python package provides bindings to the Luna library; it also contains a number of convenience functions and an interactive viewer for signal and annotation data
New commands
-
new EDF-MINUS command to collapse gapped EDF+D whilst aligning records, stage annotations and epochs
-
new PCOUPL command for generic phase-event coupling
-
new SVD commad for time-series PCA via SVD
Annotations
-
the
ANNOTScommand now takesannotclasses to output only a subset (w/ wildcard character*allowed to subset, in formroot*only) -
date formats: two new options
read-mdy-annot-datesandread-mdy-edf-datesallow for non-European (month-day-year) format dates, instead of the default day-month-year (adopted as European Data Format files specify this convention). The first form relates to annotation files (`.annot); the second form relates to values in the EDF header (i.e. if they have been incorrectly specified). -
OVERLAPnow has option to output a shuffled set of annotations (given the full shuffling scheme - shuffle, event-based, constrained, background-filtered, etc): e.g.add-shuffled-annots=A1,A2addss_A1,s_A2as new, shuffled versions ofA1andA2; the default tags_can also be altered withadd-shuffled-annots-tag=s_
Epoch definitions
-
EPOCH now takes
fixedandtrunc; output givesFIXED_DURfromEPOCH -
generic epochs can now be shifted left/right (backwards/forwards) using
shift(-ve/+ve values) -
new
EPOCHoutputs:TOT_DUR,TOT_PCT,TOT_REC,TOT_SPANNEDandTOT_UNSPANNED -
added
SEGMENTSlargest annotation (largest1), (largest2) etc; the 1,2,3,... index is in the instance ID of the annotation (class =largest); also, adding e.g.requires-min=120enforces that largest segments must be at least 2 hours -- 1,2,3 is in INST ID
Spectral analysis
-
fixed
MTMoptions; addedspeckurtfor fbins (MTM) -
PSDandMTMnow haveband(=T/F) to drop band output altogether -
allow
skip-bands(e.g.skip-bands=SIGMA,GAMMA,TOTAL) forPSDto omit certain bands from the output -
to support ISO analyses: PSD now has an
addoption to emit (currently 1Hz) values (requriesEPOCH dur=4 inc=1andPSD segment-size=4). This creates a new 1 Hz time-series in the EDF. -
COHnow allows generic epochs - as long as they are of fixed size (which requires addingfixedalong withannotwhen applying theEPOCHcommand)
Spindle/SO analyses
-
now
so-annots(instead ofannots) is needed to emit slow oscillation annotations (as is called by SPINDLES) -
SPINDLES/SOcoupling issue fixed if a record is above epoch span
Data manipulation
COPYallowsnewto specify a full name (when used with a single channel);pretagadds the tag to the front (better for[xx][1:8]); also,tagno longer adds"_"in between, this must be explicitly specified, e.g.tag=_TAG
Scripting: filters and sequence expansions
-
all
sigoptions allow[inc]and[-exc]matching:impliessig=C3,C4,F3,F4[F]i.e. must match asig=C3,C4Ccharacter. This can be useful when working with larger sets and you want to select a subset ofsig=${s}where${s}may be a very large but structured list -
we now allow for more generic
[][]expansion syntax, i.e.[seq1][seq2]where the terms or sequences are either in the formn:m(wherenandmare integers, withn<=m) or as a commad-delimited list. -
no nesting of terms if allowed, but they can be applied sequentially:
implies${s=[x][a,b,c]} & PSD [${s}][1:5]Note: conditions are evaluated first, based on prior set variables; then line-by-line we evaluate a) swap in variables, wildcards,replace variables, b) expand sequencesxa1,xa2,xa3,xa4,xa5,xb1,xb2,xb3,xb4,xb5,xc1,xc2,xc3,xc4,xc5 -
fixed a bug that occurred when using
[n:n]
Misc. fixes and changes
-
added
output-bothoption toCORREL -
fixed
TOT_DUR_HMSwhen >24 hrs inHEADERS -
WRITEnow resets EDF start date if needed (i.e. when changing start time if collapsing to standard EDF) -
fixed the
ids=<list>option (to swap in alternate IDs on reading a sample list), as it was previosly not working -
POPSignore-obs-stagingoption is now fixed -
SIMULcan zero-out frequencies above or below a certain value (i.e. after interpolation) withzero=lwr,upr
v0.99 (5-Dec-2023)
This release (leaping from v0.28 to v0.99 in a single bound) contains
a large number of incremental fixes and additions, as well as a few
more major features including: 1) automatically generated
hypnogram-based annotations, 2) reworked MASK
interface to simplify masks based on multiple annotations, 3) allowing
generic (variably-sized) epochs based on annotations, 4) a new
framework to implement model-based prediction given PSG-derived
features, in the PREDICT command, also suppored
in Moonlight, 5) epoch-wise analysis using the mutlitaper command
MTM, 6) ability to generate new
annotations conveniently on-the-fly based on pairwise contrasts of
existing ones, 7) the Moonbeam utility, that allows
NSRR data to be pulled directly into Moonlight (for NSRR users) and 8)
a prototype of a new utility for viewing hypnograms
(Hypnoscope).
Hypnograms
-
major: the
HYPNOnow has theannotoption, which adds a series of hypnogram-based annotations, e.g. that can be used in subsequent mask operations, or output, etc. -
HYPNOepoch-level output now hasPRE,SPT, andPOSTflags (0/1) to reflect epochs that are pre-sleep, during the sleep period time, or post-slep; also, the base-level output has two new variables,PREandPOSTto give the recording time pre- and post-sleep (anchored on EDF/recording start/top times, rather than lights off, i.e. the difference betweenSOLandPREis thatSOLis defined relative to lights off. -
if a recording is entirely LightsOut (
Lstage annotation), then Lights Off and Lights On times will be now be correctly shown asNA -
changed
HYPNOFLANKING_MINtoFLANKING, which is now an epoch count -
fixed a minor issue when running with a gapped (EDF+D) recording: added new variables
TGT(total gap time). Gaps count as missing and so do not enter the denominator for metrics (i.e. not inTRTorTIB). For cycle-level output,NREMC_MINSincludes gaps, whereasNREMC_Ndoes not include gaps. -
epoch-level elapsed time outputs are now encoded from the start of that epoch, i.e. 0 to N-1 rather than 1 to N
Prediction models
- major: initial implementation of a new
PREDICTcommand
Moonlight
-
major: added a new Moonbeam feature to directly pull NSRR data into Moonlight for NSRR users
-
major: added a new Models tab to support model-based prediction of metrics, initially an estimate of adult "brain-age" based on the NREM sleep EEG, implementing a model described here
Hypnoscope
- an initial implementation of the Hypnoscope utility for viewing multiple hypnograms and generating hypnogram-based metrics
Signal processing
-
major: the
MTMcommand now allows epochwise analyses (as well as segments within those epochs);epoch-spectra/epoch-outputandsegment-spectra/segment-outputcontrol levels of epochwise and segmentwise outputs; renamedepoch-slopestosegment-slopes -
MTMnow precomputes tapers, which greatly speeds up epochwise analysis -
added bandpower outputs for
MTM(B-stratified) -
added
kurt/kurt3options toPSD, to give epoch-level kurtosis (of power averaged over channels) -
added
speckurt/speckurt3options toMTM, to give segment-level kurtsosis (of power averaged over channels, within epochs if any epochs are specified). Also, added thealternate-speckurtto support an alternate definition of these (only used for Sun et al model) -
added
ratio/ratio1options to bothPSDandMTMto give ratios of bandpowers for prespecifed pairs of bands;ratio1impliesa/(1+b). -
both
PSDandMTMnow allow setting user-defined power bands on the fly, e.g.PSD sigma=12-16. (Previously, this could only be done as a special variable setting, which would be constant across all analyses.) -
added a new
PSD_CVoutput (w/ bothdBandsdspecified) for thePSDcommand; this uses the calculation for coefficients of variation assuming log-normal data, i.e.CV=sqrt(exp(s^2)-1)wheres^2is the natural log-scaled variance. -
new more efficient cross-correlation
XCORRimplementation and new outputs
Artifact and alignment utilities
-
new
EDGERcommand, designed to identify leading/trailing portions of recordings likely to be artifactual -
new
ALIGN-EPOCHScommand -
new
ALIGN-ANNOTScommand -
new
INSERTcommand, with new FFT-based cross-correlation analysis to align signals from different EDFs and insert them, optionally adjusting timings
Filters:
-
FILTERnow accepts separate transition band widths (tw) and ripples (ripple) for the lower and upper edges of a Kaiser-window FIR filter, e.g. bytw=0.5,5andripple=0.01,0.01, corresponding to lower and upper edges respectively; the new filter is generated by convolution of two separate highpass and lowpass filters with those parameters. -
added
butterworthandchebyshevIIR filters to theFILTERcommand -
added
ngausoption toFILTERto implement narrow-band filter via a frequency-domain Gaussian (parameters: frequency domain central mean and FWHM of the Gaussian,ngaus=11,2) -
fftis now the default forFILTER
Masks, epochs, freezes and caches
-
major: variable-sized ("generic") epochs are now supported by
EPOCH, defined based on existing annotations: e.g.EPOCH annot=X. In this context addingelse=Ywill generate a new annotation (Y) which flags not being in an defined epoch (based onX) but respects gaps. Multiple annotations are allowed:annot=A,B,C. Labels are given to epochs in the output now. -
for either conceptual or practical reasons, not all command currently support variable-sized annotations (e.g.
COHorHYPNO) but this is flagged if attempting to run such a command in the presence of variable-sized (generic, annotation-based) epochs. -
major: reworked the primary
MASKcommand to allow multiple annotations to be specified with implied OR / AND logic: e.g.MASK ifnot=N2,N3. The type of logic can be controlled by explicitly specifyingifnot-any=N2,N3orifnot-all=N2,arousalto support OR versus AND logic respectively (the former is the same as the defaultifnot). These are applied to all masks, e.g.mask-if, etc, as described here. -
generic (annotation-based) masks can now use wildcards to complete annotation names:
MASK ifnot=artifact_* -
new
MASKsyntaxifnot=+annotmeans to match the epoch only if it is completely spanned by that annotation. (One cannot use both+and*symbols together, however.) -
added the option
EPOCH tablewhich dumps ouutput (same asverbose) but does not change the epoch structure, i.e. it only gives output. The extra argumentmaskedwill make thetableoutput for both masked and unmasked epochs; theverboseoption also gives more output than previously -
the
CACHEcommand has a newrecordoption, which can be used to pull any arbitrary outputs into the cache (e.g. for use with a subsequentPREDICTcommand) -
the
THAWcommand has a newpreserve-cacheoption so that the cache is not over-written; i.e. it can be allowed to build up between successiveFREEZE/THAWoperations -
the
REcommand has a newpreserve-cacheoption, which does not wipe the cache when restructuring a dataset -
added a new
C2Acache to annotation command
Annotations
-
major: added a new
MAKE-ANNOTScommand, to generate new annotations based on pairwise comparisons of existing ones (union, intersection, if overlapped, if not overlapped, using the syntaxA|B,A*B,A+BandA-Brespectively); this also includes special behaviors if given the optionsepoch,epoch-num,flattenorsplit -
the
WRITE-ANNOTSnow acceptsprefixto match w/ all annots starting with that; useful forprefix=h_ -
added
raw-annot(andraw-annots) to specify subset of annots to load - but unlikeannotthis does not apply sanitization first (if that is the global default) -
added
binsandbins-labeloptions to theS2Acommand: givenbins=min,max,nto makenbins of equal span, to make annotsB1,B2, etc...Bn(orbins-labelinstead ofB)
Interval-based analyses:
-
the
OVERLAPcommand now accepts*wildcards in seed/other/fixed specifications to match annotsseed=sp*,so*i.e. matchessp_15,sp_11etc -
the
OVERLAPcommand now hascontrasts,event-perm,offsetsoptions. Now one should addseed-seed=Tto get seed-seed pairs; adding seed-seed pileup is now turned off by default, unlesspileup=Tis added -
the
OVERLAPcommand now acceptsrp=<annot>|<tag>,...to getrp_tag=xxxfrom meta data for that annotation, in which case it will set a 0-duration time-point at that position
Spindle/slow oscillation detection:
-
added
COUPL_ALLstatistics toSPINDLES, which performs spindle/SO analysis under both default (only using spindles that overlap a detected SO) andall-spindles(calculatingCOUPL_ANGLEandCOUPL_MAGmetrics based on all spindles); if theall-spindlesoption is explicitly set, then these two sets are identical, and only a single set is reported). -
Slow oscillation output (
SO/SPINDLEScommands) is changed: nowSO_SLOPEis output by default instead ofSLOPE_NEG2. The other slopes are only generated w/ theverboseoption. Additionally, it now doesn't output_negand_poshalfwaves as annotations, but instead addsrp_midrp_posandrp_negas relative positions within the interval (scored 0..1); theOVERLAPcommand is now able to use theserp(relative position) terms. Finally,SOannotations do not outputdurnow, onlyfrq. -
SPINDLESannotations (from theannotargument) now addrp_mid(as a 0-1 proportion) to indicate the mid/peak of the spindle, i.e. rather than in the old time-point based formmid=tp:123456789 -
the
SPINDLEScommand has a newcache-peaks-secoption -
SPINDLESnow gives a message iffcis out-of-range givenq. In this case, added the optionnoq(i.e. equivalent to settingq=-999) -
fixed the
SPINDLESoptionstratify-by-phaseto avoid double-counting
Minor additions and fixes
-
the
SEGMENTScommand now outputs the largest segment size (for an EDF+D w/ gaps); also, optionlargest=L1adds an annotation spannong the largest segment calledL1; in the case of ties, only the last will be added -
fixed bug in
EDF- when forcing a standard EDF structure, this now updates the internal timetrack correctly, so that any subsequent call totimeline.wholetrace()uses the correct time-points -
added
minandmaxoptions toMINMAX, to clip EDF physical min/max values; can specify both or either; other wiseMINMAXsets allsigchannels to the be same PMIN/PMAX and DMIN/DMAX. Ifforceis specified withminormaxthen that value is always set; otherwise, the physical min/max values are only changed if they are smaller, i.e. clipping, not expanding the min/max range -
channel locations are now populated by default if not otherwise specified (for a standard 64-channel 10/10 EEG only)
-
automatically sets any EDF header reserved field characters 5-44 to null (space) (also the first 5 chars if not
EDF+CorEDF+D) -
new
srand=XXXXspecial argument to set the RNG seed -
added
REC_DUR_SECandREC_DUR_HMStoHEADERSwhich used to beTOT_*. Now,TOT_DUR_SECandTOT_DUR_HMSreflect the full duration, including any gaps (i.e. if an EDF+D) -
the
RESAMPLEcommand has a newdownsampleargument: only channels with rates above thesrvalue will be altered -
Luna can now correctly take
.edfzand.edf.gzfiles on the command line (versus from sample list) -
fixed issue with the
CPTcommand when multiple classes of DV are specified; also added aall-dvars(ordv=*) option to select all named DVs from the DV files; also, can cluster based on time (T) as well asF,CH,CH1andCH2; because of this,STAToutput variable is now the t-statistic, andTmeans any time-level stratifier -
the
STATScommand has renamedMEDIAN.XtoX_MD; also addedX_MN -
STATShas akurt3to specify unadjusted kurtosis values (i.e. veresus excess values), such that X~N(0,1) has an expected value of 3.0, not 0; -
PEAKSnow output annotatons (annot) as well as cache; can includewto add window (sec) around each point
Interal changes/library upgrades
-
upgraded to Eigen library to 3.4.0
-
upgraded to sqlite library v3.41.2
-
reorganized some of the codebase, in particular, moving most TF-analyses into single
spectral/folder
v0.28 (10-Apr-2023)
Moonlight
-
new interactive Moonlight viewer (public demostration host: http://remnrem.net)
-
extended tutorial that uses Moonlight to recapitulate the prior Luna/lunaR tutorials
Vignettes
-
new vignette on merging EDFs and working with EDF+D files
-
new vignette on how Luna expects time/date information in annotation files
Major new functionality
-
new
FREEZEandTHAWcommands to make and revert to prior snapshots of the in-memory dataset -
new
TABULATEoption to summarize channels with discrete sets of values, e.g. body position -
new
MOVING-AVERAGEcommand -
major improvements to
--mergewhich can now handle gaps between consecutive files and will generate EDF+Ds -
new
addoption forMTMto generate a new signal (with the same sample rate as the original); also,MTMnow outputs estimates of the spectral slope as well asPSDandIRASA. -
new
SET-TIMESTAMPSutility command -
new
annotoption for theSEGMENTScommand; as demo'ed in this vignette, it is useful when making standard EDF from EDF+D files -
for
WRITE-ANNOTSwe now make as defaultno-specials=T; i.e. add optionsspecialsinstead ofno-specials; and likewiseheadersfromno-headers. We've also addeddhmsandminimaloptions. -
added
impulseoption to [SIGGEN]( (T,A,D) andaddnot clear; makes new channle, or updates/replaces an existing one. -
new
REMAPcommand to perform annotation remapping on _already-loaded_x data; -
new
EXEoptionrepresentativeto extract K examplar epochs via a clustering heuristic based on permutation distribution clustering
Minor changes/additions
-
added
starttimeandstartdatecommand-line special variables to force EDF header changes (prior to attaching annotations) -
new
anon=Tspecial variable to set EDF headers to null values upon loading; this is similar to runnongANON, althoughANONallows a few extra options); as withstarttimeandstartdate, this setting is enacted before attaching annotations (i.e. and so can influence how annotations are aligned) -
added support for dates in annotation files, e.g. dd-mm-yyy-hh:mm:ss, as illustrated in this vignette
-
added the
pctoption toSTATSto avoid calculation of percentilespct=F. Alsomin=Twill only give the mean. -
SOAPnow respects lights on (L) epochs, i.e. unlike for missing (?) epochs, it completely excludes them -
new
offsetoption forWRITE-ANNOT -
Luna now gives a warning message to the console if looking at an etnire signal (e.g. from
FILTER) but some epochs are masked - i.e. as this means that those epochs will be included in that step (if not runningREbeforehand to remove them) -
added
annotfeature toDUMP-MASKto create annotation based on the mask (as well asoutput=Fandannot-unmasked=T) -
added
fileoption toRENAME- takes a file of tab-delimited old/new channel name pairs instead ofsig/newfrom the command line -
added the
xbgoption to specify intervals to excise certain intervals from the background inOVERLAP -
offsetoption ofEPOCHcan now take hh:mm and hh:mm:ss arguments, as well as elasped seconds -
now gives an error if specified filename for a new EDF file (e.g. from
WRITE) is the same as the input EDF. (This was allowed previously, but could cause problems and lead to corrupt outputs...) -
anchorargument forSPINDLESto specify between -1 and +1 for spindle start stop (0 = midpoint) for SO-coupling analysis. If not specified, default is the point of maximal CWT (i.e. typically, but not necessarily near the middle);offset=0.1(-N ro +N seconds, default = 0) adds offset to above anchor for SO-coupling, i.e. can be combined withcouple, i.e. look at SO phase and overlap 0.2 seconds before the start of a spindle; Gives newANCHORstrata in output for coupling analyses. Can specify multiple anchor/offsets. -
EEG microstates
--label-mapscommand now outputsand (will) add a message if match is not highest correl SPCID KT FLIP K1 MAPPED SPC . D 0 1 1 0.994548052142096 . C 0 2 1 0.972204262924326 . A 0 3 1 0.988131018834142 . B 0 4 1 0.996294406621555OPTIMAL == 0 -
also, it now allows to matching on the minimum sum
(1-r)^pwherep = 2by default; this is now also the default stat forcompare-maps(perm.) tests; addedverboseoption for info to the log -
for EEG microstate analysis, added a
groupedoption to allow A/a --> 'A' two-group mappings (i.e. case-invariant analysis, if K = 4 + 4 = 8
Misc. fixes
-
fixed issue with
ECG-SUPPRESSwhen high sample rate used (insufficient smoothing -> no R-peaks detected) -
HYPNOnow outputs proper epoch time, i.e. if used EPOCH align so that epochs are not starting from 0; (as is, it assumes epoch 1 starts at 0 sec); also note thatMINSis the elapsed time since epoch #1, not necessarily EDF start under these conditions -
annotation class/instance delimiter has been changed to have a default value of
:(rather than/as before) -
NSRR automatic-remapping is now turned off by default: enable with
nsrr-remap=T; addedannot-remapto separately control remapping of stage annotations -
automatic sanitization of annotation labels is now on by default
-
changed behavior of
keep-spacesandsanitizeto be similar for both channel and annotation labels; also, labels are now always trimmed on both whitespace and sanitized insert character (underscore by default) -
stopped the
HEADERScommand from writing out EDF Annotation channels -
changed lunaR to attach EDF+ annotations on attaching an EDF+
v0.27 (27-Sep-2022)
In addition to multiple smaller fixes and modifications, this release contains a number of major new additions including: 1) revised macro-architecture summary statistics, 2) the SOAP and POPS tools for automated prediction/evaluation/manipulation of sleep stages, 3) new tools for assessing temporal coupling of annotation events, and 4) new signal processing tools including IRASA. Major changes are noted below:
Macro-architecture
-
revised and expanded hypnogram summary metrics, and improved documentation for the
HYPNOcommand including: bout number/duration metrics, better incorporation of lights out markers, a heuristic to handle excessive leading/trailing WASO, revised calculation of total persistent sleep time (nowTST_PER), renamed sleep efficiency/latency (SE,SMEandSOL), added final wake time (FWT). -
added a new
annot-cyclesoption forHYPNO, to add an annotation indicating which NREM cycle an epoch belongs to -
fixed an issue when
HYPNOis called twice on the same EDF -
added
first(mins) andanchor(T0,T1orT2) options, to report hypnogram stats for only the first N minutes (setting the rest toL); also, addedlast(which takesT4(default) orT5orT6as anchor values); also,clockwhich, along withfirstspecifies an arbitrary anchor, based on the clock time; this may come before the EDF start; the variableSHORTwill be flagged if the requested window does not fully overlap the available staging -
added elapsed stage duration times, i.e. seconds after anchor that we see N minutes of N2 sleep, etc. If indiv does not have N mins of N2 sleep, a flag will be set; SS x DUR.. T and SHORT. Note that E_* epoch level output gives the elapsed duration at the START at that epoch; in contrast, this is indexed at the end...
-
fixed a bug impacting some of the elapsed time metrics from
HYPNO(E_*etc) if the recording started at or after midnight -
added and documented the new
SOAP,REBASEandPLACEstage evaluation/manipulation commands -
added a new automated staging command:
POPS- POPulation-based Staging that implements a flexible syntax for model specification. Internally, POPS uses Microsoft's popular open-source C/C++ LightGBM library for machine learning -
Internal: have depreciated the older (but still experimental) SUDS stager; previously, we had added some new features, including a canonical correlation based routine.
Data manipulation/handling
-
major new implementation and syntax for the
CANONICALcommand -
new
SET-HEADERScommand to directly edit EDF header values -
new
ENFORCE-SRcommand -
new
fix-edfoption, to allow (i.e. ignore) truncated final records of a trivially corrupted EDF -
new
--mergecommand to aggregate multiple EDFs -
the
--repathutility now accepts.as first character, meaning always append the second argument if (and only if) the sample list has a relative path -
new
SET-VARcommand to set individual-level variables from within a script -
new
RENAMEcommand to rename channels (unlike signal aliases, this command can accept variables) -
HEADERSnow outputsSTOP_TIME -
added
pairwiseoption toREFERENCE -
new
RECTIFYcommand -
new
REVERSEcommand
Micro-architecture/signal processing
-
new
IRASAcommand, to implement Irregular-Resampling Auto-Spectral Analysis -
new prototype/alpha implementation of detrended fluctuation analysis via the
DFAcommand -
added Petrosian fractal dimension and permutation entropy (
pe, withpe-mandpe-toptions) toSIGSTATS -
new prototype
ASYMMcommand to evaluate (stage-specific) (regional) asymmetries (e.g. inter-hemispheric differences) in derived signal metrics -
new
Z-PEAKScommand to make annotations based on peak finding in signals -
added
segment-medianandsegment-sdtoPSD -
added
precomputedfunction toSPINDLES -
added
ch-medianch-epochch-spatial-thresholdch-spatial-weighttoCORREL, which now also prints out disjoint sets of "high corr" channels (CHS) -
added
OTSUand--otsucommands; changed Otsu implementation -
added the
--fttcommand -
added the
same-channeloption forTLOCKto constrain output for whenCH==sCH
Annotations
-
new
OVERLAPcommand to evaluate enrichment of overlap/locality of annotations, in both single- and multi-sample contexts; it can also produce new annotations based on overlap with other annotations -
added the
collapseargument forWRITE-ANNOTSwhich can be used with an EDF+D if an EDF will be output (i.e. changes the times as if collapsing discontinuities) -
currently largely for internal development use, a new
A2Ccommand to convert sample points (ints) in annotation meta-data to a cache store -
EPOCH alignnow works for EDF+D - will align the first epoch at the start of each segment, i.e. still assuming uniform epochs after that (within each segment) -
skip-edf-annotsnow still reads time-track for EDF+D fromEDF Annotationschannels -
added the
numeric-instargument toA2S, to set a signal to a numeric-valued instance ID (i.e. not just 0/1) -
when creating a set of epoch-level sleep stages, Luna will automatically detect if the stage annotation are 0-duration change-points (as is often the case in EDF+ stage annotations) and will extend those new signals up until the next stage annotaiton encountered (or the end of the recording)
-
alternatively, unless
assume-stage-duration=F, if sleep stages have 0 duration (e.g. markers for change) assume they have the default epoch duration length (currently only for EDF+ embedded annotations) -
added the
add-ellipsisoption (for zero-duration annotations) -- this impactsWRITE-ANNOTS.annotformat files only -
for EDF+ annotations, added
edf-annot-classspecial variable, to make these annots classes (instead ofedf_annot_tinstanes) e.g.edf-annot-class=N1,N2,N3,R,W
Microstate analysis
-
the EEG microstates command
MShas a newwargument for--kmeranalysis, which performs local shuffling of microstate sequences (i.e. only within N states) -
the microstate
--kmercommand will now automatically splice out?states, and reduce adjacent states to one e.g.AAA??AABBBCCC->ABC -
a new
--label-mapscommand assign labels for a microstate mapsolfile, given a labelled canonical/templatesolfile (template, file, new) -
new
--cmp-mapscommand to test for differences between maps, either at the group or individual (one versus all others) level, using a permutation procedure -
new
--correl-mapsto print spatial correlations for a map (from a text file)
Misc
-
added
--optionscommand to allow command-line functions to take args either from stdin OR from command line args (following --options) -
changed parameter parsing to include added signals when no
sigspecified (i.e. match all) in the case whensigwas specified as an initial, top-level special variable -
param files have
+groupand-groupflags. // +group include only if matches group, otherwise skip // -group exclude if matches group, otherwise parse -
IFandIFNOT(orENDIF/FI) -
fixed bug in within-record interval offset calculation for EDF+D when gaps present that are fractions of a record duration (i.e. and so record start time-points are no longer multiples of the EDF record size)
v0.26 (29-Nov-2021)
New functionality
-
TRANSsupports arbitrary transformations of signal data -
SIMULsimulates time-series data given a power spectrum -
FFTperforms basic discrete Fourier transform (DFT) via the FFT -
HEADshows one epoch of data (requires same SR for selected channels) -
ZCmean-centers signals, andROBUST-NORMperforms robust normalization (by median & IQR) -
upated the
EMD(empirical mode decomposition) command -
--repathconvenience sample-list function -
prototype
ALTERcommand to perform reference-channel, regression-based artifact removal -
peaksandslopeoptions forPSDandMTM -
REBASE, which adopts theSOAPframework to (probabilistically) re-estimate sleep stages using a different epoch duration (e.g. to translate from 20-second manually scored datasets to 30-second epochs) given a) manual staging in the original epoch duration, and b) one or more signals (i.e. EEG) that are expected to encode sleep stage information well (i.e. have a high kappa from the originalSOAPcommand).
Annotation format modifications/extensions
-
.annotformat now allows key=value meta-data to be specified; also, you can have fewer meta-data terms than expected (but not more), assuming order is as header; all fields still are required to be in the header; now WRITE-ANNOTS always writes meta-data as key=value pairs -
new
+and-options to turn on/off @includes (e.g.alias,remap); note, the variable must be specified before the relevant @include on the command line, i.e. as command-line arguments are processed in left-to-right order -
added a check for pipe (
|) characters in annotation primary names (in aremap) -
annotation times can now include AM/PM modifiers (otherwise assumes 24-hour clock)
-
new
annot-whitelistoption, such that annotations are only accepted if they appear in theremaplist (either as aliases or primaries); -
new
annot-unmappedoption to skip if the annotation is on the whitelist (i.e. complement of behavior withannot-whitelistalone) -
if remapping an annotation to
ABD/DEF|XYZform (i.e. with a/delimiter) then for the classXYZ, it is set toABCand instance ID is set toDEF. If there was an existing instance value (non-null), a text meta-tag of_inst=is added. The delimiter character can be changed from/withclass-inst-delimiter=X(although this only works for annot files currently, and is not generally recommended, i.e. as sanitization of labels respects/for annotations, etc) -
added
combine-annotsoption to merge class and instance identifiers. It accepts a character argument but is_by default ); this sets the annotationclasstoclass_inst(and setsinstto.) -
added the
skip-sl-annotsoption to skip all SL-attached annotations; i.e. if wanting to only load annotations from an alternate, explicitly referenced annot file -
added the
intervaloption to theEVALcommand, to generate new interval-level annotations based on eval expressions
EEG microstates
-
MShas newadd-spc-sigoption to add spatial correlations as new EDF channels (instead of 0/1 binary variable, as peradd-sig) -
MShas newcanonicaloption to specify a file definining canonical microstates -
MSsolutions now always have a header row; you cannot extract based on sol=file,A,B,C,D; also, 'unassigned' states are labeled 1,2,3, etc not A,B,C,... -
new
--cmp-mapscommand to compare (spatial correlation) EEG microstates -
--kmercommand takes optionsreq-len(only analyse first N sequences) andindiv-enrichment
Other fixes, minor modifications and new features
-
added ability to specify an empty EDF (
--nr,--rsand filename equals.) -
added 1st, 2nd, 5th and 10th percentiles to
STATS -
added transition frequency to slow oscillation output (
SPINDLES,SO) -
fixed bug in
flankedmask option (e.g.flanked=W,1) -
made
CANONICALdefinition file format more flexible: 1) it now allows whitespace, not just tab-delimitation; 2) only the first three fields are required now; if not given, the latter fields/columns will be set to.; 3)CANONICALnow respects the order of canonical signals (i.e. rather than processing things alphabetical); this allows multi-stage definitions, e.g. to first mapS1, thenS2, and then apply a rule such asS3 = S1 - S2. -
eval syntax takes
{and}instead of'to delimit strings; it allows nesting, but can also be handy on the command line (i.e. if already using-s ''form) -
added
dropandkeepoptions to thePSCcommand -
added
import=file.txtcommand to [CACHE]( to read from destrat output; can takefactorsandvparam (as well as requiredcache=) -
added
MASK epoch=allto set a MASK but have it all empty ; i.e. to trim records not in an epoch -
(for
.annotonly) addedalignoption : given list of annots (or *) for all, align-annots-on=N1,N2, etc... if not specified, find first instance of this annot, then align with 1 second boundary (oralign-annots-res=Xif given) align /all/ annots with this offset (bound at 0); i.e all records beforehand will be skipped if subsequentMASK/WRITEcommands are applied -
added
pickoption toSIGNALSto pick first of pick=a,b,c that is present, and drop the rest; can map withrenameto rename the pick -
allow sample-lists to have a comma-delim list of annotations, or '.' to denote no data; in this way, we can have a fixed width sample list (i.e. three tab-delimited columns), making it easier to parse (case in point: lunaR
lsl()was broken if fewer than 3 columns were found after first five rows, reflecting how Rread.table()works) -
CANONICALdoes not now need an explicit GROUP to be specified; the file must still have a first col, it is just ignored now; also, newdrop-originalsoption to drop all original (non-CANONICAL) signals after making the new signals; matches case-insentive -
changed
epoch-checkto accept number of.eannotepochs that are different from expected; default is 5; only stops is absolute greater than this; otherwise writes warning to log; i.e. set to 0 for an exact match -
CONTAINScan now skip to the next EDF (rather than alter the return code), if the optionskipis given -
check for whether an ID contains the ID-wildcard character (by default, ^) and reports an error if it does; added the
wildcardoption to specify an alternate character
v0.25.5 (24-May-2021)
Major new functionality
-
Major changes to the epoch-wise artifact detection via
SIGSTATS, which is now implemented via theCHEP-MASKandCHEPcommands, as illustrated in this vignette -
Significant speed improvements for spectral analyses (
PSDand especiallyMTM) and other (e.g.PSC,SUDS,ICA,CPT) commands through code refactoring, tweaking our use of FFTW and the incorporation of the Eigen matrix library -
A beta-version of our new Luna-powered NAP (NSRR Automated Pipeline) cloud-based portal, described here, and available for testing from this URL http://remnrem.net/nap/ populated with public Sleep-EDF dataset.
-
Principal spectral components analysis via the
PSCcommand -
Phase slope index connectivity via the
PSIcommand -
Epoch-wise spherical spline interpolation via the
INTERPOLATEcommand -
Independent components analysis via the
ICAandADJUSTcommands -
EEG microstate analysis via the
MScommand -
Time-series clustering of epochs and/or channels via the
EXEcommand -
Cluster-based non-parametric linear models for association analysis via the
CPTcommand
Other new commands/functionality
-
added
DUPEScommand to find flat signals and digital duplicates -
Added
cache-metricsoptions forPSD,MTM,COH,PSI,SPINDLESandSO(i.e. primarily for use with thePSCcommand) -
SOcaches negative peaks (with thecacheoption) -
New
MEANScommand to give signal means conditional on annotations -
New special variables describing topographical EEG 64-channel groups, e.g.
${anterior},${midline}, etc, -
Find peaks in signals and subsequently produced peak-locked averages across other channels, via the
PEAKScommand and theTLOCKcommand -
Cross-correlation and phase synchrony metrics, via the new
TSYNCcommand -
New
A2SandS2Acommands to convert anntotations to binary EDF signals channels, and vice versa -
Restructure EDFs to align records, annotations and epochs via the
ALIGNcommand -
Added the
EDFcommand to convert EDF+C and EDF+D to standard EDF -
Added the
LINE-DENOISEcommand, using spectrum interpolation to reduce line noise -
Added the
SEDFcommand to produce thumbnail-like summary EDFs (to be used in future NAP iterations) -
Added a simple
SIGGENcommand to generate test signals (currently only sine waves) -
Added the
CONTAINScommand that indicates (via Luna's exit code) whether one or more signals are present in the EDF (i.e. helps guide programmatic driving of Luna pipelines, to be used in future NAP iterations) -
new output/options for the
HYPNOcommand: 1) stage transition counts and probabilities, withPREandPOSTfactors; also with conditional probabilitiesP_PRE_COND_POSTandP_POST_COND_PRE; 2) it now outputs epoch-level stage transition information in full and with different naming scheme:TR_NR2REM, etc andTOT_NR2REM. 3)FLANKING_MINandFLANKING_ALLinstead ofFLANKING_SIM; 4) optionflanking-collapse-nrem(default T), i.e. flank based on any NREM stage (1, 2 or 3) 4) optionreq-pre-post, to only consider stage transitions that haveFLANKING_ALL>=xfor thePOSTstage; defaults to 4 (2 mins). AddedCONFandOTHRoutputs.
Minor modifications/fixes
- the
epochargument ofMASKacceptsendas the final epoch number -
added the
force-edfandEDF+Doptions toWRITEto force writing as EDF (or EDF+D); this command also now properly supports EDF+C, EDF+D files properly (e.g. in how the EDF start time is changed, etc) -
one can now add generic canonical signals via
CANONICAL; it will not change theSRif set to missing (.); the canonical signal definition now includes units -
channel types now include specific reference and independent component types; further, channel type variables are now automatically updated after adding new channels (e.g. added
ICto types; when channels added, now they are typed (i.e. the variable is updated by any commands that add channels, ICA --> ${ic} will be available afterwards to match on IC_1, IC_2, etc). -
we now allow
.eannotto be attached with EDF+C but not EDF+D files -
SPINDLESnow has anannotfunction to generate an internal annotation track (which should be used byWRITE-ANNOTSbut can also be used by, e.g.TLOCK, etc. The oldftrformat is now retired. -
all commands that use epoch-level sleep stages (
SOAP,HYPNO,STAGE, etc) will note if an epoch has multiple spanning stage annotations (i.e. which might happen if stages and epochs are not temporally well-aligned); it now reports tjeCONFvariable describing the overlap -
fixed an issue in selecting ranges when annotations do not align with sample points (fixed for continuous EDFs; need to check whether EDF+D requires additional tweaks)
-
added the
epochoption toHYPNO, which now give less verbose output by default -
added
offsetandaligntoEPOCH -
added
annotoutput for theSOAPcommand -
added a
regionalMASK which masks epochs surrounded by masked epochs -
added
annot,hmsandno-specialsoptions toWRITE-ANNOTS -
added date-time support for annotations (in clocktime_t) and
dhmsflag forWRITE-ANNOTS -
added test for non-integer sample rates
-
now the
HEADERScommand respects thesigoption; also, some changes to variable output names -
fixed the
mkdirsystem call duringWRITEfor the Windows platform -
the
ANONcommand now conforms with EDF+ specifications for the null ID -
added the
rootoption to theANONcommand, to specify "dummy" IDs, in the formroot_NwhereNis 1, 2, 3, etc. As theNcount is always from 1 for a given run of luna, this can be inconvenient if splitting a sample-list and running in parallel: thus theidsoption as above is also given. -
added the
idscommand-line option to supply an ID mapper [ old -> new , tab-delim file ]; this can be used with theANONto set the EDF header IDs -
--buildhas an option to add quotes around file paths if they contain spaces -
the
CLOCScommand now has an optionverbose, to dump pairwise channel distances -
multiple changes to the
.annotfile format: allow durations (+seconds); allow hh:mm:ss elapsed time (0+hh:mm:ss offsets); allow fractional seconds in hh:mm:ss specfication; added channel labels and six-column format (but allowing reduced 3-col and 4-col formats for backwards compatibility); headers now optional; allow space/tab or tab-only delimiters; fixed an off-by-one-time-point glitch with clocktime specification; now fully allow 0-duration annotations [a,a); allow...in the stop field to read until the start of the next; in all imports, times are scalled to 1/1000th second resolution to avoid floating-point nastiness to cause too much trouble; addedsep-dp=Noption to control the decimal place in.annotoutputs; -
added
facinstead ofbinfor PSD (but, in general, removing support/documentation around this). -
for
SIGNALScommand, added thereqoption to require that specified signals are present/kept; in contrast, the originalkeepoption now will not complain if a requested signal is not present (i.e.keepimplies keep if present) -
added the
idcommand-line option, so that a numeric ID can be specified (i.e. and not be interpreted as a sample-list line number) -
added a
minoption toEPOCH, which gives minimal output: just the epoch count to standard output -
added a
dumpoption toSTAGEto write stages to standard out (i.e. parallelseannotoption, but does not write to a file) -
added
guess(andeeg) options to theCANONICALcommand, to guesscsEEGwithout a file/group specified
Internal
-
added
cache_tforPSCcommandSPINDLES/SO, and [in flight] adding aCOUPLcommand to separate out spindle/SO detection from coupling analyses -
trims trailing whitespace from the physical dimension and transducer type fields in the EDF header; this was already done for channel labels
-
swapped in functions and classes from the Eigen matrix library for many numerical intensive procedures
-
added a runs test to the stats helper function library
v0.24 (22-August-2020)
New commands
-
ALIASEScommand to list any channel/annotation aliases done for that individual -
MINMAXcommand to set EDF header digital/physical min/max to same values across multiple channels -
TYPEScommand and accompanying optionsch-match,ch-exactandch-clear, which groups channels by types (e.g. EEG, EMG, respiratory effort, etc) and defines correspondong automatic variables (e.g.${eeg}and${emg}); theHEADERScommand now also outputs aTYPEfield -
CANONICALcommand to generate canonical signals,cs_EEG,cs_LOC,cs_ROC,cs_EMGandcs_ECG -
VARScommand to output all variables defined for a given individual (designed to be paired with the new individual-level variables feature, via thevarsoption) -
CCcommand for connectivity and coupling statistics -
ACFcommand to calculate signal autocorrelation
New options/behaviors for existing commands
-
added
SENSandPOSvariables toHEADERSchannel-level output -
added
flatandmaxoptions toSIGSTATS -
CWT-DESIGNnow outputs FWHM in time and frequency domains, and accepts newer FWHM-basewd specification (instead of cycles); see this manuscript -
added the
wrappedandfwhmoptions toCWT -
added the
fftoption toFILTERfor FFT convolution -
FILTERandFILTER-DESIGNcan now read a FIR from afile; also, instead of Kaiser windows to design a FIR, one can now fix the filter order and specify the type of window (e.g. Hamming, Blackman, etc) -
added a
newoption for theREFERENCEcommand, and the ability to specify.as a reference (i.e. to do nothing, to facilitate automatic processing) -
added summaries to
CORREL, and improved the speed of this command -
allow now a comma-delimited list when defining stage labels for
STAGEandHYPNO, e.g.N1=n1,NREM2 -
added
epochandper-spindleoptions to theSPINDLES, making this level of output optinal, and omitted by default (i.e. forExFxCHandNxFxCH) -
new added
cstatsandastatsoptions forSIGSTATS -
added the
channelsoption to theDESCcommand (to write a simple list of all channel labels to standard output) -
the
ANNOTScommand now outputsSTART_HMS/STOP_HMSandSTART_ELAPSED_HMS/STOP_ELAPSED_HMSunderANNOTxINSTxToutput strata, which are the hh:mm:ss version of clock-time and elapsed time since EDF start, respectively
Other changes
-
default log output is now less verbose (unless
verbose=1set) -
small fixes in processing EDF fields: the reserved field is now set to space (rather than null) characters; also, all EDF header fields (including the reserved field) are now checked for being within the 7-bit US-ASCII range 32-126 (any character outside this range is changed to a
?character) -
changed behavior to replace spaces in channel names with underscore (
_) characters for ease of processing; setting thespacesvariable can specify alternate replacement characters;keep-spacesoption, if true, means that spaces are retained -
added support for individual-level variables to be loaded from a file (via the
varsoption) -
added automatic special variable
${id}, which can act in the same manner as the^special character in scripts, i.e. to represent the current EDF ID -
added the
add=option to turn on/off conditional blocks -
added a check that any variable defined in a script does not clash with a special variable (i.e. command line option).
-
added
include={file list}option, to mirrorexclude={file list}(nb. you cannot have both exclude and include) -
Luna can now read gzipped (compressed) ASCIIs directly
-
added a check that named
TAGs do not clash with existing, internal tags, e.g.ForCH -
fixed an issue with 0-duration annotations, e.g. as may occur with marks from
EDF Annotationschannel -
fixed an issue with the
ANNOTScommand not reporting all output if theEPOCHcommand hadn't been explicitly called first -
Luna now explicitly gives an error message if trying to use an
.eannotfile (ore:1notation in an.annotfile) with EDF+ (i.e. which may be discontinuous). That is, if the input file is an EDF+, Luna requires annotation formats with exact times (i.e. either seconds elapsed since the start of the EDF, or hh:mm:ss format). -
added EDF+ Annotation parsing; Luna now reads all
EDF Annotationsevents as an annotation track, which is automatically combined with any other annotations (e.g. from XML or.annotfiles). Currently, all annotations have the classedf_annot, which values are instance IDs/label. -
added new options to force/skip annotations:
force-edf,skip-annots,skip-edf-annotsandskip-all-annots. -
added support for using braces
{and}instead of'to denote string literals in eval expressions (i.e. which can be convenient if writing expressions on the command line with-swhere'is already used) -
changed formatting of
-ttext table file names; added--tt-prependand--tt-appendoptions (equivalently,--tt-prefixand--tt-suffix) -
SPANNINGnow works on EDF+D files -
HEADERSnow reportsEDF_TYPE
v0.23 (15-Jan-2020)
-
new help function (
-hcommand line argument), to list commands, parameters and their output tables/variables -
new spindle/slow oscillation coupling permutation option and output variables
-
provisional support for text-table output mode with
-toption, optionally writing gzipped text (with corresponding lunaRltxttab()function -
new option to read data from a plain text file rather than an EDF
-
automatically generate sample lists with a new --build option, i.e. to recursively find all EDFs and match annotation files in a set of folders
-
added support to read and write compressed EDF files, via the EDFZ format, as highlighed in this vignette
-
new scripting features: command files now allow conditional clauses, via the
[[varsyntax, within-script variable definitions, via the${var=xyz}syntax, and expanding numeric sequences, e.g.[ICA][1:10]expands toICA1,ICA2,ICA3,... -
new
SEGMENTScommand to show contiguous time intervals within a discontinuous EDF+ -
can now write EDF+ files
-
new experimental commands for multi-channel EEG:
CLOCS(to read channel locations),CHEP(channel/epoch masks),INTERPOLATE(to interpolate missing channels/epoch based on spherical splines),SL(to compute the surface Laplacian), andICA(implementation of the fastICA algorithm). -
added individual-ID wildcards in the specification of output database names (
-oor-a), i.e. to write to a separate database for each EDF/individual, e.g.-o path/to/out-^.db -
COHperformance has increased, and it now reports imaginary and lagged coherence; also, can acceptsig1andsig2parameters to more flexibly specify which pairs of channels are considered -
the
CHSoutput factor is now split into two separate factors,CH1andCH2, forCOHCORRELandMI -
added
SPANNINGcommand to report on "coverage" of an EDF by one or more annotations -
added special variables
silentto turn off all console logging -
added
--xml2command line option for verbose view of XML tree -
removed the
skip-annotsspecial variable; replaced with two new variables:skip-edf-annotsandskip-all-annots -
the
MASKepochandmask-epochparameters can now take comma-delimited lists of ranges, e.g.epoch=1,6,8-10,22 -
changed the behavior of
assume-pm-start; it is now off by default, and accepts a time parameter to define whether ambiguous times are assigned AM or PM values -
added
START_TIME,START_DATEand (optionally)SIGNALSoutput variables to theHEADERScommand -
now make new, unique labels for any duplicate channel labels found in an EDF (e.g. EEG, EEG.1, EEG.2, etc) and writes a message to the log
-
now check whether the same channel alias points to more than one channel, and if so, will give an error message
-
can now use hh:mm:ss clock-time format in
.annotfiles (assumes 24 hour; requires start & stop specified) -
changed clock-time format from
hh:mm:sstohh.mm.ssfor compliance with the EDF spec; Luna can still read clock-times with the colon-delimiter however -
new mode (
-ainstead of-o) to append to, rather than overwrite, output databases -
fixed an issue with the
MTMcommand'sepochoption, when used with multiple signals -
fixed issue with command parameters not being recorded in the output database
-
added the
nsrr-remapoption to turn off auto-remapping of NSRR annotations -
new
RECSandSEGMENTScommands to dump basic EDF record and interval info to stdout -
added a
fail-listoption [note: need to check implementation] -
fixed issue with
ANNOTSwhere an annotation was flagged as overlapping a region/epoch is it ended exactly 1 time-unit beforehand (i.e. ignored convention that intervals are internally represented as [start] to [one past the end] of the interval).
v0.22 (31-March-2019)
Initial public release.