Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install package
run: |
pip install -e .

- name: Run tests
run: |
pytest tests/ -v

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"python-envs.defaultEnvManager": "ms-python.python:conda",
"python-envs.defaultPackageManager": "ms-python.python:conda",
"python-envs.pythonProjects": []
}
22 changes: 1 addition & 21 deletions LFPAnalysis/lfp_preprocess_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,15 +1573,6 @@ def load_elec(elec_path=None, site='MSSM'):
elec_data['manual'][elec_data['Notes'].str.lower().str.contains('cyst', na=False)] = 'oob'
elec_data['manual'][elec_data['Notes'].str.lower().str.contains('bad', na=False)] = 'oob'










return elec_data

def make_mne_scalp(load_path=None, overwrite=True, return_data=False):
Expand All @@ -1605,17 +1596,6 @@ def make_mne_scalp(load_path=None, overwrite=True, return_data=False):
whether to overwrite existing data for this person if it exists
return_data: bool
whether to actually return the data or just save it in the directory
eeg_names : list
list of channel names that pertain to scalp EEG in case the hardcoded options don't work
resp_names : list
list of channel names that pertain to respiration in case the hardcoded options don't work
ekg_names : list
list of channel names that pertain to the EKG in case the hardcoded options don't work
sync_name : str
provide the sync name in case the hardcoded options don't work
sync_type : str
what type of sync signal was used? options: ['photodiode', 'audio', 'ttl']

Returns
-------
mne_data : mne object
Expand Down Expand Up @@ -2515,7 +2495,7 @@ def compute_and_baseline_tfr(baseline_event, task_events, freqs, n_cycles, load_

iteration +=1

zpow = mne.time_frequency.EpochsTFR(event_epochs_reref.info, baseline_corrected_power,
zpow = mne.time_frequency.EpochsTFRArray(event_epochs_reref.info, baseline_corrected_power,
temp_pow.times, freqs)

zpow.metadata = event_epochs_reref.metadata
Expand Down
29 changes: 27 additions & 2 deletions LFPAnalysisBook/module-01-00_BroadIntroduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,37 @@ messing around with the code contained herein.

[The origin of extracellular fields and currents — EEG, ECoG, LFP and spikes](https://www.nature.com/articles/nrn3241)


[Advances in human intracranial electroencephalography research, guidelines and good practices](https://pubmed.ncbi.nlm.nih.gov/35792291/)

[A tutorial review of functional connectivity analysis methods and their interpretational pitfalls](https://www.frontiersin.org/journals/systems-neuroscience/articles/10.3389/fnsys.2015.00175/full)

## Video resources:

[Mike X. Cohen describes time-frequency analyses in detail](https://www.youtube.com/watch?v=7ahrcB5HL0k&list=PLn0OLiymPak2BYu--bR0ADNBJsC4kuRWs)

## Introductory Videos

[Origin of EEG](https://youtu.be/Bmt89hHyxuM?si=fwcztI_cjwQ4fbyD)

[Preprocessing basics](https://youtu.be/JMB9nZNGVyk?si=mg-VddKF-ZqNq6WH)

[Time-domain (ERP)](https://youtu.be/iFWrVzLYop0?si=jgSZk5UQguJGt9PR)

[Rhythm-based analyses](https://youtu.be/3hk4z3yrMzk?si=stSIsMaZH9vW3Ipg)

[Interpreting time-frequency plots](https://youtu.be/s2MfmIx8wv4?si=7th8mEBbga4a0bE5)

## Basic coding practice:

[Python Novice Inflammation (Software Carpentry)](https://swcarpentry.github.io/python-novice-inflammation/)

[Python Novice Gapminder (Software Carpentry)](https://swcarpentry.github.io/python-novice-gapminder/)

[Case Studies in Python (Mark Kramer)](https://mark-kramer.github.io/Case-Studies-Python/01.html)

## Statistics resources (not Python):

[Introduction to Statistics (Statsthinking21)](https://statsthinking21.github.io/statsthinking21-core-site/)


## Code resources:

Expand All @@ -29,6 +52,8 @@ The material in this JupyterBook will be most easily consumed if you have alread

[Writing good research code](https://goodresearch.dev/)

[More advanced practice for data analysis](https://neuraldatascience.io/intro.html)


<!-- Whether you write your book's content in Jupyter Notebooks (`.ipynb`) or
in regular markdown files (`.md`), you'll write in the same flavor of markdown
Expand Down
2 changes: 0 additions & 2 deletions LFPAnalysisBook/module-01-01_LFPAnalysisIntroduction copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ The LFPAnalysis codebase is meant to help you get data from its raw, recorded fo

You can find installation instructions here: [Repository](https://github.com/seqasim/LFPAnalysis).



Loading
Loading