Package sc.fiji.snt.analysis
Class GroupedTreeStatistics
java.lang.Object
sc.fiji.snt.analysis.GroupedTreeStatistics
Computes statistics from
Tree groups.- Author:
- Tiago Ferreira
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGroup(Collection<Tree> group, String groupLabel) Adds a comparison group to the analysis queue.voidaddGroup(Collection<Tree> group, String groupLabel, String... swcTypes) Adds a comparison group to the analysis queue.doubleanovaPValue(String measurement) Computes the one-way ANOVA P-value for all the groups being analyzed.getBoxPlot(String measurement) Assembles a Box and Whisker Plot for the specified measurement (cell morphometry).getBoxPlot(String feature, int depth, double cutoff, boolean normalize) Assembles a Box and Whisker Plot for the specified feature.getBoxPlot(String feature, Collection<BrainAnnotation> annotations) Assembles a Box and Whisker Plot for the specified feature (absolute measurements).getBoxPlot(String feature, Collection<BrainAnnotation> annotations, double cutoff, boolean normalize) Assembles a Box and Whisker Plot for the specified feature.getFlowPlot(String feature, int depth) Assembles a Flow plot (aka Sankey diagram) for the specified feature using "mean" as integration statistic, no cutoff value, and all of the brain regions of the specified ontology depth.getFlowPlot(String feature, int depth, double cutoff, boolean normalize) Assembles a Flow plot (aka Sankey diagram) for the specified feature using "mean" as integration statistic, no cutoff value, and all of the brain regions of the specified ontology depthgetFlowPlot(String feature, Collection<BrainAnnotation> annotations, boolean normalize) Assembles a Flow plot (aka Sankey diagram) for the specified feature using "mean" as integration statistic, and no cutoff value.getFlowPlot(String feature, Collection<BrainAnnotation> annotations, String statistic, double cutoff, boolean normalize) Assembles a Flow plot (aka Sankey diagram) for the specified feature.Gets the group identifiers currently queued for analysis.getGroupStats(String groupLabel) Gets the group statistics.getHistogram(String measurement) Gets the relative frequencies histogram for a univariate measurement.intGets the number of Trees in a specified group.getPolarHistogram(String measurement) Gets the relative frequencies histogram for a univariate measurement as a polar (rose) plot assuming a data range between [0-360].static voidvoidsetMinNBins(int minNoOfBins) Sets the minimum number of bins when assembling histograms.doubleComputes a two-sample, two-tailed t-test P-value for two of groups being analyzed.
-
Constructor Details
-
GroupedTreeStatistics
public GroupedTreeStatistics()Instantiates a new grouped tree statistics.
-
-
Method Details
-
addGroup
Adds a comparison group to the analysis queue.- Parameters:
group- the groupgroupLabel- a unique label identifying the group
-
addGroup
public void addGroup(Collection<Tree> group, String groupLabel, String... swcTypes) throws NoSuchElementException Adds a comparison group to the analysis queue.- Parameters:
group- the collection of Trees to be analyzedgroupLabel- a unique label identifying the groupswcTypes- SWC type(s) a string with at least 2 characters describing the SWC type allowed in the subtree (e.g., 'axn', or 'dendrite')- Throws:
NoSuchElementException-swcTypesare not applicable togroup
-
getGroupStats
Gets the group statistics.- Parameters:
groupLabel- the unique label identifying the group- Returns:
- the group statistics or null if no group is mapped to
groupLabel
-
tTest
public double tTest(String measurement, String group1Label, String group2Label) throws org.apache.commons.math3.exception.MathIllegalArgumentException Computes a two-sample, two-tailed t-test P-value for two of groups being analyzed. It is assumed that data fulfills basic assumptions on normality, variance homogeneity, etc.- Parameters:
measurement- the measurement (N_NODES,NODE_RADIUS, etc.)group1Label- the unique label identifying group 1group2Label- the unique label identifying group 2- Returns:
- the p-value
- Throws:
org.apache.commons.math3.exception.MathIllegalArgumentException- If the computation fails
-
anovaPValue
public double anovaPValue(String measurement) throws org.apache.commons.math3.exception.MathIllegalArgumentException Computes the one-way ANOVA P-value for all the groups being analyzed. It is assumed that data fulfills basic assumptions on normality, variance homogeneity, sample size, etc.- Parameters:
measurement- the measurement (N_NODES,NODE_RADIUS, etc.)- Returns:
- the p-value
- Throws:
org.apache.commons.math3.exception.MathIllegalArgumentException- If the computation fails, E.g., because less than 2 groups exist, one of the groups contains less than two trees, or a convergence error occurs
-
getN
Gets the number of Trees in a specified group.- Parameters:
groupLabel- the unique label identifying the group- Returns:
- the number of Trees or -1 if no group is mapped to
groupLabel
-
getGroups
Gets the group identifiers currently queued for analysis.- Returns:
- the group identifiers
-
getHistogram
Gets the relative frequencies histogram for a univariate measurement. The number of bins is determined using the Freedman-Diaconis rule.- Parameters:
measurement- the measurement (N_NODES,NODE_RADIUS, etc.)- Returns:
- the frame holding the histogram
- See Also:
-
getPolarHistogram
Gets the relative frequencies histogram for a univariate measurement as a polar (rose) plot assuming a data range between [0-360]. The number of bins is determined using the Freedman-Diaconis rule.- Parameters:
measurement- the measurement (e.g.,MultiTreeStatistics.AVG_REMOTE_ANGLE- Returns:
- the frame holding the histogram
- See Also:
-
getBoxPlot
Assembles a Box and Whisker Plot for the specified measurement (cell morphometry).- Parameters:
measurement- the measurement (N_NODES,NODE_RADIUS, etc.)- Returns:
- the frame holding the box plot
- See Also:
-
getBoxPlot
Assembles a Box and Whisker Plot for the specified feature (absolute measurements).- Parameters:
feature- the feature ("Cable length", "No. of branch points", "No. of tips", etc.). Note that the majority ofTreeStatistics.getAllMetrics()metrics are currently not supported.annotations- the BrainAnnotations to be queried. Null not allowed.- Returns:
- the box plot
-
getBoxPlot
public SNTChart getBoxPlot(String feature, Collection<BrainAnnotation> annotations, double cutoff, boolean normalize) Assembles a Box and Whisker Plot for the specified feature.- Parameters:
feature- the feature ("Cable length", "No. of branch points", "No. of tips", etc.). Note that the majority ofTreeStatistics.getAllMetrics()metrics are currently not supported.annotations- the BrainAnnotations to be queried. Null not allowed.cutoff- a filtering option. If the computedfeaturefor an annotation is below this value, that annotation is excluded from the plotnormalize- If true, values are retrieved as ratios. E.g., Iffeatureis "Cable length", andcutoff0.1, BrainAnnotations inannotationsassociated with less than 10% of cable length are ignored.- Returns:
- the box plot
-
getBoxPlot
Assembles a Box and Whisker Plot for the specified feature.- Parameters:
feature- the feature ("Cable length", "No. of branch points", "No. of tips", etc.). Note that the majority ofTreeStatistics.getAllMetrics()metrics are currently not supported.depth- the ontological depth of the compartments to be consideredcutoff- a filtering option. If the computedfeaturefor an annotation is below this value, that annotation is excluded from the plot * @param normalize If true, values are retrieved as ratios. E.g., Iffeatureis "Cable length", andcutoff0.1, BrainAnnotations inannotationsassociated with less than 10% of cable length are ignored.- Returns:
- the box plot
-
getFlowPlot
public SNTChart getFlowPlot(String feature, Collection<BrainAnnotation> annotations, boolean normalize) Assembles a Flow plot (aka Sankey diagram) for the specified feature using "mean" as integration statistic, and no cutoff value.- See Also:
-
getFlowPlot
Assembles a Flow plot (aka Sankey diagram) for the specified feature using "mean" as integration statistic, no cutoff value, and all of the brain regions of the specified ontology depth.- Parameters:
feature- the feature ("Cable length", "No. of branch points", "No. of tips", etc.).depth- the ontological depth of the compartments to be considered- Returns:
- the flow plot
- See Also:
-
getFlowPlot
Assembles a Flow plot (aka Sankey diagram) for the specified feature using "mean" as integration statistic, no cutoff value, and all of the brain regions of the specified ontology depth. *- Parameters:
feature- the feature ("Cable length", "No. of branch points", "No. of tips", etc.)depth- the ontological depth of the compartments to be consideredcutoff- a filtering option. If the computedfeaturefor an annotation is below this value, that annotation is excluded from the plotnormalize- If true, values are retrieved as ratios. E.g., Iffeatureis "Cable length", andcutoff0.1, BrainAnnotations inannotationsassociated with less than 10% of cable length are ignored.- Returns:
- the flow plot
-
getFlowPlot
public SNTChart getFlowPlot(String feature, Collection<BrainAnnotation> annotations, String statistic, double cutoff, boolean normalize) Assembles a Flow plot (aka Sankey diagram) for the specified feature.- Parameters:
feature- the feature ("Cable length", "No. of branch points", "No. of tips", etc.). Note that the majority ofTreeStatistics.getAllMetrics()metrics are currently not supported.annotations- the BrainAnnotations to be queried. Null not allowed.statistic- the integration statistic (lower case). Either "mean", "sum", "min" or "max". Null not allowed.cutoff- a filtering option. If the computedfeaturefor an annotation is below this value, that annotation is excluded from the plotnormalize- If true, values are retrieved as ratios. E.g., Iffeatureis "Cable length", andcutoff0.1, BrainAnnotations inannotationsassociated with less than 10% of cable length are ignored.- Returns:
- the SNTChart holding the flow plot
-
setMinNBins
public void setMinNBins(int minNoOfBins) Sets the minimum number of bins when assembling histograms.- Parameters:
minNoOfBins- the minimum number of bins.
-
main
-