Show error message if the denormalize is done with the wrong mass detector
@@ -125,7 +125,20 @@ public class MassDetectionParameters extends SimpleParameterSet {
@Override
public boolean checkParameterValues(Collection<String> errorMessages) {
final boolean superCheck = super.checkParameterValues(errorMessages);
+ // Check the selected mass detector
+ String massDetectorName = getParameter(massDetector).getValue().toString();
+
+ // check if denormalize was selected that it matches to the mass detection algorithm
+ boolean denorm = getValue(denormalizeMSnScans);
+ boolean illegalDenormalizeMassDetectorCombo =
+ denorm && !(massDetectorName.startsWith("Factor"));
+ if (illegalDenormalizeMassDetectorCombo) {
+ errorMessages.add("Spectral denormalization is currently only supported by the "
+ + "Factor of the lowest mass detector; selected:" + massDetectorName);
+ return false;
+ }
+ // check files
RawDataFile[] selectedFiles = getParameter(dataFiles).getValue().getMatchingRawDataFiles();
getParameter(dataFiles).getValue().resetSelection(); // reset selection after evaluation.
@@ -161,7 +174,6 @@ public class MassDetectionParameters extends SimpleParameterSet {
logger.finest("Proportion of scans estimated to be centroided: " + proportionCentroided);
// Check the selected mass detector
- String massDetectorName = getParameter(massDetector).getValue().toString();
if (!massDetectorName.contains("Auto")) {
if (mostlyCentroided && !(massDetectorName.startsWith("Centroid")
|| massDetectorName.startsWith("Factor"))) {
