Complete up-to-date analysis is available here.
The Jupyter notebooks (under the notebooks
directory) are used primarily for algorithm and method
development and usually include runs for a single sample. After, the finalized algorithms
are moved to the pipeline (to the R
or python
directories) and are used for all samples.
While I try to rerun the notebooks for all changes, sometimes the notebooks may not be up-to-date.
Please see the docs
directory or the deployed website
for the most recent results.
The data should be available under the raw
directory in this repository root (create a symbolic link).
- Install conda and mamba. Create the snakemake (
env/snakemake.yml
) conda environment (required to run the analysis) and the spontaneous-movement-mne (env/mne.yml
) conda environment (required to generate the reports).
# In macOS M2
export CONDA_SUBDIR=osx-arm64
mamba env create -f env/snakemake.yml
mamba env create -f env/mne.yml
- Activate the snakemake environment.
conda activate snakemake
- Run
snakemake
:
snakemake --conda-frontend mamba --use-conda --rerun-triggers mtime params --cores 1 -p all
- correlation peak (when? / per cell)
- statistical test on 0 / max timepoint (mean per cell) (compare different groups, e.g. L2/3 vs L5, S1 vs M1)
- emg detection with 10th percentile + compare with TKEO
- high pass filter (2 Hz) - average abs EMG on detected events
Use movements detected with 10th upper percentile method. Do not filter out any detected episodes for now.
- show that correlation is different from zero
- color by cortex in correlation plots
- detect EMG off
- What is happening in W3? How to filter out the heartbeat?
- Add counts of EMG on / off in the report (number of events, total time)
- AP detection (90 percentile?)
- filter out false positives!
- vm report html
- compare movement on/off
- number of episodes
- episode length
- mean vm
- vm sd
- AP
- correlation report html
To discuss
- Filtering had to be changed because heart beat was disturbing to the rest period detection. In some cases, it
still is, and I am not sure how to get rid of it.
- Few samples have very low number of rest episodes (e.g. W2 C3 S1 L23).
- Decided to use differential analysis for detection of action potentials (90th percentile and any average-like
methods will likely introduce a lot of false positives).
- AP detection: the hell happened in W4 C15 (S1 L5)?
- Why does the Vm continuously grow over time in some samples (e.g. W4 C11 S1 L5)? Is this some unwanted effect which should be corrected for?
- Combining S1 layers into a single group seems counter-productive since there are significant differences in the correlation patterns between the layers L2/3 and L5 of S1 (not seen in M1, though).
- Fix correlation report (max corr, non absolute for test)
- Use low-pass filtered data for movement / rest episode detection
- Do any movement / rest episodes overlap?
- Fix statistics in the movement vs rest comparison report (need to correct for time)
- Vm methods (filtering + AP detection)
To discuss
- Detection of movement / rest episodes was performed using the low-pass filtered EMG data. Included a check to make sure none of detected movement and rest episodes overlap.
- Fitted more complex models that account for episode length and episode onset time. Is this enough to account for the effect seen in continuous membrane potential increase? Or should I still cut and remove the data?
- kursinio planas
- pretty graph with all samples to show that EMG onset is good
- EMG event filtering (min time: 0.5 s, 400ms offset, 400ms onset)
- Add figure 3 from the previous analysis
- frequency analysis (movement on / movement off): 2-100 Hz, >=0.5s
- compare conductance during on/off
- add method descriptions to reports
- index (how to use the website)
- correlation analysis
- EMG (filtering + movement detection)
To look into
- AP detection in some files is suspicious (e.g. S1 L23 W1 C8). Seems like some APs are detected twice?