Package eu.isas.peptideshaker.myparameters

Examples of eu.isas.peptideshaker.myparameters.PSParameter


            }
            proteinAccessionsAsString.append(proteinAccession);
        }
        ArrayList<String> proteinGroups = identification.getProteinMatches(peptide);

        PSParameter psParameter = new PSParameter();

        ArrayList<String> spectrumKeys = peptideMatch.getSpectrumMatches();

        identification.loadSpectrumMatches(spectrumKeys, null);
        identification.loadSpectrumMatchParameters(spectrumKeys, psParameter, null);

        for (String spectrumKey : spectrumKeys) {

            psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, psParameter);
            SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);

            if (spectrumMatch.getBestPeptideAssumption() != null) { // Should always be the case

                PeptideAssumption peptideAssumption = spectrumMatch.getBestPeptideAssumption();
                peptide = peptideAssumption.getPeptide();

                int column = 1;
                HSSFRow rowHead = sheet.createRow(++currentRow);
                rowHead.setHeightInPoints(12.75f);

                Cell cell = rowHead.createCell(column++);
                MatchValidationLevel matchValidationLevel = psParameter.getMatchValidationLevel();
                // High, Medium or Low - refers to the confidence in the peptide
                if (matchValidationLevel == MatchValidationLevel.confident) {
                    cell.setCellValue("High");
                } else if (matchValidationLevel == MatchValidationLevel.doubtful) {
                    cell.setCellValue("Medium");
                } else {
                    cell.setCellValue("Low");
                }
                cell.setCellStyle(a2CellStyle);

                cell = rowHead.createCell(column++);
                cell.setCellValue(peptide.getSequenceWithLowerCasePtms()); // peptide sequence, modified residues in lower case
                cell.setCellStyle(peptideRowCellStyle);

                cell = rowHead.createCell(column++);
                cell.setCellValue(1); // number of PSMs
                cell.setCellStyle(peptideRowCellStyle);
                cell.setCellType(Cell.CELL_TYPE_NUMERIC);

                cell = rowHead.createCell(column++);
                cell.setCellValue(proteinAccessions.size()); // number of proteins
                cell.setCellStyle(peptideRowCellStyle);
                cell.setCellType(Cell.CELL_TYPE_NUMERIC);

                cell = rowHead.createCell(column++);
                cell.setCellValue(proteinGroups.size()); // number of protein groups
                cell.setCellStyle(peptideRowCellStyle);
                cell.setCellType(Cell.CELL_TYPE_NUMERIC);

                cell = rowHead.createCell(column++);
                cell.setCellValue(proteinAccessionsAsString.toString()); // protein accessions, separated by semi colon
                cell.setCellStyle(peptideRowCellStyle);

                cell = rowHead.createCell(column++);
                cell.setCellValue(getPeptideModificationsAsString(peptide)); // the modifications, separated by semi colon _and_ space // @TODO: reformat
                cell.setCellStyle(peptideRowCellStyle);

                cell = rowHead.createCell(column++);
                Double delta = psParameter.getDeltaPEP(); // PeptideShaker closest equivalent to a delta Cn
                if (delta == null) {
                    cell.setCellValue(Double.NaN);
                    // @TODO: set another type?
                } else {
                    cell.setCellValue(delta);
                    cell.setCellType(Cell.CELL_TYPE_NUMERIC);
                }
                cell.setCellStyle(peptideRowCellStyle);

                cell = rowHead.createCell(column++);
                cell.setCellValue(0); // PeptideShaker q-value // @TODO: insert real value
                cell.setCellStyle(peptideRowCellStyle);
                cell.setCellType(Cell.CELL_TYPE_NUMERIC);

                cell = rowHead.createCell(column++);
                cell.setCellValue(psParameter.getPsmProbability()); // pep value
                cell.setCellStyle(peptideRowCellStyle);
                cell.setCellType(Cell.CELL_TYPE_NUMERIC);

                cell = rowHead.createCell(column++);
                double score = psParameter.getPsmScore(); // PeptideShaker closest equivalent to an ion score
                cell.setCellValue(score);
                cell.setCellStyle(peptideRowCellStyle);
                if (score != Double.POSITIVE_INFINITY) {
                    cell.setCellType(Cell.CELL_TYPE_NUMERIC);
                }

                cell = rowHead.createCell(column++);
                cell.setCellValue(psParameter.getPsmProbabilityScore()); // PeptideShaker closest equivalent to an e-value
                cell.setCellStyle(peptideRowCellStyle);
                cell.setCellType(Cell.CELL_TYPE_NUMERIC);

                cell = rowHead.createCell(column++);
                cell.setCellValue(peptideAssumption.getIdentificationCharge().value); // charge
View Full Code Here


    public static void updatePeptideAssumptionValidationLevel(IdentificationFeaturesGenerator identificationFeaturesGenerator, SearchParameters searchParameters,
            AnnotationPreferences annotationPreferences, InputMap inputMap, String spectrumKey, PeptideAssumption peptideAssumption, PeptideSpectrumAnnotator peptideSpectrumAnnotator)
            throws SQLException, IOException, ClassNotFoundException, InterruptedException, MzMLUnmarshallerException {

        SequenceFactory sequenceFactory = SequenceFactory.getInstance();
        PSParameter psParameter = new PSParameter();
        psParameter = (PSParameter) peptideAssumption.getUrParam(psParameter);
        psParameter.resetQcResults();

        if (sequenceFactory.concatenatedTargetDecoy()) {

            TargetDecoyMap targetDecoyMap = inputMap.getTargetDecoyMap(peptideAssumption.getAdvocate());
            TargetDecoyResults targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
            double seThreshold = targetDecoyResults.getScoreLimit();
            double confidenceThreshold = targetDecoyResults.getConfidenceLimit() + targetDecoyMap.getResolution();

            if (confidenceThreshold > 100) {
                confidenceThreshold = 100;
            }

            boolean noValidated = targetDecoyResults.noValidated();

            if (!noValidated && peptideAssumption.getScore() <= seThreshold) { //@TODO: include ascending/descending scores

                String reasonDoubtful = null;
                boolean filterPassed = true;

                for (AssumptionFilter filter : inputMap.getDoubtfulMatchesFilters()) {
                    boolean validated = filter.isValidated(spectrumKey, peptideAssumption, searchParameters, annotationPreferences, peptideSpectrumAnnotator);
                    psParameter.setQcResult(filter.getName(), validated);
                    if (!validated) {
                        filterPassed = false;
                        if (reasonDoubtful == null) {
                            reasonDoubtful = "";
                        } else {
                            reasonDoubtful += ", ";
                        }
                        reasonDoubtful += filter.getDescription();
                    }
                }

                boolean confidenceThresholdPassed = psParameter.getSearchEngineConfidence() >= confidenceThreshold; //@TODO: not sure whether we should include all 100% confidence hits by default?

                if (!confidenceThresholdPassed) {
                    if (reasonDoubtful == null) {
                        reasonDoubtful = "";
                    } else {
                        reasonDoubtful += ", ";
                    }
                    reasonDoubtful += "Low confidence";
                }

                boolean enoughHits = targetDecoyMap.getnTargetOnly() > 100;

                if (!enoughHits) {
                    if (reasonDoubtful == null) {
                        reasonDoubtful = "";
                    } else {
                        reasonDoubtful += ", ";
                    }
                    reasonDoubtful += "Low number of hits";
                }

                if (!sequenceFactory.hasEnoughSequences()) {
                    if (reasonDoubtful == null) {
                        reasonDoubtful = "";
                    } else {
                        reasonDoubtful += ", ";
                    }
                    reasonDoubtful += "Database too small";
                }

                if (filterPassed && confidenceThresholdPassed && enoughHits && sequenceFactory.hasEnoughSequences()) {
                    psParameter.setMatchValidationLevel(MatchValidationLevel.confident);
                } else {
                    psParameter.setMatchValidationLevel(MatchValidationLevel.doubtful);
                    if (reasonDoubtful != null) {
                        psParameter.setReasonDoubtful(reasonDoubtful);
                    }
                }
            } else {
                psParameter.setMatchValidationLevel(MatchValidationLevel.not_validated);
            }
        } else {
            psParameter.setMatchValidationLevel(MatchValidationLevel.none);
        }
    }
View Full Code Here

    public void fillPeptideMaps(Identification identification, Metrics metrics, WaitingHandler waitingHandler,
            SequenceMatchingPreferences sequenceMatchingPreferences) throws SQLException, IOException, ClassNotFoundException, InterruptedException {

        waitingHandler.setWaitingText("Filling Peptide Maps. Please Wait...");

        PSParameter psParameter = new PSParameter();

        waitingHandler.setSecondaryProgressCounterIndeterminate(false);
        waitingHandler.setMaxSecondaryProgressCounter(identification.getPeptideIdentification().size() * 2);

        ArrayList<String> foundModifications = new ArrayList<String>();
        HashMap<String, ArrayList<String>> fractionPsmMatches = new HashMap<String, ArrayList<String>>();

        // load the peptides into memory
        identification.loadPeptideMatches(identification.getPeptideIdentification(), waitingHandler);

        for (String peptideKey : identification.getPeptideIdentification()) {
            for (String modification : Peptide.getModificationFamily(peptideKey)) {
                if (!foundModifications.contains(modification)) {
                    foundModifications.add(modification);
                }
            }

            double probaScore = 1;
            HashMap<String, Double> fractionScores = new HashMap<String, Double>();
            PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);

            // get the fraction scores
            identification.loadSpectrumMatchParameters(peptideMatch.getSpectrumMatches(), psParameter, null);
            for (String spectrumKey : peptideMatch.getSpectrumMatches()) {
                psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, psParameter);
                probaScore = probaScore * psParameter.getPsmProbability();
                String fraction = Spectrum.getSpectrumFile(spectrumKey);

                if (!fractionScores.containsKey(fraction)) {
                    fractionScores.put(fraction, 1.0);
                }

                fractionScores.put(fraction, fractionScores.get(fraction) * psParameter.getPsmProbability());

                if (!fractionPsmMatches.containsKey(fraction + "_" + peptideKey)) {
                    ArrayList<String> spectrumMatches = new ArrayList<String>(1);
                    spectrumMatches.add(spectrumKey);
                    fractionPsmMatches.put(fraction + "_" + peptideKey, spectrumMatches);
                } else {
                    fractionPsmMatches.get(fraction + "_" + peptideKey).add(spectrumKey);
                }
            }

            psParameter = new PSParameter();
            psParameter.setPeptideProbabilityScore(probaScore);
            psParameter.setSpecificMapKey(peptideMap.getKey(peptideMatch));

            // set the fraction scores
            for (String fractionName : fractionScores.keySet()) {
                psParameter.setFractionScore(fractionName, fractionScores.get(fractionName));
            }

            identification.addPeptideMatchParameter(peptideKey, psParameter);
            peptideMap.addPoint(probaScore, peptideMatch, sequenceMatchingPreferences);

View Full Code Here

    public void attachPeptideProbabilities(Identification identification, WaitingHandler waitingHandler)
            throws SQLException, IOException, ClassNotFoundException, InterruptedException {

        waitingHandler.setWaitingText("Attaching Peptide Probabilities. Please Wait...");

        PSParameter psParameter = new PSParameter();

        waitingHandler.setSecondaryProgressCounterIndeterminate(false);
        waitingHandler.setMaxSecondaryProgressCounter(identification.getPeptideIdentification().size());

        identification.loadPeptideMatchParameters(psParameter, null);

        for (String peptideKey : identification.getPeptideIdentification()) {

            psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, psParameter);

            if (sequenceFactory.concatenatedTargetDecoy()) {
                psParameter.setPeptideProbability(peptideMap.getProbability(psParameter.getSpecificMapKey(), psParameter.getPeptideProbabilityScore()));
            } else {
                psParameter.setPeptideProbability(1.0);
            }
            for (String fraction : psParameter.getFractions()) {
                if (sequenceFactory.concatenatedTargetDecoy()) {
                    psParameter.setFractionPEP(fraction, peptideMap.getProbability(psParameter.getSpecificMapKey(), psParameter.getFractionScore(fraction)));
                } else {
                    psParameter.setFractionPEP(fraction, 1.0);
                }
            }

            identification.updatePeptideMatchParameter(peptideKey, psParameter);
            waitingHandler.increaseSecondaryProgressCounter();
View Full Code Here

     */
    public void fillProteinMap(Identification identification, WaitingHandler waitingHandler) throws Exception {

        waitingHandler.setWaitingText("Filling Protein Map. Please Wait...");

        PSParameter psParameter = new PSParameter();

        int max = identification.getProteinIdentification().size();

        waitingHandler.setSecondaryProgressCounterIndeterminate(false);
        waitingHandler.setMaxSecondaryProgressCounter(max);

        identification.loadPeptideMatchParameters(psParameter, null);
        identification.loadProteinMatches(null);

        for (String proteinKey : identification.getProteinIdentification()) {

            waitingHandler.increaseSecondaryProgressCounter();
            if (waitingHandler.isRunCanceled()) {
                return;
            }

            HashMap<String, Double> fractionScores = new HashMap<String, Double>();
            double probaScore = 1;
            ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);

            if (proteinMatch == null) {
                throw new IllegalArgumentException("Protein match " + proteinKey + " not found.");
            }

            // get the fraction scores
            identification.loadPeptideMatchParameters(proteinMatch.getPeptideMatchesKeys(), psParameter, null); // @TODO: already covered by the loadPeptideMatchParameters call above?
            for (String peptideKey : proteinMatch.getPeptideMatchesKeys()) {

                psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, psParameter);
                probaScore = probaScore * psParameter.getPeptideProbability();

                for (String fraction : psParameter.getFractions()) {
                    if (!fractionScores.containsKey(fraction)) {
                        fractionScores.put(fraction, 1.0);
                    }

                    fractionScores.put(fraction, fractionScores.get(fraction) * psParameter.getFractionPEP(fraction));
                }
            }

            psParameter = new PSParameter();
            psParameter.setProteinProbabilityScore(probaScore);

            // set the fraction scores
            for (String fractionName : fractionScores.keySet()) {
                psParameter.setFractionScore(fractionName, fractionScores.get(fractionName));
            }

            identification.addProteinMatchParameter(proteinKey, psParameter); // @TODO: batch insertion?
            proteinMap.addPoint(probaScore, proteinMatch.isDecoy());
        }
View Full Code Here

        waitingHandler.setWaitingText("Attaching Protein Probabilities. Please Wait...");

        waitingHandler.setSecondaryProgressCounterIndeterminate(false);
        waitingHandler.setMaxSecondaryProgressCounter(identification.getProteinIdentification().size());

        PSParameter psParameter = new PSParameter();
        HashMap<String, ArrayList<Double>> fractionMW = new HashMap<String, ArrayList<Double>>();

        for (String proteinKey : identification.getProteinIdentification()) {

            //@TODO: this molecular weigth stuff should not be done here!
            ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
            Double proteinMW = sequenceFactory.computeMolecularWeight(proteinMatch.getMainMatch());

            psParameter = (PSParameter) identification.getProteinMatchParameter(proteinKey, psParameter);
            if (sequenceFactory.concatenatedTargetDecoy()) {
                double proteinProbability = proteinMap.getProbability(psParameter.getProteinProbabilityScore());
                psParameter.setProteinProbability(proteinProbability);
            } else {
                psParameter.setProteinProbability(1.0);
            }

            for (String fraction : psParameter.getFractions()) {
                if (sequenceFactory.concatenatedTargetDecoy()) {
                    psParameter.setFractionPEP(fraction, proteinMap.getProbability(psParameter.getFractionScore(fraction)));
                } else {
                    psParameter.setFractionPEP(fraction, 1.0);
                }

                // set the fraction molecular weights
                if (!proteinMatch.isDecoy() && psParameter.getFractionConfidence(fraction) > processingPreferences.getProteinConfidenceMwPlots()) {
                    if (fractionMW.containsKey(fraction)) {
                        fractionMW.get(fraction).add(proteinMW);
                    } else {
                        ArrayList<Double> mw = new ArrayList<Double>();
                        mw.add(proteinMW);
View Full Code Here

                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()) {

                            Double proteinMW = sequenceFactory.computeMolecularWeight(proteinMatch.getMainMatch());

                            for (String fraction : psParameter.getFractions()) {

                                // set the fraction molecular weights
                                if (psParameter.getFractionConfidence(fraction) > peptideShakerGUI.getProcessingPreferences().getProteinConfidenceMwPlots()) {
                                    if (fractionMW.containsKey(fraction)) {
                                        fractionMW.get(fraction).add(proteinMW);
                                    } else {
                                        ArrayList<Double> mw = new ArrayList<Double>();
                                        mw.add(proteinMW);
View Full Code Here

            SearchParameters searchParameters, SequenceMatchingPreferences sequenceMatchingPreferences, WaitingHandler waitingHandler)
            throws IOException, IllegalArgumentException, SQLException, ClassNotFoundException, InterruptedException {

        waitingHandler.setWaitingText("Cleaning Protein Groups. Please Wait...");

        PSParameter psParameter = new PSParameter();
        ArrayList<String> toRemove = new ArrayList<String>();
        int maxProteinKeyLength = 0;

        int max = 3 * identification.getProteinIdentification().size();

        identification.loadProteinMatchParameters(psParameter, null);
        identification.loadProteinMatches(waitingHandler);

        waitingHandler.setSecondaryProgressCounterIndeterminate(false);
        waitingHandler.setMaxSecondaryProgressCounter(max);

        for (String proteinSharedKey : identification.getProteinIdentification()) {

            if (ProteinMatch.getNProteins(proteinSharedKey) > 1) {

                psParameter = (PSParameter) identification.getProteinMatchParameter(proteinSharedKey, psParameter);
                double sharedProteinProbabilityScore = psParameter.getProteinProbabilityScore();
                boolean better = false;

                for (String accession : ProteinMatch.getAccessions(proteinSharedKey)) {
                    for (String proteinUniqueKey : identification.getProteinMap().get(accession)) {
                        if (ProteinMatch.contains(proteinSharedKey, proteinUniqueKey)) {
                            psParameter = (PSParameter) identification.getProteinMatchParameter(proteinUniqueKey, psParameter);
                            double uniqueProteinProbabilityScore = psParameter.getProteinProbabilityScore();
                            ProteinMatch proteinUnique = identification.getProteinMatch(proteinUniqueKey);
                            ProteinMatch proteinShared = identification.getProteinMatch(proteinSharedKey);
                            for (String sharedPeptideKey : proteinShared.getPeptideMatchesKeys()) {
                                proteinUnique.addPeptideMatchKey(sharedPeptideKey);
                            }
                            identification.updateProteinMatch(proteinUnique);
                            if (uniqueProteinProbabilityScore <= sharedProteinProbabilityScore) {
                                better = true;
                            }
                        }
                    }
                }

                if (better) {
                    toRemove.add(proteinSharedKey);
                } else {
                    waitingHandler.increaseSecondaryProgressCounter();
                    if (waitingHandler.isRunCanceled()) {
                        return;
                    }
                }
            }
        }

        for (String proteinKey : toRemove) {
            psParameter = (PSParameter) identification.getProteinMatchParameter(proteinKey, psParameter);
            proteinMap.removePoint(psParameter.getProteinProbabilityScore(), ProteinMatch.isDecoy(proteinKey));
            identification.removeProteinMatch(proteinKey);
            waitingHandler.increaseSecondaryProgressCounter();
        }

        int nSolved = toRemove.size();
        int nGroups = 0;
        int nLeft = 0;

        // As we go through all protein ids, keep the sorted list of proteins and maxima in the instance of the Metrics class to pass them to the GUI afterwards
        // proteins are sorted according to the protein score, then number of peptides (inverted), then number of spectra (inverted).
        HashMap<Double, HashMap<Integer, HashMap<Integer, ArrayList<String>>>> orderMap
                = new HashMap<Double, HashMap<Integer, HashMap<Integer, ArrayList<String>>>>();
        PSParameter probabilities = new PSParameter();
        double maxMW = 0;

        identification.loadProteinMatches(null);
        for (String proteinKey : identification.getProteinIdentification()) {
            ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);

            if (!ProteinMatch.isDecoy(proteinKey)) {
                probabilities = (PSParameter) identification.getProteinMatchParameter(proteinKey, probabilities);
                double score = probabilities.getProteinProbabilityScore();
                int nPeptides = -proteinMatch.getPeptideMatchesKeys().size();
                int nSpectra = 0;

                Protein currentProtein = sequenceFactory.getProtein(proteinMatch.getMainMatch());

View Full Code Here

     */
    public void starProtein(String match) throws IOException, ClassNotFoundException, SQLException, InterruptedException {
        try {
            Identification identification = peptideShakerGUI.getIdentification();
            FilterPreferences filterPreferences = peptideShakerGUI.getFilterPreferences();
            PSParameter psParameter = new PSParameter();
            psParameter = (PSParameter) identification.getProteinMatchParameter(match, psParameter);
            boolean validated = false;

            for (ProteinFilter matchFilter : filterPreferences.getProteinStarFilters().values()) {
                if (matchFilter.getExceptions().contains(match)) {
                    matchFilter.removeException(match);
                }
                if (matchFilter.isValidated(match, peptideShakerGUI.getIdentification(), peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getAnnotationPreferences())) {
                    validated = true;
                }
            }

            if (!validated) {
                ProteinFilter proteinFilter;
                if (!filterPreferences.getProteinStarFilters().containsKey(MatchFilter.MANUAL_SELECTION)) {
                    proteinFilter = new ProteinFilter(MatchFilter.MANUAL_SELECTION);
                    proteinFilter.setDescription("Manual selection via the graphical interface");
                    filterPreferences.getProteinStarFilters().put(proteinFilter.getName(), proteinFilter);
                } else {
                    proteinFilter = filterPreferences.getProteinStarFilters().get(MatchFilter.MANUAL_SELECTION);
                }
                proteinFilter.addManualValidation(match);
            }

            psParameter.setStarred(true);
            identification.updateProteinMatchParameter(match, psParameter);
            peptideShakerGUI.setDataSaved(false);
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
        }
View Full Code Here

    public void unStarProtein(String match) throws IOException, ClassNotFoundException, SQLException, InterruptedException {

        try {
            Identification identification = peptideShakerGUI.getIdentification();
            FilterPreferences filterPreferences = peptideShakerGUI.getFilterPreferences();
            PSParameter psParameter = new PSParameter();
            psParameter = (PSParameter) identification.getProteinMatchParameter(match, psParameter);

            for (ProteinFilter matchFilter : filterPreferences.getProteinStarFilters().values()) {
                if (matchFilter.getManualValidation().contains(match)) {
                    matchFilter.removeManualValidation(match);
                }
                if (matchFilter.isValidated(match, peptideShakerGUI.getIdentification(), peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getAnnotationPreferences())) {
                    matchFilter.addException(match);
                }
            }

            psParameter.setStarred(false);
            identification.updateProteinMatchParameter(match, psParameter);
            peptideShakerGUI.setDataSaved(false);
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
        }
View Full Code Here

TOP

Related Classes of eu.isas.peptideshaker.myparameters.PSParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.