SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
for (int row : selectedRows) {
int psmIndex = tableModel.getViewIndex(row);
String spectrumKey = psmKeys.get(psmIndex);
MSnSpectrum currentSpectrum = peptideShakerGUI.getSpectrum(spectrumKey);
spectraAsMgf.append(currentSpectrum.asMgf());
}
return spectraAsMgf.toString();
}