meanap.pipeline.spreadsheet¶
Read the recording list spreadsheet, mirroring pipelineReadCSV.m.
Functions
|
Zero out spike times for channels listed in |
|
Parse a recording's |
|
Parse a range like |
|
Read the recording list CSV. |
Classes
|
- class meanap.pipeline.spreadsheet.RecordingInfo(filename: 'str', div: 'float', group: 'str', ground: 'str | None' = None)[source]¶
Bases:
object- Parameters:
filename (str)
div (float)
group (str)
ground (str | None)
- div: float¶
- filename: str¶
- ground: str | None = None¶
- group: str¶
- meanap.pipeline.spreadsheet.ground_spike_times_dict(spike_times_dict, channels, ground_electrodes)[source]¶
Zero out spike times for channels listed in
ground_electrodes(matched by channel ID/name — MATLAB’s defaultParams.electrodesToGroundPerRecordingUseName = 1behavior, the only mode this port supports), port ofgroundSpikeTimes.m.spike_times_dictmaps 0-indexed channel position (matchingchannels[i]’s position) to that channel’s spike times for a single already-selected detection method — the shape this is called with instep2.py/step3.py/step4.py.- Parameters:
spike_times_dict (dict[int, ndarray])
channels (ndarray)
ground_electrodes (set[int] | None)
- Return type:
dict[int, ndarray]
- meanap.pipeline.spreadsheet.parse_ground_electrodes(ground)[source]¶
Parse a recording’s
Groundspreadsheet value (comma-separated channel IDs) into a set of ints, port ofgroundSpikeTimes.m’s electrode-list parsing. ReturnsNoneif there’s nothing to ground — including pandas turning an empty cell into the string"nan", whichread_recording_csvdoesn’t special-case (it just callsstr()on whatever pandas gives it).- Parameters:
ground (str | None)
- Return type:
set[int] | None
- meanap.pipeline.spreadsheet.parse_spreadsheet_range(range_str)[source]¶
Parse a range like
'A2:A3'or'2:1000'into 1-indexed (start_line, end_line).Line numbers count the header as line 1, matching MATLAB’s
DataLines/csvRangeconvention (e.g.[2, 3]reads the first two data rows after the header).- Parameters:
range_str (str)
- Return type:
tuple[int, int]
- meanap.pipeline.spreadsheet.read_recording_csv(path, spreadsheet_range)[source]¶
Read the recording list CSV.
Expects columns: Recording Filename, DIV group, Genotype, [Ground].
- Parameters:
path (str | Path)
spreadsheet_range (str)
- Return type:
list[RecordingInfo]