Cell Type Lookup Table Metadata

Cell Type Lookup Table Metadata#

import pandas as pd 
import numpy as np
from datetime import datetime, date
from aind_data_access_api.document_db import MetadataDbClient

API_GATEWAY_HOST = "api.allenneuraldynamics.org"
DATABASE = 'metadata_index'
COLLECTION = 'data_assets'

docdb_api_client = MetadataDbClient(
   host=API_GATEWAY_HOST,
   database=DATABASE,
   collection=COLLECTION,
)
print(docdb_api_client._base_url)
https://api.allenneuraldynamics.org/v1/metadata_index/data_assets
aggregate = [
  {
    "$match": {
      "data_description.project_name": {"$in": ["Cell Type Lookup Table", "Cell Type LUT"]}, 
      "name": {"$regex": "nwb"},
      "location": {"$regex": "aind-open-data"}, 
      "data_description": {"$ne": None}
    }
  },
  {
    "$project": {
      "name": 1, 
      "subject_id": "$data_description.subject_id",
      "genotype": "$subject.subject_details.genotype", 
      "date_of_birth": "$subject.subject_details.date_of_birth", 
      "sex": "$subject.subject_details.sex",  
      "session_start_time": "$acquisition.acquisition_start_time",
      "session_end_time": "$acquisition.acquisition_end_time", 
      "stimulus_epochs": "$acquisition.stimulus_epochs.stimulus_name", 
      "project_name": "$data_description.project_name", 
      "modality": "$data_description.modalities.name", 
      "virus_names": "$procedures.subject_procedures.procedures.injection_materials.name",
    }
  },
]
    
records = docdb_api_client.aggregate_docdb_records(
    pipeline=aggregate,
)

Return these records into a dataframe and do some cleanup (exclude a particular session)

to_exclude = ['ecephys_655565_2023-03-31_14-47-36_nwb_2025-07-16_16-52-27'] 
df = pd.DataFrame(records) 
filtered_df = df[~df.name.isin(to_exclude)].sort_values(by='name')
# flatten virus names 
filtered_df.virus_names = filtered_df.virus_names.apply(lambda x: [item for sublist in x for item in sublist] if isinstance(x, list) else x)
filtered_df
_id name subject_id genotype date_of_birth sex session_start_time session_end_time stimulus_epochs project_name modality virus_names
38 63df2bac-e58a-42e8-8edf-799851dee447 ecephys_655565_2023-04-03_13-34-16_nwb_2025-07... 655565 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2022-10-24 Male 2023-04-03T20:30:00Z 2023-04-03T22:30:00Z [] Cell Type Lookup Table [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
3 be7e6c7f-c5a2-420e-8b0d-f709353df6f1 ecephys_655565_2023-04-05_16-17-25_nwb_2025-06... 655565 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2022-10-24 Male 2023-04-05T16:17:25-07:00 2023-04-05T17:05:43-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
5 f8e4c6d5-7176-4f21-9b88-d04238fda04c ecephys_655568_2023-05-01_15-26-47_nwb_2025-06... 655568 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2022-10-24 Female 2023-05-01T15:26:47-07:00 2023-05-01T16:13:33-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
1 5826720c-6582-4ea7-94e0-4c9aa4afa7a9 ecephys_655568_2023-05-03_15-21-12_nwb_2025-06... 655568 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2022-10-24 Female 2023-05-03T15:21:12-07:00 2023-05-03T16:07:54-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
4 cbde19ea-5cde-4a1a-af95-231903f1c6e2 ecephys_655571_2023-05-09_13-53-48_nwb_2025-06... 655571 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2022-10-24 Female 2023-05-09T13:53:48-07:00 2023-05-09T14:41:36-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
0 01ecc549-edaf-4594-885d-a12f97e87599 ecephys_655571_2023-05-15_13-39-49_nwb_2025-06... 655571 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2022-10-24 Female 2023-05-15T13:39:49-07:00 2023-05-15T14:26:36-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
2 714a99ce-6734-415c-8fa5-287d33a2fd27 ecephys_655572_2023-05-09_15-03-29_nwb_2025-06... 655572 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2022-10-24 Female 2023-05-09T15:03:29-07:00 2023-05-09T15:51:02-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
21 4db46f40-57a6-4d37-bff6-eda1f8e09023 ecephys_655572_2023-05-15_15-06-36_nwb_2025-06... 655572 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2022-10-24 Female 2023-05-15T15:06:36-07:00 2023-05-15T15:53:44-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
23 9e4044f0-bc26-47cb-9f5d-e605a0076cf4 ecephys_660104_2023-07-24_18-18-13_nwb_2025-07... 660104 Sst-IRES-Cre/wt 2022-11-30 Female 2023-07-24T18:18:13-07:00 2023-07-24T19:04:58-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
39 166a3fda-dee1-47a3-938c-1ee549bc3448 ecephys_661398_2023-03-31_17-01-09_nwb_2025-07... 661398 Adora2a-Cre/wt 2022-12-10 Male 2023-04-01T00:00:00Z 2023-04-01T02:00:00Z [] Cell Type Lookup Table [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
40 6cd80d0a-0c5b-493c-8783-5b4ec6ca0bd6 ecephys_661398_2023-04-03_15-47-29_nwb_2025-07... 661398 Adora2a-Cre/wt 2022-12-10 Male 2023-04-03T20:30:00Z 2023-04-03T22:30:00Z [] Cell Type Lookup Table [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
22 96bc69e4-5456-4591-b7c8-cc514ccdcf5b ecephys_661398_2023-04-06_16-02-15_nwb_2025-06... 661398 Adora2a-Cre/wt 2022-12-10 Male 2023-04-06T16:02:15-07:00 2023-04-06T16:50:38-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
28 c02a863b-e63e-4f35-9be8-1fd7277cfd96 ecephys_662913_2023-07-20_16-15-45_nwb_2025-06... 662913 Adora2a-Cre/wt 2022-12-25 Male 2023-07-20T16:15:45-07:00 2023-07-20T17:02:09-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
25 0cb30136-5e40-480b-8a8d-d26cea462730 ecephys_666721_2023-05-09_11-01-03_nwb_2025-06... 666721 Drd1a-Cre/wt 2023-01-24 Male 2023-05-09T11:01:03-07:00 2023-05-09T11:47:46-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
24 00b6e0cc-632e-4b71-805a-91c0b312f12d ecephys_666721_2023-05-12_16-15-36_nwb_2025-06... 666721 Drd1a-Cre/wt 2023-01-24 Male 2023-05-12T16:15:36-07:00 2023-05-12T17:03:19-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
27 a1a64a17-fa3d-456e-be13-ab4427f14ded ecephys_666859_2023-06-13_14-19-34_nwb_2025-06... 666859 Adora2a-Cre/wt 2023-01-25 Female 2023-06-13T14:19:34-07:00 2023-06-13T14:47:34-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
26 64a5b115-a9a5-4cb9-892d-8af5f875eb81 ecephys_666861_2023-05-23_10-04-20_nwb_2025-06... 666861 Adora2a-Cre/wt 2023-01-25 Female 2023-05-23T10:04:20-07:00 2023-05-23T10:49:58-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
7 9910cc8e-8bf0-4235-bbc8-89536f3d6071 ecephys_666861_2023-05-24_14-30-05_nwb_2025-06... 666861 Adora2a-Cre/wt 2023-01-25 Female 2023-05-24T14:30:05-07:00 2023-05-24T15:16:29-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
6 45cdaffe-3f25-4574-8117-a735e7bdabab ecephys_671646_2023-07-31_15-21-40_nwb_2025-07... 671646 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2023-02-25 Female 2023-07-31T15:21:40-07:00 2023-07-31T16:13:00-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
11 a647216f-e791-48b9-bb7a-8ac500c7eeeb ecephys_674005_2023-08-08_15-39-38_nwb_2025-06... 674005 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2023-03-14 Male 2023-08-08T15:39:38-07:00 2023-08-08T16:21:53-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
13 dca6ae43-e43c-4043-9512-38bf07c0f820 ecephys_674005_2023-08-10_13-15-14_nwb_2025-06... 674005 Chat-IRES-Cre-neo/Chat-IRES-Cre-neo 2023-03-14 Male 2023-08-10T13:15:14-07:00 2023-08-10T14:18:18-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
10 41df8893-c20b-427a-94c3-3b1182c916b7 ecephys_678449_2023-08-28_17-53-41_nwb_2025-07... 678449 Gad2-IRES-Cre/Gad2-IRES-Cre 2023-04-10 Female 2023-08-28T17:53:41-07:00 2023-08-28T18:28:17-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-Ef1a-DIO-ChRmine-mScarlet-WPRE]]
12 c398b858-bf4f-4ad9-8204-1079006b5279 ecephys_678577_2023-11-06_15-58-49_nwb_2025-06... 678577 Ntrk1-IRES-Cre/wt 2023-04-11 Male 2023-11-06T15:58:49-08:00 2023-11-06T16:40:11-08:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
8 0094c6ad-50c3-49fd-b5a0-3180d643573a ecephys_682033_2023-10-26_14-21-51_nwb_2025-07... 682033 Gad2-IRES-Cre/Gad2-IRES-Cre 2023-05-02 Female 2023-10-26T14:21:51-07:00 2023-10-26T14:56:21-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-Ef1a-DIO-ChRmine-mScarlet-WPRE]]
9 2f60b59b-fe68-43ee-a8de-c79002bd8bcf ecephys_682085_2023-10-03_16-42-49_nwb_2025-07... 682085 Slc17a6-IRES-Cre/wt 2023-05-03 Male 2023-10-03T16:42:49-07:00 2023-10-03T17:31:24-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-Ef1a-DIO-ChRmine-mScarlet-WPRE]]
29 4e2b3d26-4b67-4819-806d-3f55da5929ba ecephys_684156_2023-10-11_17-45-08_nwb_2025-07... 684156 Drd1a-Cre/wt 2023-05-14 Female 2023-10-11T17:45:08-07:00 2023-10-11T18:49:28-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0743m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
30 fe201555-1613-41d6-90ca-adec417feffe ecephys_684156_2023-10-13_16-56-59_nwb_2025-07... 684156 Drd1a-Cre/wt 2023-05-14 Female 2023-10-12T16:56:59-07:00 2023-10-12T18:01:04-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0743m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
19 76119c86-e2bc-4dcb-8654-8405e5ba4fa3 ecephys_692497_2023-12-11_16-20-55_nwb_2025-07... 692497 Adora2a-Cre/wt 2023-07-06 Female 2023-12-11T16:20:55-08:00 2023-12-11T17:02:52-08:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[hSyn-DIO-somBiPOLES-mCerulean]]
32 ca77c9d1-1b23-45c6-b40f-d53e651a59a3 ecephys_692497_2023-12-15_16-29-04_nwb_2025-07... 692497 Adora2a-Cre/wt 2023-07-06 Female 2023-12-15T16:29:04-08:00 2023-12-15T17:10:29-08:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[hSyn-DIO-somBiPOLES-mCerulean]]
36 2a2f70d3-6b11-4d6b-81e5-ce4c2943a867 ecephys_694471_2023-12-11_14-51-57_nwb_2025-06... 694471 Ntrk1-IRES-Cre/wt 2023-07-19 Male 2023-12-11T14:51:57-08:00 2023-12-11T15:33:49-08:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
34 7d0cfa81-9dde-4f78-a8cd-b35e91b44cc9 ecephys_694471_2023-12-15_15-26-01_nwb_2025-06... 694471 Ntrk1-IRES-Cre/wt 2023-07-19 Male 2023-12-15T15:26:01-08:00 2023-12-15T16:07:28-08:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
33 0ec2e8ae-316d-49e7-91ed-c024dd0ad79c ecephys_694473_2023-11-28_15-23-23_nwb_2025-07... 694473 Ntrk1-IRES-Cre/wt 2023-07-19 Female 2023-11-28T15:23:23-08:00 2023-11-28T16:05:02-08:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0779m_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
35 a0cdab6a-0905-4907-b4d5-2d85bf860b61 ecephys_697577_2024-02-13_16-24-10_nwb_2025-07... 697577 Adora2a-Cre/wt 2023-08-07 Male 2024-02-13T16:24:10-07:00 2024-02-13T17:05:24-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology] [[pAAV-Syn-FLEX-rc(ChrimsonR-tdTomato)]]
20 143a7ece-9bbf-42bc-856e-cf6f6c780d57 ecephys_704242_2024-04-30_17-13-29_nwb_2025-07... 704242 Gad2-IRES-Cre/Gad2-IRES-Cre 2023-09-21 Male 2024-04-30T17:13:29-07:00 2024-04-30T17:40:53-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-Ef1a-DIO ChRmine-eYFP-WPRE]]
15 4eac050d-ab62-47f1-b4f5-c486057f22f2 ecephys_704242_2024-05-02_16-51-50_nwb_2025-07... 704242 Gad2-IRES-Cre/Gad2-IRES-Cre 2023-09-21 Male 2024-05-02T16:51:50-07:00 2024-05-02T17:20:47-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-Ef1a-DIO ChRmine-eYFP-WPRE]]
17 bf0fba2f-94f9-4ae0-8dc1-82776316166d ecephys_715287_2024-04-24_15-24-43_nwb_2025-07... 715287 Ntrk1-IRES-Cre/wt 2023-12-04 Female 2024-04-24T15:24:43-07:00 2024-04-24T15:54:45-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
18 c8585e3d-bcf7-4191-ae7e-fa5b0b830fa0 ecephys_715290_2024-05-09_15-39-23_nwb_2025-07... 715290 Ntrk1-IRES-Cre/wt 2023-12-04 Female 2024-05-09T15:39:23-07:00 2024-05-09T16:12:34-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
16 5192c6f9-c327-40fb-a026-d3ef3ec4cc02 ecephys_715339_2024-05-08_16-09-35_nwb_2025-07... 715339 Drd1a-Cre/wt 2023-12-04 Female 2024-05-08T16:09:35-07:00 2024-05-08T16:37:43-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
31 4b3e05be-bdfa-471a-acb6-94316f4d2f9d ecephys_719093_2024-05-13_16-42-41_nwb_2025-07... 719093 Chat-IRES-Cre/Chat-IRES-Cre 2024-01-02 Male 2024-05-13T16:42:41-07:00 2024-05-13T17:10:56-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
14 27a5f834-6975-4a6f-b5f7-796074135e77 ecephys_719093_2024-05-15_15-01-10_nwb_2025-07... 719093 Chat-IRES-Cre/Chat-IRES-Cre 2024-01-02 Male 2024-05-15T15:01:10-07:00 2024-05-15T15:29:15-07:00 [Laser pulses] Cell Type LUT [Extracellular electrophysiology, Behavior vid... [[pAAV-AiE0452h_3xC2-minBG-CoChR-EGFP-WPRE3-BG...
print(len(filtered_df))
40
print(filtered_df.genotype.unique().tolist())
['Chat-IRES-Cre-neo/Chat-IRES-Cre-neo', 'Sst-IRES-Cre/wt', 'Adora2a-Cre/wt', 'Drd1a-Cre/wt', 'Gad2-IRES-Cre/Gad2-IRES-Cre', 'Ntrk1-IRES-Cre/wt', 'Slc17a6-IRES-Cre/wt', 'Chat-IRES-Cre/Chat-IRES-Cre']