new Thread("Star/Hide") {
@Override
public void run() {
try {
Identification identification = peptideShakerGUI.getIdentification();
progressDialog.setPrimaryProgressCounterIndeterminate(false);
progressDialog.setMaxPrimaryProgressCounter(identification.getProteinIdentification().size());
PSParameter psParameter = new PSParameter();
identification.loadProteinMatches(null);
identification.loadProteinMatchParameters(psParameter, null);
// @TODO: implement better database batch interaction!!
HashMap<String, ArrayList<Double>> fractionMW = new HashMap<String, ArrayList<Double>>();
for (String proteinKey : identification.getProteinIdentification()) {
if (progressDialog.isRunCanceled()) {
break;
}
ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
boolean peptideSurvived = false;
identification.loadPeptideMatches(proteinMatch.getPeptideMatchesKeys(), null);
identification.loadPeptideMatchParameters(proteinMatch.getPeptideMatchesKeys(), psParameter, null);
for (String peptideKey : proteinMatch.getPeptideMatchesKeys()) {
if (progressDialog.isRunCanceled()) {
break;
}
PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
boolean psmSurvived = false;
identification.loadSpectrumMatchParameters(peptideMatch.getSpectrumMatches(), psParameter, null);
for (String spectrumKey : peptideMatch.getSpectrumMatches()) {
if (progressDialog.isRunCanceled()) {
break;
}
psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, psParameter);
if (isPsmHidden(spectrumKey)) {
psParameter.setHidden(true);
} else {
psParameter.setHidden(false);
psmSurvived = true;
}
psParameter.setStarred(isPsmStarred(spectrumKey));
identification.updateSpectrumMatchParameter(spectrumKey, psParameter);
}
psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, psParameter);
if (!psmSurvived) {
psParameter.setHidden(true);
} else if (isPeptideHidden(peptideKey)) {
psParameter.setHidden(true);
} else {
psParameter.setHidden(false);
peptideSurvived = true;
}
psParameter.setStarred(isPeptideStarred(peptideKey));
identification.updatePeptideMatchParameter(peptideKey, psParameter);
}
psParameter = (PSParameter) identification.getProteinMatchParameter(proteinKey, psParameter);
if (!peptideSurvived) {
psParameter.setHidden(true);
} else {
psParameter.setHidden(isProteinHidden(proteinKey));
}
psParameter.setStarred(isProteinStarred(proteinKey));
identification.updateProteinMatchParameter(proteinKey, psParameter);
// update the observed fractional molecular weights per fraction
if (!psParameter.isHidden() && psParameter.getMatchValidationLevel().isValidated() && !proteinMatch.isDecoy()) {