Color MSn nodes in the tree view
package io.github.mzmine.datamodel;
import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.jetbrains.annotations.NotNull;
@@ -96,4 +98,11 @@ public class PrecursorIonTree implements Comparable<PrecursorIonTree> {
public List<Scan> getAllFragmentScans() {
return root.getAllFragmentScans();
}
+
+ /**
+ * maps the MS level to the nodes
+ */
+ public @NotNull Map<Integer, List<PrecursorIonTreeNode>> groupByMsLevel() {
+ return stream().collect(Collectors.groupingBy(PrecursorIonTreeNode::getMsLevel));
+ }
}
