Skip to content

Commit

Permalink
cleaner qm names
Browse files Browse the repository at this point in the history
  • Loading branch information
luiztauffer committed Mar 28, 2024
1 parent 3639897 commit dfcff34
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
35 changes: 15 additions & 20 deletions common/processor_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,21 @@ def run_pipeline(context: PipelineFullContext):
run_postprocessing = context.run_postprocessing
postprocessing_params = context.postprocessing_context.model_dump()
qm_list = list()
if postprocessing_params['quality_metrics'].pop('presence_ratio'):
qm_list.append('presence_ratio')
if postprocessing_params['quality_metrics'].pop('snr'):
qm_list.append('snr')
if postprocessing_params['quality_metrics'].pop('isi_violation'):
qm_list.append('isi_violation')
if postprocessing_params['quality_metrics'].pop('rp_violation'):
qm_list.append('rp_violation')
if postprocessing_params['quality_metrics'].pop('sliding_rp_violation'):
qm_list.append('sliding_rp_violation')
if postprocessing_params['quality_metrics'].pop('amplitude_cutoff'):
qm_list.append('amplitude_cutoff')
if postprocessing_params['quality_metrics'].pop('amplitude_median'):
qm_list.append('amplitude_median')
if postprocessing_params['quality_metrics'].pop('nearest_neighbor'):
qm_list.append('nearest_neighbor')
if postprocessing_params['quality_metrics'].pop('nn_isolation'):
qm_list.append('nn_isolation')
if postprocessing_params['quality_metrics'].pop('nn_noise_overlap'):
qm_list.append('nn_noise_overlap')
qm_names = [
'presence_ratio',
'snr',
'isi_violation',
'rp_violation',
'sliding_rp_violation',
'amplitude_cutoff',
'amplitude_median',
'nearest_neighbor',
'nn_isolation',
'nn_noise_overlap'
]
for qm_name in qm_names:
if postprocessing_params['quality_metrics'].pop(qm_name):
qm_list.append(qm_name)
postprocessing_params['quality_metrics']['metric_names'] = qm_list

# Curation params
Expand Down
4 changes: 3 additions & 1 deletion si_mountainsort5/sample_context_1.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# https://api.dandiarchive.org/api/dandisets/000409/versions/draft/assets/c04f6b30-82bf-40e1-9210-34f0bcd8be24/
input: https://dandiarchive.s3.amazonaws.com/blobs/2dd/3a3/2dd3a3b3-7ede-4f2b-a327-5c81bf5718da
output: ./output/sorting_upload.nwb
job_kwargs:
n_jobs: 0.7
recording_context:
electrical_series_path: /acquisition/ElectricalSeriesAp
lazy_read_input: true
stub_test: true
stub_test_duration_sec: 30
stub_test_duration_sec: 10
run_preprocessing: true
preprocessing_context:
motion_correction:
Expand Down

0 comments on commit dfcff34

Please sign in to comment.