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);
}
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);
}
}
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);
}
}
Aggregations