Meta-Analysis of Face-Validity Indicators in Automatically Detected Dog Sleep Spindles.
The 1 match
- [1] § Methods › Spindle Detection ↔ spindle_hound_rawplot_extras.m, lines 61–124 · score 0.68 · frequency power, spindle activity, standard deviation, root, square, selection
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 262 lines · 13 KB · no license · 1 match
- %Written to search for spindles in dog EEG, special thanks to Róbert
- %Bódizs, Gilles van Luijtelaar, Kaue Costa, and Antoine Nonclercq.
- awakeeeg = FzCz(hypnogram == 1); %define which part of the recording is awake eeg, using the corresponding hypnogram label '1' (awake)
- sleepeeg = FzCz(hypnogram == 4); %do the same with the non-REM part of the signal
- sleepeeg = sleepeeg - mean(sleepeeg);
- raweeg = sleepeeg;
- Nyquist = SR/2; %Using SR (= Sampling Rate, provided with the file) calculate the Nyquist frequency
- window = SR*0.5; %Define the size of the signal segments that will be used for a sliding fft, as a magnitude of sampling rates (results in 0.5 seconds window)
- normalized_cutoff = 16/Nyquist; %passband low-pass
- normalized_cutoff2 = 35/Nyquist; %stopband low-pass
- nc = 30/Nyquist;
- nc2 = 35/Nyquist;
- highpass_cutoff2 = 5/Nyquist; %passband high-pass
- highpass_cutoff = 3/Nyquist; %stopband low-pass
- [order,nfreq] = buttord(normalized_cutoff,normalized_cutoff2,0.5,30); %establish the best order and cut-off frequency for a low-pass filter that attenuates with 30 dB and allows for max 0.5 dB ripple
- [order2,nfreq2] = buttord(highpass_cutoff2,highpass_cutoff,0.5,30); %establish the best order and cut-off frequency for a high-pass filter that attenuates with 30 dB and allows for max 0.5 dB ripple
- [order3,nfreq3] = buttord(nc,nc2,0.5,30); %establish the best order and cut-off frequency for a low-pass filter that attenuates with 30 dB and allows for max 0.5 dB ripple
- [b,a,k1] = butter(order,nfreq,'low'); %obtaining filter coefficients with the order and cut-off specified for the low-pass filter
- [c,d,k2] = butter(order2,nfreq2,'high'); %obtaining filter coefficients with the order and cut-off specified for the high-pass filter
- [e,f,k3] = butter(order3,nfreq3,'low'); %obtaining filter coefficients with the order and cut-off specified for the low-pass filter
- sos1 = zp2sos(b,a,k1);
- sos2 = zp2sos(c,d,k2);
- sos3 = zp2sos(e,f,k3);
- sleepeeg = sosfilt(sos1,sleepeeg); %transform the trace with the low-pass filter
- sleepeeg = sosfilt(sos2,sleepeeg); %transform the trace with the high-pass filter
- raweeg = sosfilt(sos3,raweeg); %transform the trace with the low-pass filter
- clear b a c d %clear the filter coefficients
- [result, frequencymap, timepoints, power] = spectrogram(sleepeeg,window,round(SR*0.125),SR*10,SR); %obtain a matrix of amplitudes, the corresponding frequencies, timepoints and power for a sliding fft with 0.5 seconds window-size (using predefined window value, see above), window-overlapp of 0.125 seconds, and zero-padding for 0.1 Hz resolution (10*SR)
- result = abs(result');
- frequencymap = frequencymap';
- timepoints = timepoints';
- power = power'; %align all results to ease later indexing
- [r,c] = size(result); %obtain size parameters of the results for subsequent loop-construction
- for x = 1:r %loop repeats for the number of windows used in the fft
- szelet = (frequencymap >= 0); %originally at this spot only frequencies above 2 Hz were selected for further analysis, to avoid the estimation of the max frequency power be influenced by the DC-offset, however I later learned high-pass filtering deals with it, so the value is set to zero now
- szeletmap = frequencymap(frequencymap >= 0); %here the frequency-map is adjusted for the selection above, which is now simply above 0 (but was above 2 Hz)
- selectresult = power(x,szelet); %the power-values of each window are collected, originally only for the selected frequency search radius (> 2 Hz)
- [amp,pos] = max(selectresult); %amplitude and position on the frequency-map of the highest power is selected
- maxfreq(x) = pos; %for each window the frequency with the highest power is collected in a vector
- absmaxpow(x) = amp;
- clear amp pos selectresult %clear variables for a new loop
- end
- forcrd = timepoints*SR; %reconstruct the sample positions of the time-points :D
- for e = 1:length(timepoints); %go through all time-points
- crd = forcrd(e); %find each corresponding sample
- crd1 = round(crd - (0.25*SR)); %select a point that is half of the fft-window (in samples) below the time-point (which is itself the center of the window)
- crd2 = round(crd + (0.25*SR)); %select a point that is half of the fft-window (in samples) above the time-point (which is itself the center of the window)
- if crd1 <= 0 %if the lower boundary of the real window is shorter than expected (the center is not symmetrical)
- crd1 = 1; %let the beginning of the whole trace define the beginning of the window
- end
- if crd2 > length(sleepeeg); %if the upper boundary of the window is longer than expected (signal ends less than 0.25 seconds after the center of the window)
- crd2 = length(sleepeeg); %upper boundary of the window coincides with the end of the trace
- end
- ampest(e) = rms(sleepeeg(crd1:crd2)); %calculate the root mean square (rms) for the entire window as an amplitude estimate
- clear crd crd1 crd2 %clear variables for a new loop
- end
- ampest = ampest'; %align amplitude-estimates for better indexing
- ampest = zscore(ampest); %calculate standard-scores for the amplitude-estimates
- maxfreq = maxfreq'; %align the fequencies (per window) with the max power for better indexing
- range = (szeletmap(maxfreq) >= 9 & szeletmap(maxfreq) <= 16)'; %select those windows whose max frequency power is within the target range
- selector = range & (ampest >= 1); %combine that with the amplitude estimate being more than a standard deviation above the average trace rms
- happening_times = timepoints(selector == 1,:); %use the indices that correpsond to above criteria to select the windows that likely contain spindle activity
- sampleTimes = timepoints*SR; %this and the next few lines are a repetition of the amplitude estimation, but this time only to arrive at the amplitudes of the above selected windows
- for k = 1:length(range);
- coord = sampleTimes(k);
- coord1 = round(coord - (0.25*SR));
- coord2 = round(coord + (0.25*SR));
- if coord1 <= 0
- coord1 = 1;
- end
- if coord2 > length(sleepeeg);
- coord2 = length(sleepeeg);
- end
- valuesOFtimes(k) = rms(sleepeeg(coord1:coord2));
- clear coord coord2
- end
- valuesOFtimes = valuesOFtimes';
- valuesOFtimes = zscore(valuesOFtimes);
- samp = valuesOFtimes(selector == 1); %this repetition of steps, and the selection of specifically amplitudes of spindle-containing suspected windows, ends here
- [estimatesamp,pci_amp] = mle(samp); %estimatesamp contains estimates of the true mean(1) and standard deviation(2) of the spindle-candidate-amplitudes
- medspin = estimatesamp(1); %label the mean estimate of amplitudes
- varamp = estimatesamp(2); %label the std estimate of amplitudes
- varamp = 2*varamp; %establish a 2 std range for amplitudes
- uplimit = medspin + varamp; %establish upper-limit for acceptable amplitude values based on the 2 std range
- lolimit = medspin - varamp; %establish lower-limit for acceptable amplitude values based on the 2 std range
- [estimatesfreq,pci2] = mle(szeletmap(maxfreq(selector == 1))); %estimates are now obtained for the frequencies of the spindle-suspects
- mfv = estimatesfreq(1); %label the estimate of frequency mean
- mfs = estimatesfreq(2); %label the estimate of frequency std
- mfs = 2*mfs; %the frequency 2 std range
- minif = mfv - mfs; %lowerlimit frequency
- maxf = mfv + mfs; %upperlimit frequency
- range2 = (szeletmap(maxfreq) >= minif & szeletmap(maxfreq) <= maxf)'; %new version of above variable 'range' but now based on the upper and lower limits of frequency (normal-modeling)
- selector2 = range2 & (valuesOFtimes > lolimit) & (valuesOFtimes < uplimit) & (valuesOFtimes >= 1); %second selection based on the new normal modelling criteria
- happening_times = timepoints(selector2 == 1,:); %marks the correpsonding time-points of the last selection, to use them for plotting
- h_times = happening_times; %renaming, possibly now redundant
- for t = 1:length(h_times) %plotting loop
- mark1 = h_times(t); %go through all time-points corresponding to detections as defined after the second round of selection
- dvalue = mark1*SR; %find the corresponding sample in the original signal to each time-point
- svalue = dvalue + (SR*2.5); %extend 1.5 seconds from the time-point of detection and use the correpsonding sample for the upper boundary of the plotting window
- evalue = dvalue - (SR*2.5); %go 1.5 seconds down from the time-point of detection and use the correpsonding sample for the lower boundary of the plotting window
- if evalue <= 0 %if the time-point of detection is less than 1.5 seconds from the start of the signal...
- evalue = 1; %...then start plotting from the beginning of the signal
- elseif svalue >= length(sleepeeg) %if the signal ends less than 1.5 seconds from the time-point of detection...
- svalue = length(sleepeeg); %...then only plot as far as the signal reaches
- end
- xax = 0:1/SR:5; %a scale in seconds for the x-axis
- xax = xax - 2.5; %let the detection be time-point zero on the scale
- plotsignal = raweeg(evalue:svalue); %determine the part of the signal you want to plot
- if length(xax) < length(plotsignal)||length(xax) > length(plotsignal) %if the portion you want to plot is longer or shorter than the 3 second time-window around detection...
- plot(plotsignal) %...then just plot without scaling
- else
- plot(xax,plotsignal) %if scale and signal align always scale
- ydown = min(plotsignal) - 10;
- yup = max(plotsignal) + 10;
- axis([-2.5 2.5 ydown yup]) %limit the y-axis to diplay the signal only between 20 and -20 µV
- end
- pause %pause after showing every detection-image
- clear mark1 dvalue svalue evalue %eliminate variables that could interfer with the loop
- end
- for w = 1:length(h_times) %for calculating negative chirping index
- maxcoordf = find(timepoints == h_times(w)); %establish which row of the time-point vector corresponds to the center of a spindle-detection
- prevcoord = maxcoordf - 1; %find the position preceding the center of a spindle
- postcoord = maxcoordf + 1; %find the position following the center of a spindle
- if prevcoord > 1
- spstartfreq = maxfreq(prevcoord); %find the maximum frequency preceding the center of a spindle
- else
- spstartfreq = maxfreq(maxcoordf);
- end
- if postcoord < length(timepoints);
- spstopfreq = maxfreq(postcoord); %find the maximum frequency following the center of a spindle
- else
- spstopfreq = maxfreq(maxcoordf);
- end
- negchirp_value(w) = spstartfreq/spstopfreq; %calculate how much higher is the maximum frequency preceding the center of a spindle compared to the maximum frequency that follows
- clear maxcoordf prevcoord postcoord spstartfreq spstopfreq
- end
- HD = diff(h_times); %calculate a vector of distances between detection times
- UjHD = HD > 0.5; %count 1 separate spindle event for every two detections that are more than 0.5 seconds apart
- spindle_number = sum(UjHD); %sum the previous ones to estimate the number of spindles
- if (length(h_times)) - 1 == sum(HD > 0) %if the number of detections and events estimated as separate is equal...
- spindle_number = spindle_number + 1 %...take the number of estimated separate events and add a one to adjust for the shorter diff-vector
- elseif sum(HD > 0) == 1 %if there is only one 1 in UjHD, this still means 2 separate spindles
- spindle_number = 2
- elseif length(h_times) > 0 & sum(HD > 0) == 0 %if no event is marked as separate, but the detections are larger zero...
- spindle_number = 1 %this is still one spindle
- else
- spindle_number = spindle_number %if non of above complications occur, spindle_number is a good enough estimate :)
- end
- average_frequency = mean(szeletmap(maxfreq(selector2 == 1))) %frequency is averaged across all detections of the second detection-round
- SWSminutes = (length(sleepeeg)/SR)/60 %currently not activated, but can calculate the duration of the non-REM sleep in minutes, has been used to obtain data already
- density_spindles = spindle_number/SWSminutes %the estimate of spindle number divided by the minutes of non-REM sleep
- amplitude = mean(valuesOFtimes(selector2 == 1)) %the amplitude is averaged across all detections of the second detection-round
- absmaxpow = absmaxpow';
- avg_maxpow = mean(absmaxpow(selector2 == 1))
- overlapdur = ((sum(selector2)) - spindle_number + 1)*0.3750;
- noverlapdur = (spindle_number)*0.5;
- total_duration = overlapdur + noverlapdur;
- avg_duration = total_duration/spindle_number
- avg_negative_chirp_magnitude = mean(negchirp_value)
- transhyp = hypnogram < 2; %these last lines estimate how often the dog slipped out of sleep
- awakenings = sum(diff(transhyp) == -1)
- awaketime = (length(awakeeeg)/SR)/60
spindle_hound_rawplot_extras.m at commit fa87bc9, no license · at the source
Overview
Abstract
Visual inspection as the golden standard for sleep spindle detection has received mixed support and may not be equally viable across species and experimental conditions. Here we propose a novel intermediate strategy for approximating the quality of a detector and subject our own algorithm for spindle detection in dogs to the procedure. Automatic detections across the full range of our data (excluding only data sets with high subject overlap) were analyzed for their compliance with three face validity criteria, originally discovered by expert scorers in human EEG. These criteria are the shortness of the events (mostly below 2 s, maximum 6), the distribution of faster (> 13 Hz) spindles along the midline (higher in central and posterior derivations) and an association between amplitude and negative chirp (positive for sleep spindles and mostly unrelated for other oscillations). All three criteria were observed in the majority of data sets and sampling events (subsets of data defined by condition and/
Supplementary Information: The online version contains supplementary material available at 10.1007/
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
IvoWolf1987/spindle_hound
fa87bc9e5c9d7dfc804e6a2709821cd3dd5b44cb, 28 November 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
1 file
- spindle_hound_rawplot_ex
tras.m , MATLAB, 262 lines, 1 match
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 1 script, each with its path and the digest of its content;
- 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
Data Availability
Values calculated specifically for these analyses are shared in a Supplementary collection of excel tables. The original data had also been shared before alongside several published works.
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 2, 28 September 2026
- Publisher: n/a → Springer Science+Business Media
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 7 keywords, 9 MeSH terms, 1 funder, 37 references.
Cite
This paper
Iotchev, I. B., & Kis, A. (2026). Meta-Analysis of Face-Validity Indicators in Automatically Detected Dog Sleep Spindles. Neuroinformatics, 24(3), 53. https://
BibTeX
@article{iotchev2026meta
author = {Iotchev, Ivaylo Borislavov and Kis, Anna},
title = {{Meta-Analysis of Face-Validity Indicators in Automatically Detected Dog Sleep Spindles}},
journal = {Neuroinformatics},
year = {2026},
month = aug,
volume = {24},
number = {3},
pages = {53},
publisher = {Springer Science+Business Media},
issn = {1539-2791},
doi = {10.1007/
url = {https://
pmid = {42603228},
pmcid = {PMC13477484}
}
RIS
TY - JOUR
AU - Iotchev, Ivaylo Borislavov
AU - Kis, Anna
TI - Meta-Analysis of Face-Validity Indicators in Automatically Detected Dog Sleep Spindles
T2 - Neuroinformatics
J2 - Neuroinformatics
PY - 2026
DA - 2026/
VL - 24
IS - 3
SP - 53
SN - 1539-2791
PB - Springer Science+Business Media
DO - 10.1007/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1007/
"type": "article-journal",
"title": "Meta-Analysis of Face-Validity Indicators in Automatically Detected Dog Sleep Spindles",
"container-title": "Neuroinformatics",
"author": [
{
"family": "Iotchev",
"given": "Ivaylo Borislavov"
},
{
"family": "Kis",
"given": "Anna"
}
],
"container-title-short":
"volume": "24",
"issue": "3",
"page": "53",
"DOI": "10.1007/
"PMID": "42603228",
"PMCID": "PMC13477484",
"ISSN": "1539-2791",
"publisher": "Springer Science+Business Media",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
15
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1093/sleep/zsaf410 [code]
- Does twitch-spindle coupling differ between N2 and N3 sleep in 6-month-olds?Journal: SleepIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, EEG, 3 references
- [2] doi:10.1093/braincomms/fcag255 [code]
- Impaired consolidation of spatial memory during sleep in patients with leucine-rich glioma-inactivated 1-associated limbic encephalitis.Journal: Brain communicationsIn common: 3 references
- [3] doi:10.1038/s41467-026-73106-z [code]
- Respiratory pauses highlight sleep architecture in mice.Journal: Nature communicationsIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, EEG, 1 reference
- [4] doi:10.1371/journal.pbio.3003938 [code]
- Theta oscillations tag episodic memories for sleep-dependent consolidation.Journal: PLoS biologyIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, EEG, 1 reference
- [5] doi:10.7554/elife.110795 [code]
- REM sleep prefrontal high-frequency oscillation chains mediate distinct cortical - hippocampal reactivation patterns compared to NREM sleep.Journal: eLifeIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 1 reference
- [6] doi:10.1038/s41467-026-75162-x [code]
- Dyscoordination of thalamic reticular spindles is associated with social memory deficits in mice and humans with autism spectrum disorder.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, 2 references
- [7] doi:10.1038/s41597-026-07807-x [code]
- A Multimodal fNIRS-EEG Dataset for Unilateral Limb Motor Imagery.Journal: Scientific dataIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, methods / tools, EEG
- [8] doi:10.1002/hbm.70599 [code]
- Group Joint ICA (gjICA): A Method for Multimodal Fusion of Concurrent EEG and fMRI Data.Journal: Human brain mappingIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, methods / tools, EEG
- [9] doi:10.1371/journal.pone.0352191 [code]
- Bayesian Uncertainty-aware Deep Learning with noisy labels: Tackling annotation ambiguity in EEG seizure detection.Journal: PloS oneIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, methods / tools, EEG
- [10] doi:10.1088/1741-2552/ae5f4b [code]
- logLIRA: a method for reliable suppression of electrical stimulation artifacts enabling short-latency neural response recovery.Journal: Journal of neural engineeringIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, methods / tools, EEG
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 1 script, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:5705409028e70a40…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
