Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
petersenpeter committed Apr 8, 2020
2 parents 9d2de54 + ef1a40f commit 9cab934
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 55 deletions.
2 changes: 1 addition & 1 deletion db/db_example.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
%% % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% Running the Cell Explorer pipeline via the db

cell_metrics = calc_CellMetrics('sessionName',sessionName);
cell_metrics = ProcessCellMetrics('sessionName',sessionName);
cell_metrics = CellExplorer('metrics',cell_metrics);

%% % % % % % % % % % % % % % % % % % % % % % % % % % % % %
Expand Down
6 changes: 3 additions & 3 deletions docs/datastructure/data-structure-and-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ A Matlab struct `session` stored in a .mat file: `sessionName.session.mat`. The
* `equipment` : hardware used to acquire the data

### Spikes
A Matlab struct `spikes` stored in a .mat file: `sessionName.spikes.cellinfo.mat`. It can be generated with [loadSpikes.m](https://github.com/petersenpeter/Cell-Explorer/blob/master/calc_CellMetrics/loadSpikes.m). The Cell Inspector's pipeline `calc_CellMetrics.m` used the script `loadSpikes.m`, to automatically load spike-data from either KiloSort, Phy or Neurosuite and saves it to a spikes struct. `sessionName.spikes.cellinfo.mat` should be located in the clustering path. The struct has the following fields:
A Matlab struct `spikes` stored in a .mat file: `sessionName.spikes.cellinfo.mat`. It can be generated with [loadSpikes.m](https://github.com/petersenpeter/Cell-Explorer/blob/master/calc_CellMetrics/loadSpikes.m). The Cell Inspector's pipeline `ProcessCellMetrics.m` used the script `loadSpikes.m`, to automatically load spike-data from either KiloSort, Phy or Neurosuite and saves it to a spikes struct. `sessionName.spikes.cellinfo.mat` should be located in the clustering path. The struct has the following fields:
* `ts`: a 1xN cell-struct for N units each containing a 1xM vector with M spike events in samples.
* `times`: a 1xN cell-struct for N units each containing a 1xM vector with M spike events in seconds.
* `cluID`: a 1xN vector with inherited IDs from the applied clustering algorithm.
Expand Down Expand Up @@ -158,7 +158,7 @@ A Matlab struct `eventName` stored in a .mat file: `sessionName.eventName.events
* `duration`: duration of event (in seconds; calculated from timestamps; Px1).
* `detectorinfo`: info about how the events were detected.

The `*.events.mat` files should be stored in the basepath. Any `events` files located in the basepath will be detected in the pipeline (calc_CellMetrics) and an average PSTHs will be generated.
The `*.events.mat` files should be stored in the basepath. Any `events` files located in the basepath will be detected in the pipeline (ProcessCellMetrics.m) and an average PSTHs will be generated.

### Manipulations
A Matlab struct `manipulationName` stored in a .mat file: `sessionName.eventName.manipulation.mat` with the following fields:
Expand All @@ -173,7 +173,7 @@ A Matlab struct `manipulationName` stored in a .mat file: `sessionName.eventName
* `duration`: duration of event (in seconds; calculated from timestamps; Px1).
* `detectorinfo`: info about how the events were detected.

The `*.manipulation.mat` files should be stored in the basepath. `events` and `manipulation` files are similar in content, but only manipulation intervals are excluded in the pipeline. Any `manipulation` files located in the basepath will be detected in the pipeline (calc_CellMetrics) and an average PSTH will be generated. Events and manipulation files are similar in content, but only manipulation intervals are excluded in the pipeline.
The `*.manipulation.mat` files should be stored in the basepath. `events` and `manipulation` files are similar in content, but only manipulation intervals are excluded in the pipeline. Any `manipulation` files located in the basepath will be detected in the pipeline (ProcessCellMetrics.m) and an average PSTH will be generated. Events and manipulation files are similar in content, but only manipulation intervals are excluded in the pipeline.

### Channels
A matlab struct `ChannelName` stored in a .mat file: `sessionName.ChannelName.channelinfo.mat` with the following fields:
Expand Down
7 changes: 4 additions & 3 deletions docs/datastructure/standard-cell-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ The spatial metrics are all based on average firing rate map.
## Response curve metrics
* `responseCurves`: response curves.

## Ground truth metrics
* `groundTruthClassification`: Opto-tagged/ground truth cell tags. More than one tag can be assigned to each cell.

## Group data
* `groups`: Cell groups. Each cell can be assigned to one or more groups.
* `tags`: Each cell can be assigned to one or more tags.
* `groundTruthClassification`: Opto-tagged/ground truth cell groups. Each cell can be assigned to one or more groups.
36 changes: 14 additions & 22 deletions docs/interface/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ The Cell Explorer is a graphical user interface that allow you to explore your d
1. TOC
{:toc}


## Classification
You can do direct classification in the GUI. The following types of classification can be performed.
* **Putative cell type**: You can create new cell types directly in the GUI.
* **Brain region**: Allen institute atlas.
* **Deep-superficial**: Deep superficial assignment can be done in the Cell Explorer cell-wise and in a separate gui channel-wise.
* **Labels**: You can assign your own labels to any cell.
* **Tags**: A selection of predetermined tags can also be assigned.
* **Tags**: Tags can be assigned.
* **Groups**: Groups can be created.
* **Ground truth cell types**: Ground truth data can be analysed directly in the GUI.

### Interface for deep-superfial classification curation
![](https://buzsakilab.com/wp/wp-content/uploads/2020/02/gui_deepSuperficial.png){: .mt-4}

## Monosynaptic connections
### Monosynaptic connections
Monosynaptic connections are determined in the pipeline, and you can visualize the connections in the GUI and redo the manual curation directly from the GUI. You can adjust connections from the Cell Explorer by launching the monosyn interface. [Please see the tutorial on manual curation of monosynaptic connections]({{"/tutorials/monosynaptic-connections-tutorial/"|absolute_url}}).
![](https://buzsakilab.com/wp/wp-content/uploads/2020/02/monosyn.png){: .mt-4}

### Interface for monosynaptic connections curation
![](https://buzsakilab.com/wp/wp-content/uploads/2020/02/monosyn.png)
### Interface for deep-superfial classification curation
![](https://buzsakilab.com/wp/wp-content/uploads/2020/02/gui_deepSuperficial.png){: .mt-4}

## Database capabilities
### Database capabilities
The Cell Explorer is capable of loading datasets from and writing to the Buzsaki lab database. Please setup your credentials and local paths as [described here]({{"/database/preparation/"|absolute_url}}).

### Reference data
Expand All @@ -44,16 +44,15 @@ To help you characterize your own data, you can load reference data provided by
There are a subset of ground truth cell types provided.

### Raincloud plot
To estimate single dimensional variations in your data you can generate a [raincloud plot](https://github.com/RainCloudPlots/RainCloudPlots). You can generate the plot from the top menu `View` -> `Generate rain cloud metrics plot`.
To quantify single dimensional variations in your data you can generate a [raincloud plot](https://github.com/RainCloudPlots/RainCloudPlots). You can generate the plot from the top menu `View` -> `Generate rain cloud metrics plot`.

The comparison line widths signify significance levels, `linewidth=1` signifies p>0.05, `linewidth=2` signifies p<0.05 and `linewidth=3` signifies p<0.001. Significance levels is determined using [Two-sample Kolmogorov-Smirnov test](https://www.mathworks.com/help/stats/kstest2.html) (a nonparametric hypothesis test). You can generate a raincloud plot from any color grouping, e.g. cell types, deep-superficial or animal.

Below plot shows a raincloud a comparison across putative cell types:
![raincloud cell types](https://buzsakilab.com/wp/wp-content/uploads/2020/02/raincloud-cell-types.png)


### Significance matrix
The significance matrix can help find metrics that your data into groups, e.g. deep-superfical labels. You can generate the plot from the top menu `View` -> `Generate significance matrix` or by pressing `K`. Please select a group of size 2 beforehand. This will show a dialog for selecting which metrics to use.
The significance matrix can help quantify the modality of your data, e.g. using the deep-superficial labels or the cell types. You can generate the plot from the top menu `View` -> `Generate significance matrix` or by pressing `K`. Please select a group of size 2 beforehand. This will show a dialog for selecting which metrics to process.
<p align="center"><img src="https://buzsakilab.com/wp/wp-content/uploads/2020/02/SignificanceMatrix.png" width="30%"></p>

The colors in the matrix signify significance level (right color bar in log10), `*` signifies p<0.05 and `**` signifies p<0.001. Selected metrics are shown on the left side of the matrix. Significance levels is determined using [Two-sample Kolmogorov-Smirnov test](https://www.mathworks.com/help/stats/kstest2.html) (a nonparametric hypothesis test).
Expand All @@ -62,17 +61,10 @@ The colors in the matrix signify significance level (right color bar in log10),
You can save your combined cell metrics from a study into a single mat file that can be shared together with a publication. This allows peers to verify your classification or use your cell metrics directly. You can save the mat file from the Cell Explorer from the menu `File` -> `Save classification`.

### Export figures
There are two ways to export figures.
1. You can export the whole interface from the top menu from the top menu `File` -> `Export figure`. This will open the Matlab Figure Export Setup dialog box (`exportsetupdlg`).
2. Single cell figures
1. Select a number of cells, using the mouse and press `space`, this opens the action dialog. If no selection is done before pressing `space` a selection dialog will be shown.
<p align="center"><img src="https://buzsakilab.com/wp/wp-content/uploads/2019/12/Cell-Explorer-group-action-dialog.png" width="70%"></p>
2. Select either of the three `MULTI PLOT OPTIONS`
3. In the new dialog, toogle `Save figures`, and define format and file path.
<p align="center"><img src="https://buzsakilab.com/wp/wp-content/uploads/2019/12/Cell-Explorer-group-action-multiplot-dialog.png" width="70%"></p>
Figures can be exported using the GUI, either the main Cell Explorer window or through cell selection actions dialog. For more information please see the [figure export tutorial]({{"/tutorials/export-figure/"|absolute_url}}).

### Work in batch-mode while handling metrics on a single session level
Using the Cell Explorer on a batch of sessions, will load metrics into one struct allowing you to visualize and classify your data across recordings and classify cells across sessions, while still maintaining the data handling on a single session level, writing your changes back to the original files. You can save metrics from a batch of sessions, and still load the data back into the Cell Explorer.
The Cell Explorer can handle batches of sessions. It will load metrics into one struct allowing you to visualize and classify your data across recordings and classify cells across sessions, while still maintaining the data handling on a single session level, writing your changes back to the original files. You can save metrics from a batch of sessions, and still load the data back into the Cell Explorer.

### Autosave
The Cell Explorer automatically saves your manual curation every 6 classification action (actions include changes to cell-type, deep-superficial assignment and brain region). You can turn this feature off or adjust the autosave-interval in preferences. The autosave only saves your progress to the workspace and you have to save your changes to the original cell_metrics file through the Cell Explorer interface.
### Track changes and autosave
The Cell Explorer tracks your actions, which includes cell-type classifications, deep-superficial assignment, brain regions, labels, tags, groups and ground truth classifications. Reverse an action by pressing `ctrl+Z`. Further it autosaves your actions to your workspace every 6th action (You can turn the autosave feature off or adjust the autosave-interval in preferences). You still have to save your changes to the original cell_metrics file through the Cell Explorer interface.
2 changes: 1 addition & 1 deletion docs/pipeline/custom-calculations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nav_order: 5
---
# Custom calculations
{: .no_toc}
The Cell Explorer pipeline has a subfolder for calculations to exist outside the main pipeline, such that updates can be applied without affecting your own additions to the pipeline. Please save your scripts to the folder `calc_CellMetrics/+customCalculations/` and follow the template already in that folder to integrate your own calculations into the regular pipeline.
The Cell Explorer pipeline has a subfolder for calculations to exist outside the main pipeline, such that updates can be applied without affecting your own additions to the pipeline. Please save your scripts to the folder `+customCalculations/` and follow the template already in that folder to integrate your own calculations into the regular pipeline.

Your metrics has to follow the Cell Explorer [cell_metrics standard]({{"/datastructure/your-own-metrics/"|absolute_url}}). Any `events` or `manipulation` files located in the basepath will be detected in the pipeline and PSTHs will be generated automatically. Events and manipulation files are similar in content, but only manipulation intervals are excluded in the pipeline.

Expand Down
2 changes: 1 addition & 1 deletion docs/pipeline/pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ has_children: true
---
# Processing pipeline
{: .no_toc}
Every metric is calculated in the same processing pipeline from a single call. To run the pipeline one have to prepare the compatible data structure and metadata. You can add your own metrics and custom calculations to the pipeline.
The pipeline has three main processing steps: 1. Gathering metadata, 2. Processing cell_metrics and 3. Running Cell Explorer. All metrics are calculated using a single processing script. To run the pipeline one have to prepare the compatible data structure and metadata. You can add your own metrics and custom calculations to the pipeline.
Loading

0 comments on commit 9cab934

Please sign in to comment.