AllenInstitute / visual_behavior_analysis

Python package for analyzing behavioral data for Brain Observatory: Visual Behavior
Other
21 stars 6 forks source link

add code to build dff stats table #704

Closed dougollerenshaw closed 3 years ago

dougollerenshaw commented 3 years ago
dougollerenshaw commented 3 years ago

Here is the syntax for retrieving data for all cells from the database:

import visual_behavior.database as db
dff_summary = db.get_cell_dff_data()

That command takes ~1.5 seconds to execute. Here is a 5 row sample of the resulting datafame:

dff_summary.sample(5)

image

Note that the _id column is the random hash that mongo has assigned to the entry to ensure uniqueness.

Data from a specific experiment can be queried as follows:

import visual_behavior.database as db
dff_summary = db.get_cell_dff_data({'ophys_experiment_id':994056251})

Records can also be queried numerically using the $gt or $lt operators for greater-than or less-than comparisons, respectively. For example, to find all cells with standard deviations greater than 1:

import visual_behavior.database as db
dff_summary = db.get_cell_dff_data({"std": {"$gt": 1}})
dougollerenshaw commented 3 years ago

Also note that I have created a column called 'previous_cell_specimen_ids'. This is intended to track changes in cell_specimen_id if/when cell-matching is re-run.

DowntonCrabby commented 3 years ago

I would either make the column names more explicate for things like "id", 'x", "y" or include descriptions of the columns in the documentation docstrings.

alexpiet commented 3 years ago

What does the "count" column contain?

dougollerenshaw commented 3 years ago

@DowntonCrabby See additional documentation.