Search in sources :

Example 1 with SiriusCompound

use of net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.SiriusCompound in project mzmine2 by mzmine.

the class PeakListIdentificationTask method addSiriusCompounds.

/**
 * Adds peak identities to requested row
 *
 * @param annotations list of IonAnnotations
 * @param row to add identities
 * @param amount of identities to be added from list
 */
public static synchronized void addSiriusCompounds(@Nonnull List<IonAnnotation> annotations, @Nonnull PeakListRow row, int amount) {
    for (int i = 0; i < amount; i++) {
        SiriusIonAnnotation annotation = (SiriusIonAnnotation) annotations.get(i);
        SiriusCompound compound = new SiriusCompound(annotation);
        row.addPeakIdentity(compound, false);
    }
    notifyRow(row);
}
Also used : SiriusIonAnnotation(io.github.msdk.id.sirius.SiriusIonAnnotation) SiriusCompound(net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.SiriusCompound)

Example 2 with SiriusCompound

use of net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.SiriusCompound in project mzmine2 by mzmine.

the class ResultWindow method actionPerformed.

public void actionPerformed(ActionEvent e) {
    String command = e.getActionCommand();
    if (command.equals("ADD")) {
        int index = compoundsTable.getSelectedRow();
        if (index < 0) {
            MZmineCore.getDesktop().displayMessage(this, "Select one result to add as compound identity");
            return;
        }
        index = compoundsTable.convertRowIndexToModel(index);
        peakListRow.addPeakIdentity(listElementModel.getCompoundAt(index), false);
        // Notify the GUI about the change in the project
        MZmineCore.getProjectManager().getCurrentProject().notifyObjectChanged(peakListRow, false);
        // Repaint the window to reflect the change in the feature list
        MZmineCore.getDesktop().getMainWindow().repaint();
        dispose();
    }
    if (command.equals("COPY_SMILES")) {
        int row = compoundsTable.getSelectedRow();
        if (row < 0) {
            MZmineCore.getDesktop().displayMessage(this, "Select one result to copy SMILES value");
            return;
        }
        int realRow = compoundsTable.convertRowIndexToModel(row);
        String smiles = listElementModel.getCompoundAt(realRow).getSMILES();
        copyToClipboard(smiles, "Selected compound does not contain identified SMILES");
    }
    if (command.equals("COPY_FORMULA")) {
        int row = compoundsTable.getSelectedRow();
        if (row < 0) {
            MZmineCore.getDesktop().displayMessage(this, "Select one result to copy FORMULA value");
            return;
        }
        int realRow = compoundsTable.convertRowIndexToModel(row);
        String formula = listElementModel.getCompoundAt(realRow).getStringFormula();
        copyToClipboard(formula, "Formula value is null...");
    }
    if (command.equals("DB_LIST")) {
        int row = compoundsTable.getSelectedRow();
        if (row < 0) {
            MZmineCore.getDesktop().displayMessage(this, "Select one row to display the list DBs");
            return;
        }
        int realRow = compoundsTable.convertRowIndexToModel(row);
        final SiriusCompound compound = listElementModel.getCompoundAt(realRow);
        DBFrame dbFrame = new DBFrame(compound, browse);
        dbFrame.setVisible(true);
    }
}
Also used : SiriusCompound(net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.SiriusCompound) DBFrame(net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.db.DBFrame)

Example 3 with SiriusCompound

use of net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.SiriusCompound in project mzmine2 by mzmine.

the class ResultWindow method addListofItems.

/**
 * Method adds a new SiriusCompound to a table
 *
 * @param annotations - SiriusIonAnnotation results processed by Sirius/FingerId methods
 */
public void addListofItems(@Nonnull final List<IonAnnotation> annotations) {
    for (IonAnnotation ann : annotations) {
        SiriusIonAnnotation annotation = (SiriusIonAnnotation) ann;
        SiriusCompound compound = new SiriusCompound(annotation);
        addNewListItem(compound);
    }
}
Also used : SiriusIonAnnotation(io.github.msdk.id.sirius.SiriusIonAnnotation) SiriusCompound(net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.SiriusCompound) SiriusIonAnnotation(io.github.msdk.id.sirius.SiriusIonAnnotation) IonAnnotation(io.github.msdk.datamodel.IonAnnotation)

Aggregations

SiriusCompound (net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.SiriusCompound)3 SiriusIonAnnotation (io.github.msdk.id.sirius.SiriusIonAnnotation)2 IonAnnotation (io.github.msdk.datamodel.IonAnnotation)1 DBFrame (net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.db.DBFrame)1