A dataset of EEG and ECG recordings around the onset of NREM sleep from infancy to adolescence.
7 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 9 matches · 2 of them tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
- [1] § Methods › Data acquisition ↔ subfunctions/read_into_montage.m, the whole file · a weak match · score 0.86 · double banana, bipolar montage, channel, EEG · block
oscr:b:BVCPVQRG7K70G-N· Report a mismatch - [2] § Technical Validation ↔ quality_assesssment_for_github.m, lines 98 to 177 · score 0.78 · burst sharpness, post N2 onset, relative alpha, pre N2 onset, Spearman, centile · block
oscr:b:Q3JFNMQ0DMSQN-Y· Report a mismatch - [3] § Data Records ↔ quality_assesssment_for_github.m, lines 1 to 24 · score 0.73 · anon_codex_age_sex.csv, quantized age, quantized sex, female · block
oscr:b:CXRGJZ71QAH38-Z· Report a mismatch - [4] § Technical Validation ↔ subfunctions/single_channel_features.m, lines 1 to 52 · score 0.73 · relative spectral power, spectral entropy, modified, PSD, duration, vector · block
oscr:b:A0SVG49WKQPBG-D· Report a mismatch - [5] § Technical Validation ↔ quality_assesssment_for_github.m, lines 613 to 685 · score 0.73 · minute epoch, Pan Tompkins, ECG features, notch, quality, median · block
oscr:b:NH34NX0DBCGVN-8· Report a mismatch - [6] § Data Records ↔ anonymize_dataset_for_github.m, lines 116 to 167 · score 0.63 · anon codex, quantized sex, quantized age, EDF · block
oscr:b:ZXXQ1XNBHZ3H0-4· Report a mismatch - [7] § Technical Validation ↔ quality_assesssment_for_github.m, lines 255 to 303 · score 0.63 · post N2 onset, pre N2 onset, predicted age, kernel, correlation · block
oscr:b:JFC24SVHC84SM-2· Report a mismatch - [8] § Technical Validation ↔ quality_assesssment_for_github.m, lines 255 to 303 · score 0.63 · post N2 onset, pre N2 onset, predicted age, kernel, correlation · block
oscr:b:JFC24SVHC84SM-2· Report a mismatch - [9] § Data Records ↔ subfunctions/read_into_montage.m, the whole file · a weak match · score 0.62 · referential montage, microvolts, EDF, channels, EEG · block
oscr:b:BVCPVQRG7K70G-N· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 897 lines · 31 KB · MIT · 5 matches
- % Quality Assessment Open EEG Data
- % READ IN CSV file with filenames, quantized age and sex
- filename = 'anon_codex_age_sex.csv';
- % Specify range and delimiter
- dataLines = [2, Inf];
- opts = delimitedTextImportOptions("NumVariables", 3);
- opts.DataLines = dataLines;
- opts.Delimiter = ",";
- opts.VariableNames = ["AnonFilename", "QuantizedAgeyears", "QuantizedSex"];
- opts.VariableTypes = ["string", "double", "categorical"];
- opts.ExtraColumnsRule = "ignore";
- opts.EmptyLineRule = "read";
- opts = setvaropts(opts, "AnonFilename", "WhitespaceRule", "preserve");
- opts = setvaropts(opts, ["AnonFilename", "QuantizedSex"], "EmptyFieldRule", "auto");
- % Import the data
- anoncodex = readtable(filename, opts);
- fnames = cellstr(anoncodex{:,1});
- ages = anoncodex{:,2};
- sex = anoncodex{:,3};
- s1 = contains(sex, 'M'); % M - Male
- sex = s1;
- %s2 = contains(sex, 'F'); % F - Female
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % EEG ANALYSIS
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % PERFORM BASIC EVALUATIONS ON DATASET
- fs1 = 250;
- val1a = zeros(1, length(fnames)); val1b = val1a; val2 = val1a;
- for ii = 1:length(fnames)
- [dat, hdr, label, fs, scle, offs] = read_edf(fnames{ii});
- data_bp_mont = read_into_montage(dat, label, scle, fs, fs1, 0);
- anno = per_ha_art(data_bp_mont, fs1);
- val2(ii) = sum(sum(anno))/prod(size(anno))*100;
- [nf1, nf2] = noise_floor(data_bp_mont, anno, fs1);
- val1a(ii) = mean(nf1); val1b(ii) = mean(nf2);
- end
- save('results_qa_v1.mat', 'val1a', 'val1b', 'val2');
- load results_qa_v1
- X = [ages sex]; % convert sex to binary first
- y1 = fitlm(X, val1a');
- y2 = fitlm(X, val1b');
- % SIMPLE FEATURE EXTRACTION
- fts = cell(1, length(fnames));
- %parpool(8) consider using parpool if possible
- for ii = 1:length(fnames)
- ii
- fts{ii} = get_fts(fnames, ii);
- end
- %cd('L:\Lab_JamesR\nathanST\FBA_paeds_project\Documents\paper3_open_data')
- save('results_qa_feats_v1.mat', 'fts', 'ages', 'sex')
- load results_qa_feats_v1
- % CORRELATIONS WITH AGE
- fv1 = zeros(length(fts), 32); fv2 = fv1;
- for ii = 1:length(fts)
- fval = fts{ii};
- fv1(ii,:) = median(fval(1:10,:));
- A = size(fval);
- if A(1)<21
- fv2(ii,:) = median(fval(11:end,:)); % pre N2 onset
- else
- fv2(ii,:) = median(fval(11:21,:)); % post N2 onset
- end
- end
- p1 = corr(fv1, ages);
- p2 = corr(fv2, ages);
- val = unique(ages);
- prs = [1:2:length(val) ; 2:2:length(val)];
- x1 = ages(sex==0);
- x2 = ages(sex==1);
- xx = linspace(min(ages), max(ages), 100);
- A = size(fv2);
- for ii = 1:A(2)
- ii
- y1 = fv2(sex==0,ii);
- y2 = fv2(sex==1,ii);
- y1v = zeros(1, length(val)); y2v = y1v;
- for jj = 1:length(val)
- y1v(jj) = median(y1(x1==val(jj)));
- y2v(jj) = median(y2(x2==val(jj)));
- end
- cohD = zeros(length(prs), 5);
- for jj = 1:length(prs)
- dum = meanEffectSize(y1(x1==val(prs(1,jj)) | x1==val(prs(2,jj))), y2(x2==val(prs(1,jj)) | x2==val(prs(2,jj))));
- cohD(jj,:) = [dum.Variables sum(x1==val(prs(1,jj)) | x1==val(prs(2,jj))) sum(x2==val(prs(1,jj)) | x2==val(prs(2,jj)))];
- end
- end
- % START PLOTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- figure;
- subplot(2,2,1);
- f = zeros(1,17);
- for ii = 1:17
- rf = find(ages>=ii-1 & ages<ii);
- f(ii) = median(fv1(rf,25));
- end
- x = [1:17]-0.5;
- B = polyfit(x([1:15 17]), f([1:15 17]),2);
- res = fv1(:,25)-polyval(B,ages);
- rx = find(abs(res)<5e-4);
- plot(ages(rx), fv1(rx,25), '.');
- ylabel('Hjorth 2')
- xlabel('Age (y)')
- axis([-1 17 0 2e-3])
- set(gca, 'position', [0.1 0.575 0.375 0.375], 'FontName', 'times', 'FontSize', 12)
- title('Pre- N2 onset')
- text(0, 1.75e-3, 'A', 'FontName', 'times', 'FontSize', 14)
- pp = corr(ages, fv1(:,25), 'type','Spearman');
- text(10, 0.25e-3, ['r = ' num2str(pp, '%1.3f')], 'FontName', 'times', 'FontSize', 12)
- subplot(2,2,3);
- f = zeros(1,17);
- for ii = 1:17
- rf = find(ages>=ii-1 & ages<ii);
- f(ii) = median(fv1(rf,30));
- end
- x = [1:17]-0.5;
- B = polyfit(x([1:15 17]), f([1:15 17]),2);
- res = fv1(:,30)-polyval(B,ages);
- rx = find(abs(res)<0.02);
- plot(ages(rx), fv1(rx,30), '.');
- ylabel('Burst Sharpness')
- xlabel('Age (y)')
- axis([-1 17 -.97 -0.89])
- set(gca, 'position', [0.1 0.1 0.375 0.375], 'FontName', 'times', 'FontSize', 12)
- text(15, -0.9, 'B', 'FontName', 'times', 'FontSize', 14)
- pp = corr(ages, fv1(:,30), 'type','Spearman');
- text(0, -0.96, ['r = ' num2str(pp, '%1.3f')], 'FontName', 'times', 'FontSize', 12)
- subplot(2,2,2);
- f = zeros(1,17);
- for ii = 1:17
- rf = find(ages>=ii-1 & ages<ii);
- f(ii) = median(fv2(rf,16));
- end
- x = [1:17]-0.5;
- B = polyfit(x([1:15 17]), f([1:15 17]),3);
- res = fv2(:,16)-polyval(B,ages);
- rx = find(abs(res)<5);
- plot(ages(rx), fv2(rx,16), '.');
- ylabel('Relative Alpha* Power (%)')
- xlabel('Age (y)')
- axis([-1 17 0 17.5])
- set(gca, 'position', [0.6 0.575 0.375 0.375], 'FontName', 'times', 'FontSize', 12)
- title('Post- N2 onset')
- text(0, 15, 'C', 'FontName', 'times', 'FontSize', 14)
- pp = corr(ages, fv2(:,16), 'type','Spearman');
- text(10, 2, ['r = ' num2str(pp, '%1.3f')], 'FontName', 'times', 'FontSize', 12)
- subplot(2,2,4);
- f = zeros(1,17);
- for ii = 1:17
- rf = find(ages>=ii-1 & ages<ii);
- f(ii) = median(fv2(rf,1));
- end
- x = [1:17]-0.5;
- B = polyfit(x([1:15 17]), f([1:15 17]),2);
- res = fv2(:,1)-polyval(B,ages);
- rx = find(abs(res)<4);
- plot(ages, fv2(:,1), '.');
- ylabel('Amplitude (5^{th} centile; \muV)')
- xlabel('Age (y)')
- axis([-1 17 0 15])
- set(gca, 'position', [0.6 0.1 0.375 0.375], 'FontName', 'times', 'FontSize', 12)
- text(15, 13, 'D', 'FontName', 'times', 'FontSize', 14)
- pp = corr(ages, fv1(:,1), 'type','Spearman');
- text(0, 2, ['r=' num2str(pp, '%1.3f')], 'FontName', 'times', 'FontSize', 12)
- % END PLOTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % TRAIN GPR based age prediction - 5-fold CV 80:20 split
- % Find outliers in features
- rfs = zeros(1,length(fv1));
- for jj = 1:32
- y = fv1(:,jj); x = ages;
- B = polyfit(x,y,2);
- res = y - polyval(B, x);
- dum = zeros(1, length(y)); dum(find(abs(res)>6*std(res)))=1;
- rfs = rfs+dum;
- y = fv2(:,jj); x = ages;
- B = polyfit(x,y,2);
- res = y - polyval(B, x);
- dum = zeros(1, length(y)); dum(find(abs(res)>6*std(res)))=1;
- rfs = rfs+dum;
- end
- % get rid of outliers for now
- nref = find(rfs==0);
- fv1 = fv1(nref,:);
- fv2 = fv2(nref,:);
- ages = ages(nref);
- % split up data into 5 folds for cross-validation
- pid_in1 = 1:length(fv1);
- pma_in1 = ages;
- Mc = 5;
- out = zeros(1,1000);
- for qq = 1:1000
- rng(qq)
- pd = unique(pid_in1);
- y = cell(1,Mc);
- rx = ones(1,length(pd));
- K = floor(length(pd)/Mc); dum = rem(length(pd), Mc);
- K = K.*ones(1,Mc); K(1:dum) = K(1)+1;
- for ii = 1:Mc
- rz = find(rx==1);
- dum = randsample(length(rz), K(ii), false);
- rx(rz(dum)) = 0;
- y{ii} = rz(dum);
- end
- y{end} = [y{end}' ; find(rx==1)']';
- for ii = 1:Mc
- y{ii} = pd(y{ii});
- end
- ss = cell(1, Mc);
- for ii = 1:Mc
- rf = y{ii};
- ag = [];
- for jj = 1:length(rf); ag = [ag pma_in1(find(pid_in1==rf(jj)))]; end
- ss{ii} = ag;
- end
- pv = zeros(1,6); c1 = 1;
- for ii = 1:Mc
- for jj = ii+1:Mc
- [~, pv(c1)] = kstest2(ss{ii}, ss{jj});
- c1 = c1+1;
- end
- end
- out(qq) = mean(pv);
- end
- nr = find(out==max(out)); % nr = 7
- rng(nr)
- yr = cell(1,Mc);
- rx = ones(1,length(pd)); %rt = 1-rx; %rr = 1:length(pid);
- for ii = 1:Mc
- rz = find(rx==1);
- dum = randsample(length(rz), K(ii), false);
- rx(rz(dum)) = 0;
- yr{ii} = rz(dum);
- end
- yr{end} = [yr{end}' ; find(rx==1)']';
- for ii = 1:Mc; yr{ii} = pd(yr{ii}); end
- % do training and testing of age prediction for both pre- and post- N2
- % onset data
- pred1 = []; pred2 = []; agx = [];
- for ii = 1:Mc
- ii
- dum = zeros(1,length(fv1));
- dum(yr{ii})=1;
- r1 = find(dum==1); r2 = find(dum==0);
- rGP1 = fitrgp(fv1(r2,:), ages(r2), 'BasisFunction', 'constant', 'KernelFunction', 'matern52', 'Standardize', true);
- out1 = predict(rGP1, fv1(r1,:));
- pred1 = [pred1 ; out1];
- rGP2 = fitrgp(fv2(r2,:), ages(r2), 'BasisFunction', 'constant', 'KernelFunction', 'matern52', 'Standardize', true);
- out2 = predict(rGP1, fv2(r1,:));
- pred2 = [pred2 ; out2];
- agx = [agx ; ages(r1)];
- end
- % START PLOTTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- figure;
- subplot(1,2,1)
- plot(agx, pred1 ,'.')
- title('Pre- N2 Onset')
- set(gca, 'FontName', 'times', 'Fontsize', 16)
- xlabel('Age (y)'); ylabel('Predicted Age (y)')
- grid on; hold on;
- plot([-2 18], [-2, 18], 'k')
- axis([-1 17 -1, 17])
- set(gca, 'position', [0.075 0.15 0.4 0.8], 'Xtick', [0:2:16], 'Ytick', [0:2:16])
- %text(0, 16, 'A', 'FontName', 'times', 'Fontsize', 14)
- pp = corr(agx, pred1);
- text(10, 2, ['r = ' num2str(pp, '%1.3f')], 'FontName', 'times', 'FontSize', 16)
- subplot(1,2,2)
- plot(agx, pred2 ,'.')
- title('Post- N2 Onset')
- set(gca, 'FontName', 'times', 'Fontsize', 16)
- xlabel('Age (y)'); ylabel('Predicted Age (y)')
- grid on; hold on;
- plot([-2 18], [-2, 18], 'k')
- axis([-1 17 -1, 17])
- set(gca, 'position', [0.575 0.15 0.4 0.8], 'Xtick', [0:2:16], 'Ytick', [0:2:16])
- %text(0, 16, 'B', 'FontName', 'times', 'Fontsize', 14)
- pp = corr(agx, pred2);
- text(10, 2, ['r = ' num2str(pp, '%1.3f')], 'FontName', 'times', 'FontSize', 16)
- % END PLOTTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % DO SPECTRAL ANALYSIS
- addpath('L:\Lab_JamesR\nathanST\FBA_paeds_project\Code\fba_code_107052022\subfunctions')
- spa = cell(1, length(fnames)); spb = spa;
- %parpool(6)
- for ii = 1:length(fnames)
- ii
- [spa{ii}, spb{ii}] = get_spectra(fnames, ii);
- end
- save('results_qa_spec_v1.mat', 'spa', 'spb', 'ages', 'sex')
- load results_qa_spec_v1
- rn = [0 1 ; 1 3 ; 3 7 ; 7 17];
- d1 = 10*log10(cell2mat(spa')); d2 = 10*log10(cell2mat(spb'));
- spec_pre_mean = zeros(4, 257); spec_pre_std = spec_pre_mean; spec_post_mean = spec_pre_mean;
- spec_post_std = spec_pre_mean;
- for ii = 1:4
- rf = find(ages> rn(ii,1) & ages <= rn(ii,2));
- length(rf)
- spec_pre_mean(ii,:) = mean(d1(rf,:));
- spec_pre_std(ii,:) = std(d1(rf,:));
- spec_post_mean(ii,:) = mean(d2(rf,:));
- spec_post_std(ii,:) = std(d2(rf,:));
- end
- % START PLOTTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- figure; set(gcf, 'Position', [1000 150 800 680])
- subplot(4,4,[1 2 5 6]); hold on;
- f = linspace(0, 32, 257); rf = 6:255;
- for ii = 1:4
- h(ii) = plot(f(rf), spec_pre_mean(ii,rf), 'LineWidth', 2);
- end
- title('Pre- N2 Onset')
- axis([0 32 -10 40])
- legend(h, '0-1y','1-3y','3-7y','7-16y')
- set(gca, 'Fontname', 'times', 'fontsize', 14, 'Xtick', [0:4:32], 'XTickLabel', [0:4:32])
- xlabel('Frequency (Hz)', 'Fontname', 'times', 'fontsize', 16);
- ylabel('Power (dB)', 'Fontname', 'times', 'fontsize', 16);
- grid on
- set(gca, 'Position', [0.075 0.575 0.405 0.4])
- %text(4, 35, 'A', 'Fontname', 'times', 'fontsize', 18)
- fr = [9 10 13 14];
- pst1(1,:) = [0.075 0.285 0.19 0.2];
- pst1(2,:) = [0.295 0.285 0.19 0.2];
- pst1(3,:) = [0.075 0.075 0.19 0.2];
- pst1(4,:) = [0.295 0.075 0.19 0.2];
- for ii = 1:4
- subplot(4,4, fr(ii))
- cc = get(h(ii), 'color');
- g1 = spec_pre_mean(ii,:)+2*spec_pre_std(ii,:);
- g2 = spec_pre_mean(ii,:)-2*spec_pre_std(ii,:);
- j = patch([f(rf(1)) f(rf) f(rf(250:-1:1)) f(rf(1))], [g2(rf(1)) g1(rf) g2(rf(250:-1:1)) g1(rf(1))], cc);
- set(j, "EdgeColor", 'none')
- hold on;
- plot(f(rf), spec_pre_mean(ii,rf), 'color', [1 1 1]);
- axis([0 32 0 40])
- set(gca, 'Position', pst1(ii,:),'Xtick', [0:8:32], 'Fontname', 'times', 'fontsize', 14)
- switch ii
- case 1
- set(gca, 'Xticklabel', {}, 'Fontname', 'times', 'fontsize', 14)
- ylabel('Power (dB)', 'Fontname', 'times', 'fontsize', 16);
- text(20, 32, '0-1y', 'Fontname', 'times', 'fontsize', 14)
- case 2
- set(gca, 'Yticklabel', {}, 'Xticklabel', {}, 'Fontname', 'times', 'fontsize', 14)
- text(20, 32, '1-3y', 'Fontname', 'times', 'fontsize', 14)
- case 3
- set(gca, 'Fontname', 'times', 'fontsize', 14)
- xlabel('Frequency (Hz)', 'Fontname', 'times', 'fontsize', 16);
- ylabel('Power (dB)', 'Fontname', 'times', 'fontsize', 16);
- text(20, 32, '3-7y', 'Fontname', 'times', 'fontsize', 14)
- case 4
- set(gca, 'Yticklabel', {}, 'Fontname', 'times', 'fontsize', 14)
- xlabel('Frequency (Hz)', 'Fontname', 'times', 'fontsize', 16);
- text(20, 32, '7-16y', 'Fontname', 'times', 'fontsize', 14)
- end
- grid on;
- axis([0 32 -10 40])
- end
- subplot(4,4,[3 4 7 8]);
- hold on;
- f = linspace(0, 32, 257); rf = 6:255;
- for ii = 1:4
- h1(ii) = plot(f(rf), spec_post_mean(ii,rf), 'LineWidth', 2);
- end
- title('Post- N2 Onset')
- axis([0 32 -10 40])
- legend(h1, '0-1y','1-3y','3-7y','7-16y')
- set(gca, 'Fontname', 'times', 'fontsize', 14, 'Xtick', [0:4:32], 'XTickLabel', [0:4:32])
- xlabel('Frequency (Hz)', 'Fontname', 'times', 'fontsize', 16);
- ylabel('Power (dB)', 'Fontname', 'times', 'fontsize', 16);
- grid on
- set(gca, 'Position', [0.575 0.575 0.405 0.4])
- %text(4, 35, 'B', 'Fontname', 'times', 'fontsize', 18)
- fr = [9 10 13 14];
- pst1(1,:) = [0.575 0.285 0.19 0.2];
- pst1(2,:) = [0.795 0.285 0.19 0.2];
- pst1(3,:) = [0.575 0.075 0.19 0.2];
- pst1(4,:) = [0.795 0.075 0.19 0.2];
- for ii = 1:4
- subplot(4,4, fr(ii))
- cc = get(h1(ii), 'color');
- g1 = spec_post_mean(ii,:)+2*spec_post_std(ii,:);
- g2 = spec_post_mean(ii,:)-2*spec_post_std(ii,:);
- j = patch([f(rf(1)) f(rf) f(rf(250:-1:1)) f(rf(1))], [g2(rf(1)) g1(rf) g2(rf(250:-1:1)) g1(rf(1))], cc);
- set(j, "EdgeColor", 'none')
- hold on;
- plot(f(rf), spec_post_mean(ii,rf), 'color', [1 1 1]);
- axis([0 32 0 40])
- set(gca, 'Position', pst1(ii,:),'Xtick', [0:8:32], 'Fontname', 'times', 'fontsize', 14)
- switch ii
- case 1
- set(gca, 'Xticklabel', {}, 'Fontname', 'times', 'fontsize', 14)
- ylabel('Power (dB)', 'Fontname', 'times', 'fontsize', 16);
- text(20, 32, '0-1y', 'Fontname', 'times', 'fontsize', 14)
- case 2
- set(gca, 'Yticklabel', {}, 'Xticklabel', {}, 'Fontname', 'times', 'fontsize', 14)
- text(20, 32, '1-3y', 'Fontname', 'times', 'fontsize', 14)
- case 3
- set(gca, 'Fontname', 'times', 'fontsize', 14)
- xlabel('Frequency (Hz)', 'Fontname', 'times', 'fontsize', 16);
- ylabel('Power (dB)', 'Fontname', 'times', 'fontsize', 16);
- text(20, 32, '3-7y', 'Fontname', 'times', 'fontsize', 14)
- case 4
- set(gca, 'Yticklabel', {}, 'Fontname', 'times', 'fontsize', 14)
- xlabel('Frequency (Hz)', 'Fontname', 'times', 'fontsize', 16);
- text(20, 32, '7-16y', 'Fontname', 'times', 'fontsize', 14)
- end
- grid on;
- axis([0 32 -10 40])
- end
- % END PLOTTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Plot some example EEG recordings
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- filename = 'anon_codex_age_sex.csv';
- % Specify range and delimiter
- dataLines = [2, Inf];
- opts = delimitedTextImportOptions("NumVariables", 3);
- opts.DataLines = dataLines;
- opts.Delimiter = ",";
- opts.VariableNames = ["AnonFilename", "QuantizedAgeyears", "QuantizedSex"];
- opts.VariableTypes = ["string", "double", "categorical"];
- opts.ExtraColumnsRule = "ignore";
- opts.EmptyLineRule = "read";
- opts = setvaropts(opts, "AnonFilename", "WhitespaceRule", "preserve");
- opts = setvaropts(opts, ["AnonFilename", "QuantizedSex"], "EmptyFieldRule", "auto");
- % Import the data
- anoncodex = readtable(filename, opts);
- fnames = cellstr(anoncodex{:,1});
- ages = anoncodex{:,2};
- sex = anoncodex{:,3};
- ref1 = find(ages>7 & ages<=20);
- % BASIC EVALUATIONS
- fs1 = 250;
- [B,A] = butter(4, [1 64]./fs1, 'bandpass');
- r1 = fs1*5*60+1; r2 = r1+8*fs1-1;
- cc(1,:) = [1 0.25 0.25];
- cc(2,:) = [1 0.25 0.25];
- cc(3,:) = [1 0.25 0.25];
- cc(4,:) = [1 0.25 0.25];
- cc(5,:) = [0.1 0.6 1];
- cc(6,:) = [0.1 0.6 1];
- cc(7,:) = [0.1 0.6 1];
- cc(8,:) = [0.1 0.6 1];
- cc(9,:) = [0.85 0 0];
- cc(10,:) = [0.85 0 0];
- cc(11,:) = [0.85 0 0];
- cc(12,:) = [0.85 0 0];
- cc(13,:) = [0 0 0.96];
- cc(14,:) = [0 0 0.96];
- cc(15,:) = [0 0 0.96];
- cc(16,:) = [0 0 0.96];
- cc(17,:) = [0 0 0];
- cc(18,:) = [0 0 0];
- fr = [8 57 694 158];
- str{1} = 'Fp2-F4'; % Fp2-F4, Fp2-F4
- str{2} = 'F4-C4'; % F4-C4, F4-C4
- str{3} = 'C4-P4'; % C4-P4, C4-P4
- str{4} = 'P4-O2'; % P4-O2, P4-O2
- str{5} = 'Fp1-F3'; % Fp1-F3, Fp1-F3
- str{6} = 'F3-C3'; % F3-C3, F3-C3
- str{7} = 'C3-P3'; % C3-P3, C3-P3
- str{8} = 'P3-O1'; % P3-O1, P3-O1
- str{9} = 'Fp2-F8'; % Fp2-F8, Fp2-F8
- str{10} = 'F8-T4'; % F8-T4, F8-T8
- str{11} = 'T4-T6'; % T4-T6, T8-P8
- str{12} = 'T6-O2'; % T6-O2, P8-O2
- str{13} = 'Fp1-F7'; % Fp1-F7, Fp1-F7
- str{14} = 'F7-T3'; % F7-T3, F7-T7
- str{15} = 'T3-T5'; % T3-T5, T7-P7
- str{16} = 'T5-O1'; % T5-O1, P7-O1
- str{17} = 'Fz-Cz'; % Fz-Cz, Fz-Cz
- str{18} = 'Cz-Pz'; % Cz-Pz, Cz-Pz
- str{19} = 'ECG';
- % START PLOTTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- figure
- subplot(2,2,1); hold on
- [dat, hdr, label, fs, scle, offs] = read_edf(fnames{fr(1)});
- [data_bp_mont, ecg] = read_into_montage(dat, label, scle, fs, fs1, 0);
- dbp = filtfilt(B,A, data_bp_mont')';
- t = linspace(0,8, length(r1:r2));
- for jj = 1:18
- plot(t, dbp(jj,r1:r2)-jj*100, 'color', cc(jj,:))
- end
- plot(t, (ecg(r1:r2)-median(ecg(r1:r2)))./10-(jj+1)*100, 'Color', [0 0.6 0])
- set(gca, 'Ytick', [-1900:100:-100], 'Yticklabel', str(19:-1:1), 'Xticklabel', {})
- axis([0 8 -2000 0])
- set(gca, 'Position', [0.075 0.535 0.435 0.45], 'fontname', 'times', 'fontsize', 10)
- text(0.175, -150, 'A', 'BackgroundColor', [1 1 1], 'fontname', 'times', 'fontsize', 14)
- subplot(2,2,2); hold on
- [dat, hdr, label, fs, scle, offs] = read_edf(fnames{fr(2)});
- [data_bp_mont, ecg] = read_into_montage(dat, label, scle, fs, fs1, 0);
- dbp = filtfilt(B,A, data_bp_mont')';
- t = linspace(0,8, length(r1:r2));
- for jj = 1:18
- plot(t, dbp(jj,r1:r2)-jj*100, 'color', cc(jj,:))
- end
- plot(t, (ecg(r1:r2)-median(ecg(r1:r2)))./20-(jj+1)*100, 'Color', [0 0.6 0])
- set(gca, 'Ytick', [-1900:100:-100], 'Yticklabel', {}, 'Xticklabel', {})
- axis([0 8 -2000 0])
- set(gca, 'Position', [0.55 0.535 0.435 0.45], 'fontname', 'times', 'fontsize', 10)
- text(0.175, -150, 'B', 'BackgroundColor', [1 1 1], 'fontname', 'times', 'fontsize', 14)
- subplot(2,2,3); hold on
- [dat, hdr, label, fs, scle, offs] = read_edf(fnames{fr(3)});
- [data_bp_mont, ecg] = read_into_montage(dat, label, scle, fs, fs1, 0);
- dbp = filtfilt(B,A, data_bp_mont')';
- t = linspace(0,8, length(r1:r2));
- for jj = 1:18
- plot(t, dbp(jj,r1:r2)-jj*100, 'color', cc(jj,:))
- end
- plot(t, (ecg(r1:r2)-median(ecg(r1:r2)))./10-(jj+1)*100, 'Color', [0 0.6 0])
- set(gca, 'Ytick', [-1900:100:-100], 'Yticklabel', str(19:-1:1))
- axis([0 8 -2000 0])
- set(gca, 'Position', [0.075 0.075 0.435 0.45], 'fontname', 'times', 'fontsize', 10)
- xlabel('time (s)')
- text(0.175, -150, 'C', 'BackgroundColor', [1 1 1], 'fontname', 'times', 'fontsize', 14)
- subplot(2,2,4); hold on
- [dat, hdr, label, fs, scle, offs] = read_edf(fnames{fr(4)});
- [data_bp_mont, ecg] = read_into_montage(dat, label, scle, fs, fs1, 0);
- dbp = filtfilt(B,A, data_bp_mont')';
- t = linspace(0,8, length(r1:r2));
- for jj = 1:18
- plot(t, dbp(jj,r1:r2)-jj*100, 'color', cc(jj,:))
- end
- plot(t, (ecg(r1:r2)-median(ecg(r1:r2)))./10-(jj+1)*100, 'Color', [0 0.6 0])
- set(gca, 'Ytick', [-1900:100:-100], 'Yticklabel', {})
- axis([0 8 -2000 0])
- set(gca, 'Position', [0.55 0.075 0.435 0.45], 'fontname', 'times', 'fontsize', 10)
- xlabel('time (s)')
- text(0.175, -150, 'D', 'BackgroundColor', [1 1 1], 'fontname', 'times', 'fontsize', 14)
- plot([1.5 1.5 2.5], [-950 -1050 -1050], 'k', 'LineWidth', 1)
- % END PLOTTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % ECG ANALYSIS
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- filename = 'anon_codex_age_sex.csv';
- % Specify range and delimiter
- dataLines = [2, Inf];
- opts = delimitedTextImportOptions("NumVariables", 3);
- opts.DataLines = dataLines;
- opts.Delimiter = ",";
- opts.VariableNames = ["AnonFilename", "QuantizedAgeyears", "QuantizedSex"];
- opts.VariableTypes = ["string", "double", "categorical"];
- opts.ExtraColumnsRule = "ignore";
- opts.EmptyLineRule = "read";
- opts = setvaropts(opts, "AnonFilename", "WhitespaceRule", "preserve");
- opts = setvaropts(opts, ["AnonFilename", "QuantizedSex"], "EmptyFieldRule", "auto");
- % Import the data
- anoncodex = readtable(filename, opts);
- fnames = cellstr(anoncodex{:,1});
- ages = anoncodex{:,2};
- sex = anoncodex{:,3};
- % BASIC EVALUATIONS
- load('artefact_detection_models.mat');
- fs1 = 250; fs2 = 12; epl = 5*60*fs1; olap = 30*fs1;
- [Bn0,An0] = butter(4, 2*2/fs1, 'high');
- [Bn1,An1] = butter(2, 2*[48 52]/fs1 , 'stop');
- [Bn2,An2] = butter(2, 2*[98 102]/fs1 , 'stop');
- % CALCULATE HRV FEATURES FROM 5-minute epochs of ECG
- tadj = fs1*10; % correct for any poential end effects
- feat = cell(length(fnames),2);
- for ii = 1:length(fnames)
- ii
- [dat, hdr, label, fs, scle, offs] = read_edf(fnames{ii});
- [ecg, fs] = read_into_montage_ecg(dat, label, scle, fs);
- ecg = resample(ecg, fs1, fs);
- ecg = filtfilt(Bn1, An1, ecg); ecg = filtfilt(Bn2, An2, ecg); % notch at 50 notch at 100
- ecg = filtfilt(Bn0,An0, ecg);
- block_no = floor(length(ecg)/olap)-epl/olap+1; fts = NaN*ones(block_no,38);
- MM = (floor(length(ecg)/fs1/2))*2;
- flag1 = 0; flag2 = 0;
- fts = NaN*ones(block_no, 38); ag = NaN*ones(block_no,1);
- try
- for jj = 1:block_no
- r1 = (jj-1)*olap+1-tadj; r2 = r1+epl-1+2*tadj;
- if r1<1; r1 = 1; flag1 = 1; end; if r2>MM*fs1; r2 = MM*fs1; flag2 = 1; end
- ecg1 = ecg(r1:r2); ecg2 = ecg((jj-1)*olap+1:(jj-1)*olap+epl);
- if flag1 == 1; ecg1 = [zeros(1,tadj) ecg1]; end
- if flag2 == 1; ecg1 = [ecg1 zeros(1,tadj)]; end
- qts = quantile(ecg1, [0.01 0.99]); if abs(qts(1))>abs(qts(2)); ecg1 = -ecg1; end
- qts = quantile(ecg2, [0.01 0.99]); if abs(qts(1))>abs(qts(2)); ecg2 = -ecg2; end
- afts = calculate_features_ecg(ecg2, fs1);
- [~, out1] = predict(Mdl1, afts); [~, out2] = predict(Mdl2, afts); [~, out3] = predict(Mdl3, afts);
- if (out1(2) < 0) && (out2(2) < 0.5) && (out3(2) < 0)
- [~, rr, ~] = pan_tompkin_adapt(ecg1,fs1);
- rr(rr<=tadj)=0; rr(rr>=epl+tadj)=0;
- rr = rr(rr>0);
- if (length(rr)>200) && (length(rr)<900)
- fts(jj,:) = calculate_features_valid(rr, fs);
- ag(jj) = ages(ii);
- end
- end
- end
- feat{ii,1} = fts;
- feat{ii,2} = ag;
- catch
- end
- end
- save('ecg_features_online_data.mat', 'feat', '-v7.3');
- load('ecg_features_online_data.mat');
- % Find outliers
- fv1 = NaN*ones(length(feat), 38); fv2 = fv1; age = zeros(length(feat),1);
- for ii = 1:length(feat)
- fts = feat{ii,1};
- fv1(ii,:) = median(fts(1:2,:));
- fv2(ii,:) = median(fts(11:end,:));
- age(ii) = feat{ii,2}(1);
- end
- rf = find(~isnan(age) & ~isnan(sum(fv1'))' & ~isnan(sum(fv2'))');
- fv1 = fv1(rf,:);
- fv2 = fv2(rf,:);
- age = age(rf,:);
- rfs = zeros(1,length(fv1));
- for jj = 1:38
- y = fv1(:,jj); x = age;
- B = polyfit(x,y,2);
- res = y - polyval(B, x);
- dum = zeros(1, length(y)); dum(find(abs(res)>6*std(res)))=1;
- rfs = rfs+dum;
- y = fv2(:,jj); x = age;
- B = polyfit(x,y,2);
- res = y - polyval(B, x);
- dum = zeros(1, length(y)); dum(find(abs(res)>6*std(res)))=1;
- rfs = rfs+dum;
- end
- % remove outliers
- nref = find(rfs==0);
- fv1 = fv1(nref,:);
- fv2 = fv2(nref,:);
- age = age(nref);
- % TRAIN GPR age predictor - 5 fold CV 80:20 split
- pid_in1 = 1:length(fv1);
- pma_in1 = age;
- Mc = 5;
- out = zeros(1,1000);
- for qq = 1:1000
- rng(qq)
- pd = unique(pid_in1);
- y = cell(1,Mc);
- rx = ones(1,length(pd)); %rt = 1-rx; %rr = 1:length(pid);
- K = floor(length(pd)/Mc); dum = rem(length(pd), Mc);
- K = K.*ones(1,Mc); K(1:dum) = K(1)+1;
- for ii = 1:Mc
- rz = find(rx==1);
- dum = randsample(length(rz), K(ii), false);
- rx(rz(dum)) = 0;
- y{ii} = rz(dum);
- end
- y{end} = [y{end}' ; find(rx==1)']';
- for ii = 1:Mc
- y{ii} = pd(y{ii});
- end
- ss = cell(1, Mc);
- for ii = 1:Mc
- rf = y{ii};
- ag = [];
- for jj = 1:length(rf); ag = [ag pma_in1(find(pid_in1==rf(jj)))]; end
- ss{ii} = ag;
- end
- pv = zeros(1,6); c1 = 1;
- for ii = 1:Mc
- for jj = ii+1:Mc
- [~, pv(c1)] = kstest2(ss{ii}, ss{jj});
- c1 = c1+1;
- end
- end
- out(qq) = mean(pv);
- end
- nr = find(out==max(out)); % nr = 7
- rng(nr)
- yr = cell(1,Mc);
- rx = ones(1,length(pd)); %rt = 1-rx; %rr = 1:length(pid);
- for ii = 1:Mc
- rz = find(rx==1);
- dum = randsample(length(rz), K(ii), false);
- rx(rz(dum)) = 0;
- yr{ii} = rz(dum);
- end
- yr{end} = [yr{end}' ; find(rx==1)']';
- for ii = 1:Mc; yr{ii} = pd(yr{ii}); end
- pred1 = []; pred2 = []; agx = [];
- for ii = 1:Mc
- ii
- dum = zeros(1,length(fv1));
- dum(yr{ii})=1;
- r1 = find(dum==1); r2 = find(dum==0);
- rGP1 = fitrgp(fv1(r2,:), age(r2), 'BasisFunction', 'constant', 'KernelFunction', 'matern52', 'Standardize', true);
- out1 = predict(rGP1, fv1(r1,:));
- pred1 = [pred1 ; out1];
- rGP2 = fitrgp(fv2(r2,:), age(r2), 'BasisFunction', 'constant', 'KernelFunction', 'matern52', 'Standardize', true);
- out2 = predict(rGP1, fv2(r1,:));
- pred2 = [pred2 ; out2];
- agx = [agx ; age(r1)];
- end
- % START PLOTTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- figure;
- subplot(1,2,1)
- plot(agx, pred1 ,'.')
- title('Pre- N2 Onset')
- set(gca, 'FontName', 'times', 'Fontsize', 16)
- xlabel('Age (y)'); ylabel('Predicted Age (y)')
- grid on; hold on;
- plot([-2 18], [-2, 18], 'k')
- axis([-1 17 -1, 17])
- set(gca, 'position', [0.075 0.15 0.4 0.8], 'Xtick', [0:2:16], 'Ytick', [0:2:16])
- %text(0, 16, 'A', 'FontName', 'times', 'Fontsize', 14)
- pp = corr(agx(~isnan(agx)), pred1(~isnan(agx)));
- text(10, 2, ['r = ' num2str(pp, '%1.3f')], 'FontName', 'times', 'FontSize', 16)
- subplot(1,2,2)
- plot(agx, pred2 ,'.')
- title('Post- N2 Onset')
- set(gca, 'FontName', 'times', 'Fontsize', 16)
- xlabel('Age (y)'); ylabel('Predicted Age (y)')
- grid on; hold on;
- plot([-2 18], [-2, 18], 'k')
- axis([-1 17 -1, 17])
- set(gca, 'position', [0.575 0.15 0.4 0.8], 'Xtick', [0:2:16], 'Ytick', [0:2:16])
- %text(0, 16, 'B', 'FontName', 'times', 'Fontsize', 14)
- pp = corr(agx(~isnan(agx)), pred2(~isnan(agx)));
- text(10, 2, ['r = ' num2str(pp, '%1.3f')], 'FontName', 'times', 'FontSize', 16)
- % END PLOTTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % just artefact stuff
- filename = 'anon_codex_age_sex.csv';
- % Specify range and delimiter
- dataLines = [2, Inf];
- opts = delimitedTextImportOptions("NumVariables", 3);
- opts.DataLines = dataLines;
- opts.Delimiter = ",";
- opts.VariableNames = ["AnonFilename", "QuantizedAgeyears", "QuantizedSex"];
- opts.VariableTypes = ["string", "double", "categorical"];
- opts.ExtraColumnsRule = "ignore";
- opts.EmptyLineRule = "read";
- opts = setvaropts(opts, "AnonFilename", "WhitespaceRule", "preserve");
- opts = setvaropts(opts, ["AnonFilename", "QuantizedSex"], "EmptyFieldRule", "auto");
- % Import the data
- anoncodex = readtable(filename, opts);
- fnames = cellstr(anoncodex{:,1});
- ages = anoncodex{:,2};
- sex = anoncodex{:,3};
- % BASIC EVALUATIONS
- load('artefact_detection_models.mat');
- fs1 = 250; fs2 = 12; epl = 5*60*fs1; olap = epl;
- [Bn0,An0] = butter(4, 2*2/fs1, 'high');
- [Bnx,Anx] = butter(4, 1/fs1, 'high');
- [Bn1,An1] = butter(2, 2*[48 52]/fs1 , 'stop');
- [Bn2,An2] = butter(2, 2*[98 102]/fs1 , 'stop');
- W = floor(fs1/3);
- tadj = fs1*10; % correct for any poential end effects
- feat = cell(length(fnames),3);
- fband = [0.5 1 ; 1 3 ; 3 25 ; 25 125]; df = diff(fband');
- for ii = 1:length(fnames)
- ii
- [dat, hdr, label, fs, scle, offs] = read_edf(fnames{ii});
- [ecg, fs] = read_into_montage_ecg(dat, label, scle, fs);
- ecg = resample(ecg, fs1, fs);
- ecg = filtfilt(Bn1, An1, ecg); ecg = filtfilt(Bn2, An2, ecg); % notch at 50 notch at 100
- ecg0 = filtfilt(Bnx, Anx, ecg);
- ecg = filtfilt(Bn0,An0, ecg);
- block_no = floor(length(ecg)/olap)-epl/olap+1; fts = NaN*ones(block_no,38);
- MM = (floor(length(ecg)/fs1/2))*2;
- flag1 = 0; flag2 = 0;
- fts = NaN*ones(block_no, 38); ag = NaN*ones(block_no,1);
- try
- artx1 = []; artx2 = []; artx3 = []; c1 = 0;
- pow = zeros(block_no,4);
- for jj = 1:block_no
- r1 = (jj-1)*olap+1-tadj; r2 = r1+epl-1+2*tadj;
- if r1<1; r1 = 1; flag1 = 1; end; if r2>MM*fs1; r2 = MM*fs1; flag2 = 1; end
- ecg1 = ecg(r1:r2); ecg2 = ecg((jj-1)*olap+1:(jj-1)*olap+epl);
- %spectral_analysis
- [Pxx, f] = pwelch(ecg2, hamming(2^13), 2^12, 2^13, fs1);
- for qq = 1:4
- rf = find(f>=fband(qq,1) & f<fband(qq,2));
- pow(jj,qq) = sum(Pxx(rf))./df(qq);
- end
- if flag1 == 1; ecg1 = [zeros(1,tadj) ecg1]; end
- if flag2 == 1; ecg1 = [ecg1 zeros(1,tadj)]; end
- qts = quantile(ecg1, [0.01 0.99]); if abs(qts(1))>abs(qts(2)); ecg1 = -ecg1; end
- qts = quantile(ecg2, [0.01 0.99]); if abs(qts(1))>abs(qts(2)); ecg2 = -ecg2; end
- afts = calculate_features_ecg(ecg2, fs1);
- [~, out1] = predict(Mdl1, afts); [~, out2] = predict(Mdl2, afts); [~, out3] = predict(Mdl3, afts);
- if (out1(2) < 0) && (out2(2) < 0.5) && (out3(2) < 0)
- c1 = c1+1;
- [~, rr, ~, art1, art2, art3] = pan_tompkin_adapt_count_error(ecg1,fs1);
- artx1(c1,:) = art1;
- artx2(c1,:) = art2;
- if isempty(art3); artx3(c1,:) = [0 length(rr)]; else; artx3(c1,:) = [art3 length(rr)]; end
- end
- end
- feat{ii,1} = artx2; feat{ii,2} = artx3;
- feat{ii,3} = pow;
- catch
- end
- end
- save('artefact_features_online_data.mat', 'feat', '-v7.3');
- seg_out = []; nn_adj = []; flag_bad = zeros(length(feat),2); pow = [];
- for ii = 1:length(feat)
- A1 = size(feat{ii,3}); A2 = size(feat{ii,2});
- if isempty(feat{ii,2})
- flag_bad(ii,:) = [A1(1) 0];
- else
- flag_bad(ii,:) = [A1(1) A2(1)];
- end
- dum = feat{ii,1};
- if ~isempty(dum)
- dum(isnan(dum(:,2)),2) = 0;
- seg_out = [seg_out ; dum];
- nn_adj = [nn_adj ; feat{ii,2}];
- end
- pow = [pow; feat{ii,3}];
- end
quality_assesssment_for_github.m at commit 5619620, under MIT · at the source
Overview
- Brain Modelling Group, QIMR Berghofer,Brisbane, Australia
- Clinical Neurophysiology, New Children’s Hospital, Helsinki University Hospital and University of Helsinki,Helsinki, Finland
- Paediatric Research Center, New Children’s Hospital, Helsinki University Hospital,Helsinki, Finland
- BABA Center, Department of Physiology, University of Helsinki,Helsinki, Finland
Abstract
Paediatric brain activity can be measured effectively during light sleep; a vigilance state that manifests with similar phenomenology on the EEG across childhood. Here, we describe a curated dataset of EEG and ECG recordings from 1032 subjects from 2 months to 16 years of age (Helsinki Kids 1 K – HK1K). All subjects had age-appropriate EEG and ECG recordings, along with typical neurodevelopment, as confirmed by a clinical review of their medical records over the four years following the recording. These data can be used to define normative ranges of paediatric EEG/
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 9 matches between paragraphs and lines of code.
nstevensonUH/EEG_release_supporting_code
56196206b14d9d100f88a428efd65c73ea1e3b40, 15 October 2025Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
35 files
- anonymize_dataset_for_gi
thub.m , MATLAB, 169 lines, 1 match - quality_assesssment_for_
github.m , MATLAB, 897 lines, 5 matches - subfunctions/
CondEn.m , MATLAB, 39 lines - subfunctions/
FuzzyEn.m , MATLAB, 73 lines - subfunctions/
GetGH.m , MATLAB, 114 lines - subfunctions/
Higuchi1Dn.m , MATLAB, 82 lines - subfunctions/
PLmeasure.m , MATLAB, 75 lines - subfunctions/
PermEn.m , MATLAB, 87 lines - subfunctions/
SampEn.m , MATLAB, 47 lines - subfunctions/
ShannonEn.m , MATLAB, 75 lines - subfunctions/
binary_seq_to_string.m , MATLAB, 30 lines - subfunctions/
calc_lz_complexity.m , MATLAB, 341 lines - subfunctions/
calculate_features_valid , MATLAB, 45 lines.m - subfunctions/
estimate_hurst_exponent. , MATLAB, 57 linesm - subfunctions/
get_fts.m , MATLAB, 14 lines - subfunctions/
get_spectra.m , MATLAB, 35 lines - subfunctions/
linplot.m , MATLAB, 24 lines - subfunctions/
lognorm.m , MATLAB, 7 lines - subfunctions/
multiscale_entropy.m , MATLAB, 13 lines - subfunctions/
nlin_energy.m , MATLAB, 15 lines - subfunctions/
noise_floor.m , MATLAB, 22 lines - subfunctions/
pan_tompkin.m , MATLAB, 393 lines - subfunctions/
pan_tompkin_adapt.m , MATLAB, 428 lines - subfunctions/
pan_tompkin_adapt_count_ , MATLAB, 434 lineserror.m - subfunctions/
per_ha_art.m , MATLAB, 10 lines - subfunctions/
poincare.m , MATLAB, 18 lines - subfunctions/
read_edf.m , MATLAB, 82 lines - subfunctions/
read_into_montage.m , MATLAB, 100 lines, 2 matches - subfunctions/
read_into_montage_ecg.m , MATLAB, 28 lines - subfunctions/
rr_count.m , MATLAB, 16 lines - subfunctions/
single_channel_features. , MATLAB, 177 lines, 1 matchm - subfunctions/
tf_correlation.m , MATLAB, 77 lines - subfunctions/
write_edf.m , MATLAB, 52 lines - LICENSE, License, 21 lines
- README.md, Text, 13 lines
sccn.ucsd.edu/eeglab/index.php
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
Code availability
MATLAB code that assists in accessing the EEG and ECG recordings within this dataset, and reproduces all analyses undertaken in this data descriptor, is available on Github (https://
Reproduced under the paper's license (CC BY), from the paper cited above.
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:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 33 scripts, each with its path and the digest of its content;
- 9 matches 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
- zenodo:17138538, at Zenodo; found in DataCite
- zenodo:17138539, at Zenodo; found in “Data availability”
Data availability
The dataset is freely available to access at Zenodo (10.5281/
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 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 10 MeSH terms, 2 funders, 15 references.
Cite
This paper
Stevenson, N. J., Iyer, K. K., Roberts, J. A., Ahtola, E., Lauronen, L., & Vanhatalo, S. (2026). A dataset of EEG and ECG recordings around the onset of NREM sleep from infancy to adolescence. Scientific data, 13(1), 1018. https://
BibTeX
@article{stevenson2026da
author = {Stevenson, Nathan J. and Iyer, Kartik K. and Roberts, James A. and Ahtola, Eero and Lauronen, Leena and Vanhatalo, Sampsa},
title = {{A dataset of EEG and ECG recordings around the onset of NREM sleep from infancy to adolescence}},
journal = {Scientific data},
year = {2026},
month = may,
volume = {13},
number = {1},
pages = {1018},
publisher = {Nature Publishing Group},
issn = {2052-4463},
doi = {10.1038/
url = {https://
pmid = {42086555},
pmcid = {PMC13350081}
}
RIS
TY - JOUR
AU - Stevenson, Nathan J.
AU - Iyer, Kartik K.
AU - Roberts, James A.
AU - Ahtola, Eero
AU - Lauronen, Leena
AU - Vanhatalo, Sampsa
TI - A dataset of EEG and ECG recordings around the onset of NREM sleep from infancy to adolescence
T2 - Scientific data
J2 - Sci Data
PY - 2026
DA - 2026/
VL - 13
IS - 1
SP - 1018
SN - 2052-4463
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "A dataset of EEG and ECG recordings around the onset of NREM sleep from infancy to adolescence",
"container-title": "Scientific data",
"author": [
{
"family": "Stevenson",
"given": "Nathan J."
},
{
"family": "Iyer",
"given": "Kartik K."
},
{
"family": "Roberts",
"given": "James A."
},
{
"family": "Ahtola",
"given": "Eero"
},
{
"family": "Lauronen",
"given": "Leena"
},
{
"family": "Vanhatalo",
"given": "Sampsa"
}
],
"container-title-short":
"volume": "13",
"issue": "1",
"page": "1018",
"DOI": "10.1038/
"PMID": "42086555",
"PMCID": "PMC13350081",
"ISSN": "2052-4463",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
5
]
]
}
}
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.1016/j.ebiom.2024.105061 [code]
- A growth chart of brain function from infancy to adolescence based on EEG.Journal: EBioMedicineIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, Zenodo 17138538, Zenodo 17138539, EEG, 3 references
- [2] doi:10.1038/s41598-025-25482-7 [code]
- Decoding brain age predictions from sleep electroencephalography across infancy to adolescence.Journal: Scientific reportsIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, EEG, 3 references
- [3] 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, 2 references
- [4] doi:10.1016/j.clinph.2023.11.007 [code]
- Sensory event-related potential morphology predicts age in premature infants.Journal: Clinical neurophysiology : official journal of the International Federation of Clinical NeurophysiologyIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, EEG, 1 reference
- [5] doi:10.3390/bios16010056 [code]
- Modulation-Based Feature Extraction for Robust Sleep Stage Classification Across Apnea-Based Cohorts.Journal: BiosensorsIn common: Signal Processing Toolbox, methods / tools, EEG, 1 reference
- [6] doi:10.1162/imag_a_00189 [code]
- Do try this at home: Age prediction from sleep and meditation with large-scale low-cost mobile EEG.Journal: Imaging neuroscience (Cambridge, Mass.)In common: EEG, 2 references
- [7] doi:10.1093/gigascience/giaf060 [code]
- A Case for estradiol: younger brains in women with earlier menarche and later menopause.Journal: GigaScienceIn common: Statistics and Machine Learning Toolbox, 2 references
- [8] doi:10.1002/hbm.70096 [code]
- Predicting Subject Traits From Brain Spectral Signatures: An Application to Brain Ageing.Journal: Human brain mappingIn common: EEG, 2 references
- [9] doi:10.1016/j.clinph.2024.05.002 [code]
- Resting state electroencephalographic brain activity in neonates can predict age and is indicative of neurodevelopmental outcome.Journal: Clinical neurophysiology : official journal of the International Federation of Clinical NeurophysiologyIn common: Statistics and Machine Learning Toolbox, EEG, 1 reference
- [10] doi:10.1038/s42003-025-08685-6 [code]
- Dynamic brain-heart interaction in sleep characterized by variational phase-amplitude coupling framework.Journal: Communications biologyIn common: Signal Processing Toolbox, EEG, 1 reference
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: 2 repositories of the authors' code, each at its verified commit and with its license, 33 scripts, and 9 matches 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:52386601135d7aa9…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41597-026-07356-3)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41597-026-07356-3.svg
:target: https://openscicode.org/badge/doi/10.1038/s41597-026-07356-3
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41597-026-07356-3"><img src="https://openscicode.org/badge/doi/10.1038/s41597-026-07356-3.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
