export library spectrum for top compound only
@@ -186,13 +186,8 @@ public class LibraryBatchGenerationTask extends AbstractTask {
List<DataPoint[]> spectra = scans.stream().map(Scan::getMassList)
.map(ScanUtils::extractDataPoints).toList();
- for (var match : matches) {
// first entry for the same molecule reflect the most common ion type, usually M+H
- if (Objects.equals(match.getCompoundName(), lastName)) {
- continue;
- }
-
- lastName = match.getCompoundName();
+ var match = matches.get(0);
// filter matches
for (int i = 0; i < spectra.size(); i++) {
@@ -218,8 +213,7 @@ public class LibraryBatchGenerationTask extends AbstractTask {
// add file info
final String fileUSI = Path.of(
Objects.requireNonNullElse(scan.getDataFile().getAbsolutePath(),
- scan.getDataFile().getName())).getFileName().toString() + ":"
- + scan.getScanNumber();
+ scan.getDataFile().getName())).getFileName().toString() + ":" + scan.getScanNumber();
entry.putIfNotNull(DBEntryField.DATAFILE_COLON_SCAN_NUMBER, fileUSI);
entry.getField(DBEntryField.DATASET_ID).ifPresent(
dataID -> entry.putIfNotNull(DBEntryField.USI, "mzspec:" + dataID + ":" + fileUSI));
@@ -237,7 +231,6 @@ public class LibraryBatchGenerationTask extends AbstractTask {
exported.incrementAndGet();
}
}
- }
private Map<Scan, ChimericPrecursorResult> checkChimericPrecursorIsolation(
final FeatureListRow row, final List<Scan> scans) {
