Calcium Imaging QC Report¶
This tool uses 1.0 compute credits per hour.
Overview and Purpose¶
Calcium imaging can generate large datasets, and it is not immediately clear if the data collected is of sufficient quality to proceed with secondary analysis, and if the data is suitable for inclusion in the final dataset.
Experimenters and computational neuroscientists have to deal with primary challenges in working with calcium imaging data:
- Is the data (movie/cell set) free of confounding issues and of sufficient quality?
- In a given cell set, are there some neurons that should be rejected? How do we reliably find outliers in cell sets at scale, and quickly visualize traces and footprints of potentially problematic cells?
The IDEAS Calcium Imaging Quality Control Tool allows users to quickly visualize statistics of movies, cell sets and event sets, and helps build intuition about the structure and quality of these datasets.
Input Data¶
Valid Inputs¶
Source Parameter | File Type | File Format |
---|---|---|
Input Movie | miniscope_movie | isxd |
Input Cell Set | cell_set | isxd |
Input Events | events, neural_events | isxd, isxd |
This tools accepts three input files:
- ISXD Movie file(s)
- ISXD Cell set file(s)
- ISXD Event set file(s)
The following combinations of files are supported
Movie | Cell Set | Event Set | Supported |
---|---|---|---|
⏺ | ⏺ | ⏺ | ✅ |
⏺ | ✅ | ||
⏺ | ✅ | ||
⏺ | ❌ | ||
⏺ | ⏺ | ✅ | |
⏺ | ⏺ | ✅ | |
⏺ | ⏺ | ❌ |
Series support
This tool supports series inputs.
- If one of the inputs is a series, then other inputs, if provided, must also be a series.
- If series inputs are provided, inputs are concatenated and a single QC report is generated for the series.
Example Quality Control Report¶
You can view an example Quality Control Report here:
Open example Quality Control Report
Understanding figures in the report¶
Movie trends¶
This figure plots the mean frame intensity of the movie vs. time for a few sample points (gray dots). A decaying exponential is then fit to the this data to determine if signs of bleaching are apparent in the movie. The equation being fit is:
where \(A\) is a scale parameter, \(\tau\) is the time scale of decay, \(C\) is an offset parameter, and \(y(t)\) is the best-fit exponential (red line).
Interpreting this figure
- In this example, the gray dots do not appreciably decrease over time, and the best-fit exponential is close to a flat line. This suggests that there is little to no bleaching in this movie.
- If the data is well fit by an exponential, or if there is a substantial decrease in the mean frame intensity over time, summary warnings will be generated alerting the user to this.
Interactivity and data exploration
- Zooming, panning, and downloading the image are enabled for this figure.
Projections and Footprint viewer¶
This figure shows the outlines of footprints of extracted cells over an image derived from the movie. When an input movie is provided, the following images are generated:
Image | Notes |
---|---|
Correlation image | This image represents an important part of the neuron initialization algorithm used in CNMF-E. Each pixel in this image is scaled with the correlation of that pixel in the original movie with its immediate 8 neighbors. |
Maximum projection | This image is generated by computing the maximum along the time axis for all frames in query points (gray dots in Movie trends) |
Mean projection | This image is generated by computing the mean along the time axis for all frames in query points (gray dots in Movie trends) |
Standard deviation projection | This image is generated by computing the standard deviation along the time axis for all frames in query points (gray dots in Movie trends). This projection may be useful to locate cell bodies and other active parts of the frame. |
Interactivity and data exploration
- The selector on the right allows you to switch between different images (try it live on this page!).
- Footprints can be toggled on and off using the "toggle footprints" legend button.
- Hovering over a footprint in this image identifies this cell in all subsequent scatter plots, and shows the trace and events for this cell.
- Zooming, panning, and downloading the image are enabled for this figure.
Traces and events¶
This figure shows the cell trace (black line) for the currently selected cell. If an event set file is included in the inputs, events from that cell will also be shown (inverted red triangles).
Interactivity and data exploration
- Hovering over a footprint in the Projections and Footprint viewer shows the trace of this cell here.
- Moving the slider above this figure allows you to scrub through all cells in the cell set.
Cell Set Metrics¶
The following scatter plots are generated when a cell set file is included in the inputs. In each of these figures,
- each dot corresponds to a single cell.
- Hovering over each dot updates all other scatter plots to show that point.
- Colors correspond to cell status: blue cells are accepted, red cells are rejected, and yellow cells are undecided.
- Square dots indicate the mean of each metric, and lines are the standard deviation.
Interactivity and data exploration
For each of these scatter plots,
- hovering over the scatter plots will show a marker indicating the currently chosen cell. This also updates the traces figure and shows the traces and events for the currently selected cell.
- Each scatter plot can be zoomed into, panned and downloaded.
Footprint metrics¶
This scatter plot shows measures calculated from the footprints of each cell. The circularity is a measure of roundness and is approximated using:
The area is defined as the number of pixels in each footprint, thresholded by 25% of the maximum intensity of that footprint.
How these metrics are used
A warning is generated if:
- a cell has footprints with zero size
- a cell has a large perimeter compared to the frame dimensions
- there is a large range of footprint areas
Why are we measuring circularity?
Cells are expected to be roughly circular. Non-circular objects identified as cells may warrant closer inspection. For example, blood vessels may sometimes be segmented into blobs and be incorrectly identified as cells.
Trace quality¶
This scatter plot shows measures calculated from the traces of each cell, and is an attempt to quantify the quality of cell traces and cell extraction.
- The Y-axis shows the maximum correlation of each cell trace to every other cell trace. Large values of cell to cell trace correlation can arise due to over-segmentation, where a single cell's footprint is split into two over-segmented "cells", and therefore these two objects have highly correlated traces. Large correlations need not necessarily mean that those cells are over-segmented, but can identify cells that warrant closer inspection.
- The X-axis shows the skew of each trace. Trace skew tends to correlate with trace quality.
Trace trend¶
This scatter plot shows measures calculated from the traces of each cell, and is an attempt to quantify if traces decrease or increase over time.
- The Y-axis shows the Spearman rank correlation of each cell's trace vs. time. The Spearman rank correlation is a non-parametric measure of rank correlation and scales with how well the relationship between the cell trace and time can be described using a monotonic function. This metric captures non-linear trends just as well as linear trends, and does not require explicit model fitting. Large absolute values of the Spearman correlation indicate that the trace is monotonically increasing or decreasing with time.
- The X-axis shows the goodness of fit of a decaying exponential to the cell trace. The equation used to fit the trace is the same as in the Movie trends figure. Cells with a large goodness of fit are well described by a decaying exponential, and are therefore candidates to be rejected.
Event Set Metrics¶
The following figures are generated when an event set file is included in the input files.
Event rates and SNR¶
This scatter plot shows measures calculated from the event set.
- The Y-axis shows mean event rate for each cell.
- The X-axis shows the Signal-to-Noise Ratio (SNR) computed from the events and cell traces for each cell. The SNR shown here is computed as in IDPS.
Decay constants¶
This scatter plot shows measures calculated from the event set, and quantifies decay timescales of events in each cell.
- The Y-axis shows the standard deviation of decay timescales, across all events, for each cell. Large standard deviations (outliers in the Y-axis) identify cells for closer inspection.
- The X-axis shows median decay timescales, across all events, for each cell. This metric should match what is known about the biology of these cells and the kinetics of the calcium indicator.
Output Data¶
If a cell set file is included in the input files, a CSV file is generated that contains data for each cell. Each row corresponds to a single cell, and the CSV file contains the following columns:
- X position of centroid of footprint
- Y position of centroid of footprint
- Trace skew
- Spearman rank correlation of trace vs. time
- Cell names
- Maximum correlation of trace with all other cells
- Goodness of fit to a decaying exponential
- Cell footprint area
- Cell footprint perimeter
- Cell footprint circularity
- Cell status