Package net.sf.basedb.clients.web
Class ExperimentExplorer.AnnotationGroup
java.lang.Object
net.sf.basedb.clients.web.ExperimentExplorer.AnnotationGroup
- All Implemented Interfaces:
Comparable<ExperimentExplorer.AnnotationGroup>
- Enclosing class:
- ExperimentExplorer
public static class ExperimentExplorer.AnnotationGroup
extends Object
implements Comparable<ExperimentExplorer.AnnotationGroup>
An annotation group contains statistical information about the spot
values falling into the group.
- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2021-06-03 13:47:50 +0200 (Thu, 03 Jun 2021) $
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
AnnotationGroup
(int id, Set<T> annotationValues, int channels, Formatter<T> formatter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatistics
(String key, float value) Add another statisitcal measurement to this group.void
addValue
(int channel, float intensity) Add an intensity value to this group.int
Set<?>
Get all annotation values in this annotation group.Get the AWT color object that corresponds to the HTML color string.getColor()
Get a color code for HTML that is as distinct as possible from the color of the other groups.int
getCount
(int channel) Get the number of intensity values added to the specified channel.int
getId()
The ID of the group.float
getMean
(int channel) Get the mean of the intensity values for the given channel.float
getStatistics
(String key) Get the sum of all values added with theaddStatistics(String, float)
method with the given key.float
getSum
(int channel) Get the sum of intensities for the specified channel.getTitle()
Get the title of this annotation group.void
reset()
Resets all collected statistics in this group.void
Sets the color for this annotation group.
-
Field Details
-
id
private final int id -
annotationValues
-
title
-
sum
private final float[] sum -
count
private final int[] count -
statistics
-
color
-
-
Constructor Details
-
AnnotationGroup
-
-
Method Details
-
getId
public int getId()The ID of the group. The ID is only useful within the objects AnnotationSummary objects lifetime. The first group that is created is given an ID of 1, the second 2, and so on.- Returns:
- The ID
-
getTitle
Get the title of this annotation group. The title is created by concatenating all annotation values.- Returns:
- The title
-
getAnnotationValues
Get all annotation values in this annotation group.- Returns:
- A set containing all annotation values
-
getColor
Get a color code for HTML that is as distinct as possible from the color of the other groups. The colors may repeat if there are many groups.- Returns:
- The color string
-
getAwtColor
Get the AWT color object that corresponds to the HTML color string. The color string must have been set with a seven-character string with 2 hex characters for every color component, eg. '#rrggbb'.- Since:
- 2.14
-
setColor
Sets the color for this annotation group.- Parameters:
color
- A HTML color code- Since:
- 2.14
-
addValue
public void addValue(int channel, float intensity) Add an intensity value to this group.- Parameters:
channel
- The number of the channel, starting with 1intensity
- The spot's intensity
-
getSum
public float getSum(int channel) Get the sum of intensities for the specified channel.- Parameters:
channel
- The number of the channel, starting with 1- Returns:
- The sum of the intensities
- See Also:
-
getCount
public int getCount(int channel) Get the number of intensity values added to the specified channel.- Parameters:
channel
- The number of the channel, starting with 1- Returns:
- The number of values
- See Also:
-
getMean
public float getMean(int channel) Get the mean of the intensity values for the given channel.- Parameters:
channel
- he number of the channel, starting with 1- Returns:
- The mean of the values, or NaN if no values has been added
- See Also:
-
addStatistics
Add another statisitcal measurement to this group. All values with the same key are added together and can be retrieved with thegetStatistics(String)
method.- Parameters:
key
- The key for the measurmentvalue
- The value to add
-
getStatistics
Get the sum of all values added with theaddStatistics(String, float)
method with the given key.- Parameters:
key
- The measurement key- Returns:
- The sum of the added values or Float.NaN if no value is found
-
reset
public void reset()Resets all collected statistics in this group.- Since:
- 2.14
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ExperimentExplorer.AnnotationGroup>
-