double click on ion network id type opens chromatograms of all rows in iin
package io.github.mzmine.datamodel.features.types.annotations.iin;
+import io.github.mzmine.datamodel.RawDataFile;
+import io.github.mzmine.datamodel.features.Feature;
+import io.github.mzmine.datamodel.features.ModularFeature;
+import io.github.mzmine.datamodel.features.ModularFeatureListRow;
import io.github.mzmine.datamodel.features.types.numbers.abstr.IntegerType;
import io.github.mzmine.datamodel.identities.iontype.IonIdentity;
import io.github.mzmine.datamodel.identities.iontype.IonNetwork;
+import io.github.mzmine.main.MZmineCore;
+import io.github.mzmine.modules.visualization.chromatogram.TICPlotType;
+import io.github.mzmine.modules.visualization.chromatogram.TICVisualizerTab;
+import io.github.mzmine.parameters.parametertypes.selectors.ScanSelection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* The ID from Ion Identity Networking (IIN), which searches for different ions describing the same
@@ -35,4 +47,32 @@ public class IonNetworkIDType extends IntegerType {
return "IIN ID";
}
+ @Nullable
+ @Override
+ public Runnable getDoubleClickAction(@NotNull ModularFeatureListRow row,
+ @NotNull List<RawDataFile> file) {
+
+ var ionIdentity = row.getBestIonIdentity();
+ if (ionIdentity == null) {
+ return null;
+ }
+
+ return () -> {
+ final IonNetwork network = ionIdentity.getNetwork();
+ ModularFeature bestFeature = row.getBestFeature();
+ final RawDataFile bestRaw = bestFeature.getRawDataFile();
+
+ Map<Feature, String> labels = new HashMap<>();
+ List<Feature> features = network.keySet().stream().filter(r -> r.getFeature(bestRaw) != null)
+ .<Feature>mapMulti((r, c) -> {
+ Feature feature = r.getFeature(bestRaw);
+ labels.put(feature, network.get(r).getAdduct());
+ c.accept(feature);
+ }).toList();
+
+ TICVisualizerTab tab = new TICVisualizerTab(new RawDataFile[]{bestRaw}, TICPlotType.BASEPEAK,
+ new ScanSelection(1), bestFeature.getRawDataPointsMZRange(), features, labels);
+ MZmineCore.getDesktop().addTab(tab);
+ };
+ }
}
