Changed exception to warning in GNPS export
@@ -36,10 +36,9 @@ import java.text.DecimalFormat;
import java.text.MessageFormat;
import java.text.NumberFormat;
import java.util.Arrays;
+import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
-
-import io.github.msdk.MSDKRuntimeException;
import net.sf.mzmine.datamodel.DataPoint;
import net.sf.mzmine.datamodel.Feature;
import net.sf.mzmine.datamodel.MassList;
@@ -88,14 +87,15 @@ public class GNPSmgfExportTask extends AbstractTask {
private RowFilter filter;
GNPSmgfExportTask(ParameterSet parameters) {
- this.peakLists =
- parameters.getParameter(GNPSExportAndSubmitParameters.PEAK_LISTS).getValue().getMatchingPeakLists();
+ this.peakLists = parameters.getParameter(GNPSExportAndSubmitParameters.PEAK_LISTS).getValue()
+ .getMatchingPeakLists();
this.fileName = parameters.getParameter(GNPSExportAndSubmitParameters.FILENAME).getValue();
this.massListName = parameters.getParameter(GNPSExportAndSubmitParameters.MASS_LIST).getValue();
this.filter = parameters.getParameter(GNPSExportAndSubmitParameters.FILTER).getValue();
if (parameters.getParameter(GNPSExportAndSubmitParameters.MERGE_PARAMETER).getValue()) {
- mergeParameters = parameters.getParameter(GNPSExportAndSubmitParameters.MERGE_PARAMETER).getEmbeddedParameters();
+ mergeParameters = parameters.getParameter(GNPSExportAndSubmitParameters.MERGE_PARAMETER)
+ .getEmbeddedParameters();
} else {
mergeParameters = null;
}
@@ -256,8 +256,10 @@ public class GNPSmgfExportTask extends AbstractTask {
DataPoint[] dataPoints = massList.getDataPoints();
if (mergeParameters != null) {
- MsMsSpectraMergeModule merger = MZmineCore.getModuleInstance(MsMsSpectraMergeModule.class);
- MergedSpectrum spectrum = merger.getBestMergedSpectrum(mergeParameters, row, massListName);
+ MsMsSpectraMergeModule merger =
+ MZmineCore.getModuleInstance(MsMsSpectraMergeModule.class);
+ MergedSpectrum spectrum =
+ merger.getBestMergedSpectrum(mergeParameters, row, massListName);
if (spectrum != null) {
dataPoints = spectrum.data;
writer.write("MERGED_STATS=");
@@ -274,16 +276,14 @@ public class GNPSmgfExportTask extends AbstractTask {
count++;
}
}
+
if (count == 0)
- if (countMissingMassList > 0)
- throw new MSDKRuntimeException("No MS/MS scans exported: " + countMissingMassList
- + " scans have no mass list " + massListName);
+ LOG.log(Level.WARNING, "No MS/MS scans exported.");
else
- throw new MSDKRuntimeException("No MS/MS scans exported.");
-
LOG.info(
MessageFormat.format("Total of {0} feature rows (MS/MS mass lists) were exported ({1})",
count, peakList.getName()));
+
if (countMissingMassList > 0)
LOG.warning(MessageFormat.format(
"WARNING: Total of {0} feature rows have an MS/MS scan but NO mass list (this shouldn't be a problem if a scan filter was applied in the mass detection step) ({1})",
