This code base is using the Julia Language and DrWatson to make a reproducible scientific project named
NeonateTriCorr
To (locally) reproduce this project, do the following:
- Download this code base. Notice that raw data are typically not included in the git-history and may need to be downloaded independently.
- Open a Julia console and do:
julia> using Pkg julia> Pkg.add("DrWatson") # install globally, for using `quickactivate` julia> Pkg.activate("path/to/this/project") julia> Pkg.instantiate()
This will install all necessary packages for you to be able to run the scripts and everything should work out of the box, including correctly finding local paths.
To obtain triple correlations of recordings from the Helsinki dataset use the following steps. Generally, for scripts ending in .jl
, the instruction "run X.jl
" means "type include("path/to/X.jl")
." Best practice is to run Y/X.jl
as include(scriptsdir("Y","X.jl"))
.
- Activate this project (such as by typing
Pkg.activate("path/to/this/project")
) - Download patient recordings with
download_helsinki_eegs(patient_numbers::Vector{Int})
- Set
PAT
to be the number of a downloaded patient (PAT=X
), and then runcontributions_timeseries/contributions_patPAT.jl
(alternatively: runcontributions_patPAT_artifacts.jl
to obtain triple correlation for all timepoints, including those annotated as artifacts). I typically ran this using SLURM on a cluster, so that the contributions were computed in parallel jobs. - To compare the differences between seizure and non-seizure epochs, run
reanalysis/diffs_motifs.jl
(alternatively: with_artifacts
suffix). - To attempt to detect seizures, run
reanalysis/detect_seizures_motif_0.jl
. - Repeat the previous two steps with
diffs_aeeg.jl
anddetect_seizures_aeeg.jl
respectively to run the same analyses on aEEG-transformed recordings.
To reproduce the figures, first follow steps 0-2 of the Data Pipeline instructions above. Then the scripts/figures
scripts will reproduce all figures except the first (which resulted from plotting snippets of preprocessed EEG loaded using the load_helsinki_eeg
function, exported, and then imported to MATLAB).