SpikeInterface / SpikeInterface/spikeinterface
How to concatenate several neuropixels recording from SpikeGLX, especially the ap.meta, nidq.bin and nidq.meta file?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 847
- Forks
- 280
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 29
Description
Hi there,
I have used spikeInterface to concatenate three sessions recorded in the same day using NPX2 via SpikeGLX.
But I am a bit clue less about how to handle the ap.meta file.
I have tried to load the concatenated ap.bin file via read_spikeglx, but the traces looks quite weird.
If I use read_binary instead, the concatenated traces looks identical when I load the first trial of the recording using read_spikeglx.
There are some gap of time between each recordings, I manually save the ap.meta file by changing the
I want to keep the firstSample in the concatenated file as the same as in the first recording, so I can have absolute timestamps for all the recording, and for later synchronize with behavior cameras.
I applied phaseshift for each raw recording ap.bin file before concatenation.
rec = spre.phase_shift(rec)
tr02_HC
fileSizeBytes: 35,800,368,450
fileTimeSecs: 1549.7995
firstSample: 149,507,283
tr03_OF
fileSizeBytes: 28,292,999,350
fileTimeSecs: 1224.8051666666668
firstSample: 199,523,031
tr05_HC
fileSizeBytes: 30,213,765,890
fileTimeSecs: 1307.9552333333334
firstSample: 282,583,158
Based on theses, I manually changed the number for the ap.meta
concatenated_session
fileSizeBytes=94062180096
fileTimeSecs=4071.955833
firstSample=149507283
Which is in accordance with the actual size and duration of the concatenated recording ap.bin
concatenated_rec = si.concatenate_recordings(rec_list)
I also want to know how to deal with nidq.ap and nidq.meta for the concatenated sessions.
Unlike CatGT, those files seems not generated automatically in SpikeInterface.
I couldn't find the documentations for construct the concatenated ap.meta file in SpikeInterface, and will appreciate any suggestion and advices.
When I plot the traces of the concatenated recording after load it using read_spikeglx, it looks like this:
But if I use read_binary, the trace looks like this:
And if I use read_spikeglx for the first recording, the traces looks like this:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the reported use of concatenate_recordings, read_spikeglx, read_binary, and phase_shift, along with the ap.meta and nidq.meta examples in the issue. Determine whether the supported concatenation workflow and metadata handling can be documented, including how absolute timestamps and gaps should be represented; done means a clear reproducible procedure for loading the resulting recordings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100