Skip to content

Commit

Permalink
NeuroScope2: interval selection bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
petersenpeter committed Jan 3, 2023
1 parent dcf32fe commit 2943b2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions NeuroScope2.m
Original file line number Diff line number Diff line change
Expand Up @@ -5032,11 +5032,17 @@ function finishIntervalSelection(actionType)
data.events.(UI.settings.eventData).added_intervals = [];
end
if actionType == 2
data.events.(UI.settings.eventData).added_intervals = ConsolidateIntervals([data.events.(UI.settings.eventData).added_intervals;states]);
if size([data.events.(UI.settings.eventData).added_intervals;states],1)>1
data.events.(UI.settings.eventData).added_intervals = ConsolidateIntervals([data.events.(UI.settings.eventData).added_intervals;states]);
else
data.events.(UI.settings.eventData).added_intervals = [data.events.(UI.settings.eventData).added_intervals;states];
end
UI.elements.lower.performance.String = 'Intervals added';
UI.settings.addEventonClick = 0;
elseif actionType == 3
data.events.(UI.settings.eventData).added_intervals = SubtractIntervals(data.events.(UI.settings.eventData).added_intervals,states);
if ~isempty(data.events.(UI.settings.eventData).added_intervals)
data.events.(UI.settings.eventData).added_intervals = SubtractIntervals(data.events.(UI.settings.eventData).added_intervals,states);
end
UI.elements.lower.performance.String = 'Intervals removed';
UI.settings.addEventonClick = 0;
end
Expand Down Expand Up @@ -5068,7 +5074,7 @@ function ClickPlot(~,~)
polygon1.counter = polygon1.counter +1;

n_points = numel(polygon1.coords);
polygon1.handle2(polygon1.counter) = line(UI.plot_axis1,polygon1.coords(end)*[1,1],[0,1],'color',[0.5 0.5 0.5], 'HitTest','off');
polygon1.handle2(polygon1.counter) = line(UI.plot_axis1,polygon1.coords(end)*[1,1]- UI.t0,[0,1],'color',[0.5 0.5 0.5], 'HitTest','off');
if n_points>1
n_even_points = floor(n_points/2)*2;
statesData = polygon1.coords(1:n_even_points);
Expand Down Expand Up @@ -5128,8 +5134,7 @@ function ClickPlot(~,~)
UI.settings.addEventonClick = 0;
set(UI.fig,'Pointer','arrow')
uiresume(UI.fig);
end

end
elseif UI.settings.normalClick
channels = sort([UI.channels{UI.settings.electrodeGroupsToPlot}]);
x1 = (ones(size(ephys.traces(:,channels),2),1)*[1:size(ephys.traces(:,channels),1)]/size(ephys.traces(:,channels),1)*UI.settings.windowDuration/UI.settings.columns)'+UI.settings.channels_relative_offset(channels);
Expand Down
6 changes: 3 additions & 3 deletions docs/interface/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can do direct classification in the GUI. The following types of classificati
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 CellExplorer by launching the monosyn interface. [Please see the tutorial on manual curation of monosynaptic connections]({{"/tutorials/monosynaptic-connections-tutorial/"|absolute_url}}).
![](https://raw.githubusercontent.com/petersenpeter/common_resources/main/images/monosyn.png){: .mt-4}

### Interface for deep-superfial classification curation
### Interface for deep-superficial classification curation
![](https://raw.githubusercontent.com/petersenpeter/common_resources/main/images/gui_deepSuperficial.png){: .mt-4}

### Reference data
Expand All @@ -41,7 +41,7 @@ To help you characterize your own data, you can load reference data provided by
### Raincloud 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.
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 non-parametric 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://raw.githubusercontent.com/petersenpeter/common_resources/main/images/raincloud-cell-types.png)
Expand All @@ -50,7 +50,7 @@ Below plot shows a raincloud a comparison across putative cell types:
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://raw.githubusercontent.com/petersenpeter/common_resources/main/images/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).
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 non-parametric hypothesis test).

### Share cell metrics in your publications or with your peers
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 CellExplorer from the menu `File` -> `Save`.
Expand Down

0 comments on commit 2943b2a

Please sign in to comment.