Closed dougollerenshaw closed 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)
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}})
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.
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.
What does the "count" column contain?
@DowntonCrabby See additional documentation.
data_access.processing
calledadd_dff_stats_to_specimen_table
that takes the session object as the input and returns a cell_specimen_table with statistics on dff_traces appended (stats are provided bypd.describe()
and include mean, std, 25%, 50%,75%, min, max)log_dff_stats.py
that will take an ophys_experiment_id as an input, calladd_dff_stats_to_specimen_table
, then log the resulting table to a mongo collection called['ophys_data']['dff_summary']
deploy_log_dff_stats.py
that will iterate over thefiltered_ophys_experiment_table
and create one cluster job per experiment to executelog_dff_stats.py
database.py
calledlog_cell_dff_data
that handles writing of a single dff_stats record to mongodatabase.py
calledget_cell_dff_data
that facilitates searching mongo for the dff_stats