AllenNeuralDynamics / foraging-behavior-browser

Foraging behavior browser (streamlit)
https://foraging-behavior-browser.streamlit.app/
MIT License
2 stars 2 forks source link

add intended recording structure to query #86

Closed rachelstephlee closed 1 week ago

rachelstephlee commented 2 months ago

Right now the mongodb pulls probe location, but we want to translate them to easily identifiable intended recording location.

Image

Per @hagikent

AP/ML/D coordinate to ABA coordination is an active topic... See this thread that I made a couple month ago (aiming to do what Rachel writes here). Kenta Hagihara: Bregma-based AP/ML/DV coordinate to CCF conversion posted in Neural Dynamics / Molecular Anatomy on July 3, 2024 12:21 PM

But in reality, we only have a smaller set of recording locations we need to figure out. So Rachel will sit down with Sue and Kenta to figure out what those locations are, and write a function that best estimates where those locations are.

hagikent commented 2 months ago

happened to know @dbirman , a new SciComp hire is very brainglobe-savvy, which I'm using to curate histology coordinates; he would be a great help if he has a bit of bandwidth.

dbirman commented 2 months ago

happened to know @dbirman , a new SciComp hire is very brainglobe-savvy, which I'm using to curate histology coordinates; he would be a great help if he has a bit of bandwidth.

Happy to lend a hand if there's something I can add here, lets connect next week edit: Nevermind just saw your message on teams!

jeromelecoq commented 1 month ago

This need input from experimentalist @ZhixiaoSu input on how "intended area" is recorded in metadata and this need to be reflected in the mongoldb database.

Histology set-up is not ready yet.

There is a field in metadata "Targeted structure" in procedure.json. Perhaps this field should be filled.

jeromelecoq commented 1 month ago

comments from Alex: https://github.com/AllenNeuralDynamics/aind-data-schema/blob/a9655585ef37cdff2eb11ebc752ed78866b08164/src/aind_data_schema/core/procedures.py#L512

hagikent commented 1 month ago

@saskiad Does this targeted_structure: str = Field(..., title="Targeted structure") under ophys_probe necessitate CCF official nomenclature?

dbirman commented 1 month ago

@saskiad Does this targeted_structure: str = Field(..., title="Targeted structure") under ophys_probe necessitate CCF official nomenclature?

Yes please use the standard CCF acronyms or full structure names. You can find the list here: https://github.com/AllenNeuralDynamics/aind-data-schema-models/blob/main/src/aind_data_schema_models/models/mouse_ccf_structures.csv

rachelstephlee commented 1 month ago

unfortunately @alexpiet , the intended structure is populated with null 😭😭😭😭

Image

This is procedures.json from behavior_700708_2024-06-04_08-44-22 (co_data_asset_id: 83ccc0bf-c131-49ea-a0d0-adf420826ae9)

can @dyf or @saskiad let me know why this is left unpopulated? if we are populating the probe location, shouldn't we also populate the target location? otherwise we have to backfill after the fact and i have to figure out the recording location based on coordiantes.

alexpiet commented 1 month ago

@rachelstephlee presumably the information in the procedures.json is filled in by NSB, or the scientist who requested the implant from NSB. @hagikent should follow up with NSB

saskiad commented 1 month ago

@alexpiet is correct - this is getting pulled from NSB. I haven't seen their request form in a while, so it's possible they don't have a targeted_structure field, but we'll need to work with them to implement one if that's true

hagikent commented 1 month ago

@alexpiet

filled in by NSB

more precisely, most info is automatically fetched from surgery request form submitted by scientist, not really filled by NSB surgeons. So, if we can ask NSB to add an optional entry field corresponding to targeted_structure, we don't have to manually backfill for the future data collection.

EDIT___ missed @saskiad 's recent one. Yes, we don't have the field atm. I can trigger a conversation with Ali, who I believe is managing the surgery request power app form.

saskiad commented 1 month ago

correct

rachelstephlee commented 1 month ago

I touched base with @dyf and he said that we can add an intended recording structure in the metadata.

We will want experimentalists and david in the same room for us to figure out a plan for this. So we can make use of the kanban meeting in three weeks after sfn, so we can touchbase then to figure out a plan. I think David just needs to have a list of the intended structures that the experimentalist/creator of the fiber photometry file can pick from in addition to the probe stereotax coordinates.

For now, I'll ask experimentalists what each of the CCF coordinates match to the intended structure. I'll have a hacky dictionary that matches coordinates -> intended structure until we have a better way of dealing with this in the meantime.

Here are some of the intended recording structure from an internal list of sessions that kenta tracked: https://docs.google.com/spreadsheets/d/1BSdOJpctQ9MV4WBepdd00BDepr7lqV7mxehm6-Z4CrU/edit?gid=0#gid=0

rachelstephlee commented 1 month ago

@dyf said he'll write a script putting the old intended recording structures in, and he'll check in with the relevant folks to add this at the appropriate place, so we can add this to the streamlit browser.

@dyf once you're done, can you give me a snippet of code so i can find it thru mongoDB and add this as a column to the streamlit browser?

jeromelecoq commented 1 month ago

We agreed to store BOTH intended coordinates and eventually recorded area. This could be separate assets on code ocean.

saskiad commented 1 month ago

We agreed to store BOTH intended coordinates and eventually recorded area. This could be separate assets on code ocean.

I don't think these should be separate assets. I think the procedures reflect the targeted structure, and a QC annotation can provide the actual structure.

rachelstephlee commented 1 month ago

Sounds good. @hagikent will followup with Ali once she returns, with the intention of adding a "intended recording location" in CCF language in the surgery form.

We also have additional ask on checking the ordering of the injections per https://github.com/AllenNeuralDynamics/aind-physio-arch/issues/252

~We will NOT include the intended NM recording, but instead use a dictionary mapping virus information to NM after the fact in the streamlit app~ this is updated in our meeting. See https://github.com/orgs/AllenNeuralDynamics/projects/75/views/1?filterQuery=virus&pane=issue&itemId=81969382&issue=AllenNeuralDynamics%7Cforaging-behavior-browser%7C92

hagikent commented 1 month ago

10/21 RL, SdV, JC, KH met briefly and agreed on what to implement at surgery request form level. 10/22 KH triggered communication with Ali. Ali apparently understood the need and will work on this with Mekhla/Rob.

hagikent commented 2 weeks ago

Has been consulting @ZhixiaoSu @jasonyslee @JeremiahYCohen (took silence as aye ;) ) for brain regions to be included, and finalized (see below). Ali is now working on integrating it. Filtered_Acronym_Names_with_Combined_Column.csv

hagikent commented 2 weeks ago

current look-up table (not yet official, beta, but useful)

hagikent commented 1 week ago

now integrated to surgery request form! as usual, needs backfill...