Access to donor id from cell_id

Hi everyone,

I downloaded some ephys data from the Allen CTD, and I am using it by referring to the cell id (i.e.: specimen_id in the documentation) as follow:

cell_id = int(579462433)
my_Cell_data = ctc.get_ephys_data(cell_id)
index_range = my_Cell_data.get_sweep(int(sweep_id))["index_range"]
sampling_rate = my_Cell_data.get_sweep(int(sweep_id))["sampling_rate"]
...

However, I would like to know if it is possible to know the mouse_id from which this cell has been recorded from?
In general, is there a way for me to know the information of the animal directly by providing the cell_id?

Thank you for any help you can provide!

Best regards,

Julien Ballbé

Hi Julien,

You could use the CellTypesApi instead of the CellTypesCache to get that information.

For example:

from allensdk.core.cell_types_cache import CellTypesApi

cta = CellTypesApi()
cta.get_cell(579462433)

which produces

{'cell_reporter_status': 'positive',
 'csl__normalized_depth': None,
 'csl__x': 9590.88840160779,
 'csl__y': 1846.28433696584,
 'csl__z': 3291.2638202753,
 'donor__age': '',
 'donor__disease_state': '',
 'donor__id': 578231840,
 ... # many more things
}

Also, there is a CSV of the metadata in the Cell Types Database linked to from the Cell Feature Search page - that file has donor__id and donor__name columns, too, in case it’s easier for you to get the information that way.

1 Like

Hi Nathan,

Thank you very much for your response!