Class QuantitationTypeUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Append a suffix to aQuantitationType
description.static double
getDefaultCountValueAsDouble
(QuantitationType quantitationType) Obtain the value that indicates a missing value for counting data.static float
getDefaultCountValueAsFloat
(QuantitationType quantitationType) Obtain the value that indicates a missing value for counting data.static Object
getDefaultValue
(QuantitationType quantitationType) Obtain the default to use for a given quantitation type.static double
static Number
getDefaultValueAsNumber
(QuantitationType quantitationType) static String
getUnit
(QuantitationType quantitationType) static QuantitationType
mergeQuantitationTypes
(Collection<QuantitationType> quantitationTypes) Merge a given collection of quantitation types.
-
Constructor Details
-
QuantitationTypeUtils
public QuantitationTypeUtils()
-
-
Method Details
-
getDefaultValue
Obtain the default to use for a given quantitation type.This can be used as a placeholder for missing values in data vectors.
Missing double and float values are represented as NaNs unless they are counts in which case they are represented as zeroes.
For counting data represented as double or float, the default value is transformed as per
getDefaultCountValueAsDouble(QuantitationType)
andgetDefaultCountValueAsFloat(QuantitationType)
. -
getDefaultValueAsNumber
-
getDefaultValueAsDouble
-
getDefaultCountValueAsDouble
Obtain the value that indicates a missing value for counting data.The default count is zero, but if the data is on a log-scale, it will be mapped to
Double.NEGATIVE_INFINITY
. -
getDefaultCountValueAsFloat
Obtain the value that indicates a missing value for counting data. -
mergeQuantitationTypes
public static QuantitationType mergeQuantitationTypes(Collection<QuantitationType> quantitationTypes) Merge a given collection of quantitation types.All QTs must share the same general type, type, scale, representation and ratio status.
The
QuantitationType.getIsRecomputedFromRawData()
status is kept if all QTs are recomputed from raw data,It is not possible to merge QTs that were either normalized or batch-corrected.
- Throws:
IllegalArgumentException
- if the QTs are incompatible or if less than two QTs are provided.
-
appendToDescription
Append a suffix to aQuantitationType
description.This is used to describe the conversion that was performed.
-
getUnit
- Returns:
- a unit, or null if the QT is unitless (e.g. ratio)
-