# Access to donor id from cell\_id

**URL:** <https://community.brain-map.org/t/access-to-donor-id-from-cell-id/3642>\
**Category:** Allen Cell Types Database\
**Tags:** how-to, allensdk\
**Created:** [September 4, 2024, 12:13pm UTC](https://community.brain-map.org/t/access-to-donor-id-from-cell-id/3642 "2024-09-04T12:13:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jballbe](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/jballbe/32/610_2.png) [@Jballbe](https://community.brain-map.org/u/Jballbe)\
**Post date:** [September 4, 2024, 12:13pm UTC](https://community.brain-map.org/t/access-to-donor-id-from-cell-id/3642/1 "2024-09-04T12:13:17Z")

</div>

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:

```auto
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é

---

<div class="post-metadata">

**Author:** ![gouwens](https://avatars.discourse-cdn.com/v4/letter/g/bcef8e/32.png) [@gouwens](https://community.brain-map.org/u/gouwens)\
**Post date:** [September 4, 2024, 3:41pm UTC](https://community.brain-map.org/t/access-to-donor-id-from-cell-id/3642/2 "2024-09-04T15:41:59Z")

</div>

Hi Julien,

You could use the [CellTypesApi](https://allensdk.readthedocs.io/en/latest/allensdk.api.queries.cell_types_api.html#allensdk.api.queries.cell_types_api.CellTypesApi) instead of the CellTypesCache to get that information.

For example:

```python
from allensdk.core.cell_types_cache import CellTypesApi

cta = CellTypesApi()
cta.get_cell(579462433)

```

which produces

```auto
{'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](https://celltypes.brain-map.org/cell_types_specimen_details.csv) linked to from the [Cell Feature Search page](https://celltypes.brain-map.org/data) - that file has `donor __id` and `donor__ name` columns, too, in case it’s easier for you to get the information that way.

---

<div class="post-metadata">

**Author:** ![Jballbe](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/jballbe/32/610_2.png) [@Jballbe](https://community.brain-map.org/u/Jballbe)\
**Post date:** [September 6, 2024, 7:04am UTC](https://community.brain-map.org/t/access-to-donor-id-from-cell-id/3642/3 "2024-09-06T07:04:09Z")

</div>

Hi Nathan,

Thank you very much for your response!
