prideParametersReport += "<br><br><b>Enzyme:</b> ";
if (!enzymes.isEmpty()) {
if (enzymes.size() == 1) {
Enzyme mappedEnzyme = EnzymeFactory.getUtilitiesEnzyme(enzymes.get(0));
// unknown enzyme
if (mappedEnzyme == null) {
peptideShakerGUI.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")));
// have the user select the enzyme
EnzymeSelectionDialog enzymeSelectionDialog = new EnzymeSelectionDialog(this, true, enzymes.get(0));
Enzyme selectedEnzyme = enzymeSelectionDialog.getEnzyme();
if (selectedEnzyme != null) {
mappedEnzyme = selectedEnzyme;
prideParametersReport += selectedEnzyme.getName() + "<br>";
} else {
prideParametersReport += enzymes.get(0) + " (unknown)<br>";
}
} else {
prideParametersReport += mappedEnzyme.getName() + "<br>";
}
prideSearchParameters.setEnzyme(mappedEnzyme);
} else {
// more than one enzyme given
String enzymesAsText = "";
for (int i = 0; i < enzymes.size(); i++) {
if (i > 0) {
enzymesAsText += " + ";
}
enzymesAsText += enzymes.get(i);
}
peptideShakerGUI.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")));
// have the user select the enzyme
EnzymeSelectionDialog enzymeSelectionDialog = new EnzymeSelectionDialog(this, true, enzymesAsText);
Enzyme selectedEnzyme = enzymeSelectionDialog.getEnzyme();
if (selectedEnzyme != null) {
prideParametersReport += selectedEnzyme.getName() + "<br>";
prideSearchParameters.setEnzyme(selectedEnzyme);
} else {
prideSearchParameters.setEnzyme(null);
prideParametersReport += enzymesAsText + " (unknown)<br>";
}