// iterate the peptide table and highlight the covered areas
for (int i = 0; i < peptideTable.getRowCount() && !progressDialog.isRunCanceled(); i++) {
String peptideKey = peptideTableMap.get(getPeptideIndex(i));
String peptideSequence = Peptide.getSequence(peptideKey);
AminoAcidPattern aminoAcidPattern = new AminoAcidPattern(peptideSequence);
for (int peptideTempStart : aminoAcidPattern.getIndexes(proteinSequence, peptideShakerGUI.getSequenceMatchingPreferences())) {
int peptideTempEnd = peptideTempStart + peptideSequence.length() - 1;
jmolPanel.getViewer().evalString(
"select resno >=" + (peptideTempStart - chains[selectedChainIndex - 1].getDifference())
+ " and resno <=" + (peptideTempEnd - chains[selectedChainIndex - 1].getDifference())
+ " and chain = " + currentChain + "; color green");
if (!aminoAcidPattern.getIndexes(chainSequence, peptideShakerGUI.getSequenceMatchingPreferences()).isEmpty()) {
peptideTable.setValueAt(true, i, peptideTable.getColumn("PDB").getModelIndex());
peptidePdbArray.add(peptideKey);
}
if (progressDialog.isRunCanceled()) {
break;
}
}
}
// highlight the selected peptide
String peptideKey = peptideTableMap.get(getPeptideIndex(peptideTable.getSelectedRow()));
String peptideSequence = Peptide.getSequence(peptideKey);
AminoAcidPattern aminoAcidPattern = new AminoAcidPattern(peptideSequence);
for (int peptideTempStart : aminoAcidPattern.getIndexes(proteinSequence, peptideShakerGUI.getSequenceMatchingPreferences())) {
if (progressDialog.isRunCanceled()) {
break;
}
int peptideTempEnd = peptideTempStart + peptideSequence.length() - 1;
jmolPanel.getViewer().evalString(
"select resno >=" + (peptideTempStart - chains[selectedChainIndex - 1].getDifference())
+ " and resno <=" + (peptideTempEnd - chains[selectedChainIndex - 1].getDifference())
+ " and chain = " + currentChain + "; color blue");
}
// remove old labels
jmolPanel.getViewer().evalString("select all; label off");
DisplayPreferences displayPreferences = peptideShakerGUI.getDisplayPreferences();
// annotate the modified covered residues
for (int i = 0; i < peptideTable.getRowCount() && !progressDialog.isRunCanceled(); i++) {
peptideKey = peptideTableMap.get(getPeptideIndex(i));
peptideSequence = Peptide.getSequence(peptideKey);
aminoAcidPattern = new AminoAcidPattern(peptideSequence);
ArrayList<ModificationMatch> modifications = new ArrayList<ModificationMatch>();
try {
modifications = peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey).getTheoreticPeptide().getModificationMatches();
} catch (Exception e) {
peptideShakerGUI.catchException(e);
}
for (int peptideTempStart : aminoAcidPattern.getIndexes(proteinSequence, peptideShakerGUI.getSequenceMatchingPreferences())) {
if (progressDialog.isRunCanceled()) {
break;
}
int peptideTempEnd = peptideTempStart + peptideSequence.length() - 1;