Skip to content

Commit 92765f7

Browse files
Integrating Taylor's changes for HPC
1 parent 2e25cd6 commit 92765f7

File tree

8 files changed

+18
-137
lines changed

8 files changed

+18
-137
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Please find the full documentation at
3737

3838
## ▶️ Running the pyLossless Pipeline
3939
Below is a minimal example that runs the pipeline one of MNE's sample files.
40-
```
40+
```python
4141
import pylossless as ll
4242
import mne
4343
fname = mne.datasets.sample.data_path() / 'MEG' / 'sample' / 'sample_audvis_raw.fif'
@@ -51,16 +51,23 @@ pipeline.run_with_raw(raw)
5151
```
5252

5353
Once it is completed, You can see what channels and times were flagged:
54-
```
54+
```python
5555
print(pipeline.flagged_chs)
5656
print(pipeline.flagged_epochs)
5757
```
5858

59-
Once you are ready, you can save your file:
60-
```
59+
Once you are ready, you can save your file in its lossless state:
60+
```python
6161
pipeline.save(pipeline.get_derivative_path(bids_path), overwrite=True)
6262
```
6363

64+
To get a **cleaned** version, you can use a `RejectionPolicy` object to apply
65+
these annotations to your raw object. This is a lossy operation:
66+
```python
67+
rejection_policy = ll.RejectionPolicy()
68+
cleaned_raw = rejection_policy.apply(pipeline)
69+
```
70+
6471
## 👩‍💻 Dashboard Review
6572
[![Open in Colab](https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/github/lina-usc/pylossless/blob/main/notebooks/qc_example.ipynb)
6673

@@ -99,7 +106,7 @@ pip install --no-index xarray
99106
pip install --no-index pyyaml
100107
pip install --no-index sklearn
101108
pip install mne_bids
102-
pip install EDFlib-Python
109+
pip install edfio
103110
pip install openneuro-py
104111

105112
# Clone down mne-iclabel and switch to the right version and install it locally

pylossless/assets/ll_default_config_adults.yaml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,6 @@ project:
2424
EEGCoordinateSystem: Other
2525
EEGCoordinateUnits: metres
2626

27-
general_info:
28-
authors: [Unspecified]
29-
institution_Name: Unspecified
30-
institution_address: Unspecified
31-
dataset_doi: []
32-
funding: Unspecified
33-
how_to_acknowledge: tba
34-
license: ""
35-
name: Unspecified
36-
references_and_links: []
37-
38-
t_info:
39-
EEG_placement_scheme: EGI 129
40-
cap_manufacturer: EGI
41-
cap_manufacturers_model_name: Hydrocel 129 Channel
42-
hardware_filters: n/a
43-
manufacturer: Electrical Geodesics
44-
manufacturers_model_name: NetAmps300
45-
power_line_frequency: 60
46-
software_filters: n/a
47-
software_versions: NetStation V4.5
48-
4927
######################## Task break detection ########################
5028
# See arguments definition from mne.preprocessing.annotate_breaks
5129
find_breaks:
@@ -69,19 +47,6 @@ filtering:
6947
notch_filter_args:
7048
freqs: [60]
7149

72-
############################## SLURM #################################
73-
# Options for running the pipeline on a cluster
74-
# through SLURM
75-
slurm_options:
76-
account: def-emayada
77-
job_name: pylossless
78-
memory: 16g
79-
mpi: false
80-
num_tasks: 1
81-
program_options: []
82-
threads_per_task: []
83-
time_limit: 2h
84-
8550
########################## Nearest neighbor ##########################
8651
nearest_neighbors:
8752
n_nbr_ch: 3

pylossless/assets/ll_default_config_infants.yaml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,6 @@ project:
2424
EEGCoordinateSystem: Other
2525
EEGCoordinateUnits: metres
2626

27-
general_info:
28-
authors: [Unspecified]
29-
institution_Name: Unspecified
30-
institution_address: Unspecified
31-
dataset_doi: []
32-
funding: Unspecified
33-
how_to_acknowledge: tba
34-
license: ""
35-
name: Unspecified
36-
references_and_links: []
37-
38-
t_info:
39-
EEG_placement_scheme: EGI 129
40-
cap_manufacturer: EGI
41-
cap_manufacturers_model_name: Hydrocel 129 Channel
42-
hardware_filters: n/a
43-
manufacturer: Electrical Geodesics
44-
manufacturers_model_name: NetAmps300
45-
power_line_frequency: 60
46-
software_filters: n/a
47-
software_versions: NetStation V4.5
48-
4927
######################## Task break detection ########################
5028
# See arguments definition from mne.preprocessing.annotate_breaks
5129
find_breaks:
@@ -69,19 +47,6 @@ filtering:
6947
notch_filter_args:
7048
freqs: []
7149

72-
############################## SLURM #################################
73-
# Options for running the pipeline on a cluster
74-
# through SLURM
75-
slurm_options:
76-
account: def-emayada
77-
job_name: pylossless
78-
memory: 16g
79-
mpi: false
80-
num_tasks: 1
81-
program_options: []
82-
threads_per_task: []
83-
time_limit: 2h
84-
8550
########################## Nearest neighbor ##########################
8651
nearest_neighbors:
8752
n_nbr_ch: 3

pylossless/assets/test_data/sub-s01/eeg/sub-s01_task-faceO_ll_config.yaml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -92,38 +92,8 @@ project:
9292
coordsys:
9393
EEGCoordinateSystem: Other
9494
EEGCoordinateUnits: metres
95-
general_info:
96-
authors:
97-
- Q1K Neuroimaging group
98-
dataset_doi: []
99-
funding: Azrieli Foundationt
100-
how_to_acknowledge: tba
101-
institution_Name: McGill University
102-
institution_address: 3775 Rue University, Montreal, QC
103-
license: ''
104-
name: Q1K Mismatched Negativity
105-
references_and_links: []
10695
readme: '# Q1K ACAR Dataset'
10796
set_montage_kwargs: {}
108-
t_info:
109-
EEG_placement_scheme: EGI 129
110-
cap_manufacturer: EGI
111-
cap_manufacturers_model_name: Hydrocel 129 Channel
112-
hardware_filters: n/a
113-
manufacturer: Electrical Geodesics
114-
manufacturers_model_name: NetAmps300
115-
power_line_frequency: 60
116-
software_filters: n/a
117-
software_versions: NetStation V4.5
11897
ref_loc_file: derivatives/EEG-IP-L/code/misc/standard_1020_ll_ref19.elc
11998
save_f_res: 1
120-
sd_t_pad: 1
121-
slurm_options:
122-
account: def-emayada
123-
job_name: pylossless
124-
memory: 16g
125-
mpi: false
126-
num_tasks: 1
127-
program_options: []
128-
threads_per_task: []
129-
time_limit: 2h
99+
sd_t_pad: 1

pylossless/assets/test_data/sub-s02/eeg/sub-s02_task-faceO_ll_config.yaml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,38 +92,8 @@ project:
9292
coordsys:
9393
EEGCoordinateSystem: Other
9494
EEGCoordinateUnits: metres
95-
general_info:
96-
authors:
97-
- Q1K Neuroimaging group
98-
dataset_doi: []
99-
funding: Azrieli Foundationt
100-
how_to_acknowledge: tba
101-
institution_Name: McGill University
102-
institution_address: 3775 Rue University, Montreal, QC
103-
license: ''
104-
name: Q1K Mismatched Negativity
105-
references_and_links: []
10695
readme: '# Q1K ACAR Dataset'
10796
set_montage_kwargs: {}
108-
t_info:
109-
EEG_placement_scheme: EGI 129
110-
cap_manufacturer: EGI
111-
cap_manufacturers_model_name: Hydrocel 129 Channel
112-
hardware_filters: n/a
113-
manufacturer: Electrical Geodesics
114-
manufacturers_model_name: NetAmps300
115-
power_line_frequency: 60
116-
software_filters: n/a
117-
software_versions: NetStation V4.5
11897
ref_loc_file: derivatives/EEG-IP-L/code/misc/standard_1020_ll_ref19.elc
11998
save_f_res: 1
12099
sd_t_pad: 1
121-
slurm_options:
122-
account: def-emayada
123-
job_name: pylossless
124-
memory: 16g
125-
mpi: false
126-
num_tasks: 1
127-
program_options: []
128-
threads_per_task: []
129-
time_limit: 2h

pylossless/pipeline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ def _repr_html_(self):
509509
"Noisy": ch_flags.get("noisy", None),
510510
"Bridged": ch_flags.get("bridged", None),
511511
"Uncorrelated": ch_flags.get("uncorrelated", None),
512+
"Rank": ch_flags.get("rank", None),
512513
}
513514
html += _create_html_details("Flagged Channels", flagged_channels_data)
514515

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ mne_bids>=0.14
44
pandas
55
xarray
66
scipy>=1.7.1
7-
mne_icalabel>=0.5.0
7+
mne_icalabel>=0.6.0
88
pyyaml
99
scikit-learn
10+
torch
11+
edfio

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@
4343
extras_require=extras_require,
4444
include_package_data=True,
4545
entry_points={"console_scripts": qc_entry_point},
46+
dependency_links=['https://download.pytorch.org/whl/cpu'],
4647
)

0 commit comments

Comments
 (0)