Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electrode selection in Axona raw recording #2656

Open
letiziasignorelli opened this issue Apr 3, 2024 · 1 comment
Open

Electrode selection in Axona raw recording #2656

letiziasignorelli opened this issue Apr 3, 2024 · 1 comment
Labels
extractors Related to extractors module NEO Problem related to NEO IO

Comments

@letiziasignorelli
Copy link

I'm trying to convert electrophysiological data from Axona to NWB using the code from the Neuroconv https://github.com/catalystneuro/neuroconv.

I'm using neuroconv version 0.4.9 with Python 3.9 on Windows 11 in a conda environment.

I’m selecting the tetrodes to extract from the .set file setting the parameters collectMask_* to 1
In the experiment lab I know they’re recording with Axona on channels 17-32, so I'm setting collectMask_* to 1 for tetrodes 5-8. But after running the conversion and plotting the extracted signals, I don't get the correct channels (I can see it's only noise in the output).
This is the code I'm using for conversion:

from dateutil import tz
from pathlib import Path
from neuroconv.datainterfaces import AxonaRecordingInterface

interface = AxonaRecordingInterface(file_path=".../2509202301.bin", verbose=True, es_key="Ephys")
 
# Extract what metadata we can from the source files
metadata = interface.get_metadata()
# For data provenance we add the time zone information to the conversion
tzinfo = tz.gettz()
session_start_time = metadata["NWBFile"]["session_start_time"]
metadata["NWBFile"].update(session_start_time=session_start_time.replace(tzinfo=tzinfo))
 
# Choose a path for saving the nwb file and run the conversion
path_to_save_nwbfile = ".../2509202301.nwb"
nwbfile_path = f"{path_to_save_nwbfile}"
interface.run_conversion(nwbfile_path=nwbfile_path, metadata=metadata)

But after running the conversion and plotting the extracted signals, I don't get the correct channels (I can see it's only noise in the output).
This is the plot code:

from pynwb import NWBHDF5IO
import numpy as np
import matplotlib.pyplot as plt
 
fileobject = NWBHDF5IO('2509202301.nwb', 'r')
nwbobject = fileobject.read()
 
xx = nwbobject.acquisition['Ephys'].data
time = np.linspace(0,1000, 100000)

fig, ax = plt.subplots(16,1, sharex='all', sharey='all')
for i in range(16):
    ax[i].plot(time, xx[100000:200000,i])
plt.show()

And this is the plot:
image

If instead, I try to extract the first 32 channels (so setting collectMask_* to 1 for tetrodes 1-8) I'm getting the correct signals in channels 17-32 (here I'm plotting only the last 16 channels).
image

It seems that in any case I'm extracting the first 16 channels if I select 4 tetrodes, or 32 if I'm selecting 8 tetrodes.

See: Originally posted by @CodyCBakerPhD in catalystneuro/neuroconv#787 (comment)

In general, it appears as if upstream control over Axona groups/streams is not exposed as my minimal attempt to get the RecordingExtractor results in only 16 channels (not 32) and only a single group (well, None implying only a single group anyway)

from spikeinterface.extractors import AxonaRecordingExtractor

recording = AxonaRecordingExtractor(file_path=".../2509202301.bin")

recording.channel_ids
> array(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15'], dtype='<U64')

recording.get_channel_groups()
> None

I can share the sample data via email if needed. Thanks!

@zm711
Copy link
Collaborator

zm711 commented Apr 3, 2024

We can first verify with this issue NeuralEnsemble/python-neo#1454. Then once it is patched at the neo level we can see if additional patches are needed at the SI level.

@zm711 zm711 added NEO Problem related to NEO IO extractors Related to extractors module labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extractors Related to extractors module NEO Problem related to NEO IO
Projects
None yet
Development

No branches or pull requests

2 participants