fix unknown symbol (wrong cherry pick)
@@ -52,6 +52,11 @@ public class FeatureDataUtils {
private static final Logger logger = Logger.getLogger(FeatureDataUtils.class.getName());
+ /**
+ * The default {@link CenterMeasure} for weighting and calculating feature m/z values.
+ */
+ public static final CenterMeasure DEFAULT_CENTER_MEASURE = CenterMeasure.AVG;
+
/**
* The Rt range of the series.
*
@@ -227,15 +232,18 @@ public class FeatureDataUtils {
* @param feature The feature.
*/
public static void recalculateIonSeriesDependingTypes(@NotNull final ModularFeature feature) {
- recalculateIonSeriesDependingTypes(feature, CenterMeasure.AVG);
+ recalculateIonSeriesDependingTypes(feature, DEFAULT_CENTER_MEASURE, true);
}
/**
* @param feature The feature
- * @param cm Center measure for m/z calculation. Defualt = {@link CenterMeasure#AVG}
+ * @param cm Center measure for m/z calculation. Default = {@link
+ * FeatureDataUtils#DEFAULT_CENTER_MEASURE}
+ * @param calcQuality specifies if quality parameters (FWHM, asymmetry, tailing) shall be
+ * calculated.
*/
public static void recalculateIonSeriesDependingTypes(@NotNull final ModularFeature feature,
- @NotNull final CenterMeasure cm) {
+ @NotNull final CenterMeasure cm, boolean calcQuality) {
final IonTimeSeries<? extends Scan> featureData = feature.getFeatureData();
final Range<Float> intensityRange = FeatureDataUtils.getIntensityRange(featureData);
final Range<Double> mzRange = FeatureDataUtils.getMzRange(featureData);
@@ -259,17 +267,8 @@ public class FeatureDataUtils {
feature.setMobility(calculateMobility(summedMobilogram));
}
- float fwhm = QualityParameters.calculateFWHM(feature);
- if (!Float.isNaN(fwhm)) {
- feature.set(FwhmType.class, fwhm);
- }
- float tf = QualityParameters.calculateTailingFactor(feature);
- if (!Float.isNaN(tf)) {
- feature.set(TailingFactorType.class, tf);
- }
- float af = QualityParameters.calculateAsymmetryFactor(feature);
- if (!Float.isNaN(af)) {
- feature.set(AsymmetryFactorType.class, af);
+ if (calcQuality) {
+ calculateQualityParameters(feature);
}
}
@@ -321,5 +320,18 @@ public class FeatureDataUtils {
return smallestDelta;
}
-
+ private static void calculateQualityParameters(@NotNull ModularFeature feature) {
+ float fwhm = QualityParameters.calculateFWHM(feature);
+ if (!Float.isNaN(fwhm)) {
+ feature.set(FwhmType.class, fwhm);
+ }
+ float tf = QualityParameters.calculateTailingFactor(feature);
+ if (!Float.isNaN(tf)) {
+ feature.set(TailingFactorType.class, tf);
+ }
+ float af = QualityParameters.calculateAsymmetryFactor(feature);
+ if (!Float.isNaN(af)) {
+ feature.set(AsymmetryFactorType.class, af);
+ }
+ }
}
