Replies: 1 comment 1 reply
-
What is the value of In this line: nwbfile.add_electrode_column(name=df.iloc[x,25], description=df.iloc[x,27] + df.iloc[x,28] + df.iloc[x,29]) You add a new column to the electrodes table named whatever the value of When you later add rows to the electrodes table, you must provide a value for this new custom column in for ishank in nchannels:
nwbfile.add_electrode(
group=electrode_group,
x=float(xcoordst[ishank]),
y=float(ycoordst[ishank]),
z=float(0),
imp=float(ImpedanceValue[ishank]),
location=df.iloc[x,31],
filtering=filtering,
id=ishank,
rel_x=None,
rel_y=None,
rel_z=None,
reference=None,
enforce_unique_id=True,
)
electrode_counter += 1 The error suggests that the new column name is |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to use pynwb to convert a large amount of Intan data into the NWB format. I cannot seem to figure out why I can't set up the device and add electrodes (see below). The code reads entries in a .csv database (df) that then enters in the values. I receive the below error and I don't know what it means?
I am also generating this electrode group (a 1024 channel grid) and then using that group in the below convert_to_nwb function to convert the data.
Any and all help would be hugely appreciated. Otherwise, we will have to enter this information for hundreds of files using this software (https://github.com/Intan-Technologies/IntanToNWB and excel sheet) which can lead to user errors.
Error:
ValueError: row data keys don't match available columns
you supplied 0 extra keys: set()
and were missing 1 keys: {'Serial Number- B16S1L2 Layout version- Rat150um_v7_6_1024ch_A'}
Thank you,
Angelique
Code with the full error far below. Sorry that I couldn't keep the same formatting as in jupyter notebook.
LengthFiles=len(AllRows)
RowNum=range(LengthFiles)
for x in RowNum:
print(x)
IdentifierInfo=df.iloc[x,15][2:len(df.iloc[x,15])]
ImpedanceFile=df.iloc[x,34]
root pynwb.file.NWBFile at 0x1965047167464
Fields:
experimenter: ['Youngbin Tchoe']
file_create_date: [datetime.datetime(2022, 11, 9, 20, 33, 29, 576107, tzinfo=tzlocal())]
identifier: Baseline_saline_200317_095410
institution: University of California, San Diego
lab: Dayeh lab, IEBL, http://iebl.ucsd.edu/
related_publications: ['DOI:10.1016/j.neuron.2016.12.011']
session_description: Baseline recordings in saline Fine functional mapping of rat barrel cortex (right side) with micro-ECoG grids with 1024 channels, 150 µm pitch, 30 µm diameter Baseline recordings in saline Ketamine/Xylaxine (9:1) Acute Barrel cortex (right hemisphere)
session_id: Baseline_saline_200317_095410.rhd
session_start_time: 0317-03-17 02:30:03-07:53
timestamps_reference_time: 0317-03-17 02:30:03-07:53
ValueError Traceback (most recent call last)
in
81 rel_z=None,
82 reference=None,
---> 83 enforce_unique_id=True,
84 )
85 electrode_counter += 1
~\Anaconda3\lib\site-packages\hdmf\utils.py in func_call(*args, **kwargs)
643 def func_call(*args, **kwargs):
644 pargs = _check_args(args, kwargs)
--> 645 return func(args[0], **pargs)
646 else:
647 def func_call(*args, **kwargs):
~\Anaconda3\lib\site-packages\pynwb\file.py in add_electrode(self, **kwargs)
689 d.pop(col_name) # remove args from d if not set
690
--> 691 self.electrodes.add_row(**d)
692
693 @DocVal({'name': 'region', 'type': (slice, list, tuple), 'doc': 'the indices of the table'},
~\Anaconda3\lib\site-packages\hdmf\utils.py in func_call(*args, **kwargs)
643 def func_call(*args, **kwargs):
644 pargs = _check_args(args, kwargs)
--> 645 return func(args[0], **pargs)
646 else:
647 def func_call(*args, **kwargs):
~\Anaconda3\lib\site-packages\hdmf\common\table.py in add_row(self, **kwargs)
597 'row data keys don't match available columns',
598 'you supplied {} extra keys: {}'.format(len(extra_columns), extra_columns),
--> 599 'and were missing {} keys: {}'.format(len(missing_columns), missing_columns)
600 ])
601 )
ValueError: row data keys don't match available columns
you supplied 0 extra keys: set()
and were missing 1 keys: {'Serial Number- B16S1L2 Layout version- Rat150um_v7_6_1024ch_A'}
Beta Was this translation helpful? Give feedback.
All reactions