Examples of TargetDecoyResults


Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

     * @param evt
     */
    private void fdrCombo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fdrCombo1ActionPerformed

        if (currentTargetDecoyMap != null) {
            TargetDecoyResults currentResults = currentTargetDecoyMap.getTargetDecoyResults();

            if (fdrCombo1.getSelectedIndex() == 0) {
                currentResults.setClassicalEstimators(true);
            } else {
                currentResults.setClassicalEstimators(false);
            }

            applyButton.setEnabled(true);
            this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
            int thresholdType = thresholdTypeCmb.getSelectedIndex();
View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

                            peptideShakerGUI.setUpdated(PeptideShakerGUI.SPECTRUM_ID_TAB_INDEX, false);
                            dataValidated = true;
                            validateButton.setEnabled(false);
                            double input = new Double(thresholdInput.getText());
                            int inputType = thresholdTypeCmb.getSelectedIndex();
                            TargetDecoyResults currentResults = currentTargetDecoyMap.getTargetDecoyResults();
                            currentResults.setUserInput(input);
                            currentResults.setInputType(inputType);
                            int selectedGroup = groupSelectionTable.getSelectedRow();
                            originalThresholds.put(selectedGroup, input);
                            originalThresholdTypes.put(selectedGroup, inputType);
                            peptideShakerGUI.setDataSaved(false);
                        } else {
View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

                int cpt = 0;

                modifiedMaps.put(cpt, false);
                ((DefaultTableModel) groupSelectionTable.getModel()).addRow(new Object[]{cpt + 1, "Proteins"});
                TargetDecoyMap targetDecoyMap = pSMaps.getProteinMap().getTargetDecoyMap();
                TargetDecoyResults targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
                originalThresholdTypes.put(cpt, targetDecoyResults.getInputType());
                originalThresholds.put(cpt, targetDecoyResults.getUserInput());

                ArrayList<String> peptideKeys = pSMaps.getPeptideSpecificMap().getKeys();
                if (peptideKeys.size() == 1) {
                    String key = peptideKeys.get(0);
                    peptideMap.put(++cpt, key);
                    modifiedMaps.put(cpt, false);
                    ((DefaultTableModel) groupSelectionTable.getModel()).addRow(new Object[]{cpt + 1, "Peptides"});
                    targetDecoyMap = pSMaps.getPeptideSpecificMap().getTargetDecoyMap(key);
                    targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
                    originalThresholdTypes.put(cpt, targetDecoyResults.getInputType());
                    originalThresholds.put(cpt, targetDecoyResults.getUserInput());
                } else {
                    for (String peptideKey : peptideKeys) {

                        if (progressDialog.isRunCanceled()) {
                            break;
                        }

                        peptideMap.put(++cpt, peptideKey);
                        modifiedMaps.put(cpt, false);

                        String title = PeptideSpecificMap.getKeyName(peptideShakerGUI.getSearchParameters().getModificationProfile(), peptideKey);
                        ((DefaultTableModel) groupSelectionTable.getModel()).addRow(new Object[]{cpt + 1, title + " Peptides"});
                    }
                }

                PsmSpecificMap psmSpecificMap = pSMaps.getPsmSpecificMap();
                ArrayList<Integer> foundCharges = new ArrayList<Integer>();
                HashMap<Integer, ArrayList<Integer>> groupedCharges = new HashMap<Integer, ArrayList<Integer>>();
                for (Integer charge : psmSpecificMap.getPossibleCharges()) {
                    for (String file : psmSpecificMap.getFilesAtCharge(charge)) {
                        if (!psmSpecificMap.isFileGrouped(charge, file)) {
                            foundCharges.add(charge);
                            if (progressDialog.isRunCanceled()) {
                                break;
                            }
                            HashMap<Integer, String> psmKey = new HashMap<Integer, String>();
                            psmKey.put(charge, file);
                            psmMap.put(++cpt, psmKey);
                            modifiedMaps.put(cpt, false);
                            targetDecoyMap = pSMaps.getPsmSpecificMap().getTargetDecoyMap(charge, file);
                            targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
                            originalThresholdTypes.put(cpt, targetDecoyResults.getInputType());
                            originalThresholds.put(cpt, targetDecoyResults.getUserInput());
                        }
                    }
                }
                for (int charge : psmSpecificMap.getChargesFromGroupedFiles()) {
                    int correctedCharge = psmSpecificMap.getCorrectedCharge(charge);
                    if (correctedCharge == charge) {
                        HashMap<Integer, String> psmKey = new HashMap<Integer, String>();
                        psmKey.put(charge, null);
                        psmMap.put(++cpt, psmKey);
                        modifiedMaps.put(cpt, false);
                        targetDecoyMap = pSMaps.getPsmSpecificMap().getTargetDecoyMap(charge, null);
                        targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
                        originalThresholdTypes.put(cpt, targetDecoyResults.getInputType());
                        originalThresholds.put(cpt, targetDecoyResults.getUserInput());
                    } else {
                        ArrayList<Integer> charges = groupedCharges.get(correctedCharge);
                        if (charges == null) {
                            charges = new ArrayList<Integer>();
                            groupedCharges.put(correctedCharge, charges);
View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

     */
    private void updateResults(int thresholdType, double threshold) {

        if (currentTargetDecoyMap != null) {

            TargetDecoyResults currentResults = currentTargetDecoyMap.getTargetDecoyResults();

            if (thresholdType == 0) {
                currentResults.setConfidenceLimit(threshold);
                targetDecoySeries.getConfidenceResults(currentResults);
            } else if (thresholdType == 1) {
                currentResults.setFdrLimit(threshold);
                targetDecoySeries.getFDRResults(currentResults);
            } else if (thresholdType == 2) {
                currentResults.setFnrLimit(threshold);
                targetDecoySeries.getFNRResults(currentResults);
            }
        }
    }
View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

     */
    private void updateDisplayedComponents() {

        if (currentTargetDecoyMap != null) {

            TargetDecoyResults currentResults = currentTargetDecoyMap.getTargetDecoyResults();
            int selectedGroup = groupSelectionTable.getSelectedRow();
            if (!lastThresholds.containsKey(selectedGroup)) {
                lastThresholds.put(selectedGroup, currentResults.getUserInput());
                lastThresholdTypes.put(selectedGroup, currentResults.getInputType());
            }
            nTotalTxt.setText(Util.roundDouble(currentResults.getnTPTotal(), 2) + "");
            nValidatedTxt.setText(Util.roundDouble(currentResults.getN(), 2) + "");
            nFPTxt.setText(Util.roundDouble(currentResults.getnFP(), 2) + "");
            nTPlTxt.setText(Util.roundDouble(currentResults.getnTP(), 2) + "");
            confidenceTxt.setText(Util.roundDouble(currentResults.getConfidenceLimit(), 2) + " %");
            fdrTxt.setText(Util.roundDouble(currentResults.getFdrLimit(), 2) + " %");
            fnrTxt.setText(Util.roundDouble(currentResults.getFnrLimit(), 2) + " %");
            confidenceSlider.setValue(currentResults.getConfidenceLimit().intValue());
            fdrSlider1.setValue(currentResults.getFdrLimit().intValue());
            fdrSlider2.setValue(currentResults.getFdrLimit().intValue());
            windowTxt.setText(currentTargetDecoyMap.getWindowSize() + "");
            Double newPosition = 50 * (Math.log10(currentTargetDecoyMap.getWindowSize() / (double) currentTargetDecoyMap.getnMax()) + 1);
            sensitivitySlider1.setValue(newPosition.intValue());
            thresholdTypeCmb.setSelectedIndex(lastThresholdTypes.get(selectedGroup));
            thresholdInput.setText(lastThresholds.get(selectedGroup) + "");

            if (currentResults.isClassicalEstimators()) {
                fdrCombo1.setSelectedIndex(0);
            } else {
                fdrCombo1.setSelectedIndex(1);
            }

View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

    /**
     * Sets the threshold marker.
     */
    private void setMarkers() {

        TargetDecoyResults currentResults = currentTargetDecoyMap.getTargetDecoyResults();

        confidenceMarker.setValue(currentResults.getScoreLimit());

        double[] score = {currentResults.getScoreLimit()};
        double[] fdr = {currentResults.getFdrLimit()};
        double[] fnr = {currentResults.getFnrLimit()};
        double[] benefit = {100 - currentResults.getFnrLimit()};

        DefaultXYDataset fdrData = new DefaultXYDataset();
        double[][] fdrSeries = {score, fdr};
        fdrData.addSeries("Retained FDR ", fdrSeries);
        fdrFnrPlot.setDataset(3, fdrData);
        fdrFnrPlot.mapDatasetToRangeAxis(3, 0);

        DefaultXYDataset probaFnrData = new DefaultXYDataset();
        double[][] probaFnrSeries = {score, fnr};
        probaFnrData.addSeries("Retained FNR ", probaFnrSeries);
        fdrFnrPlot.setDataset(4, probaFnrData);
        fdrFnrPlot.mapDatasetToRangeAxis(4, 0);

        XYLineAndShapeRenderer fdrRendrer = new XYLineAndShapeRenderer();
        fdrRendrer.setSeriesShapesVisible(0, true);
        fdrRendrer.setSeriesLinesVisible(0, false);
        fdrRendrer.setSeriesShape(0, DefaultDrawingSupplier.createStandardSeriesShapes()[1]);

        if (currentResults.isClassicalEstimators()) {
            fdrRendrer.setSeriesPaint(0, Color.blue);
        } else {
            fdrRendrer.setSeriesPaint(0, Color.green);
        }

View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

            for (String spectrumFile : identification.getSpectrumFiles()) {
                totalNumberOfSpectra += spectrumFactory.getNSpectra(spectrumFile);
            }
            for (int advocateId : inputMap.getInputAlgorithmsSorted()) {
                TargetDecoyMap targetDecoyMap = inputMap.getTargetDecoyMap(advocateId);
                TargetDecoyResults targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
                double nTP;
                if (targetDecoyResults == null) {
                    nTP = 0;
                } else {
                    nTP = targetDecoyResults.getnTP();
                }
                searchEngineTP.put(advocateId, nTP);
                double nFN;
                if (targetDecoyResults == null) {
                    nFN = 0;
                } else {
                    nFN = targetDecoyResults.getnTPTotal() - nTP;
                }
                searchEngineFN.put(advocateId, nFN);
                double contribution = inputMap.getAdvocateContribution(advocateId);
                searchEngineContribution.put(advocateId, contribution);
                double uniqueContribution = inputMap.getAdvocateUniqueContribution(advocateId);
                searchEngineUniqueContribution.put(advocateId, uniqueContribution);
            }
            double nTP = 0;
            double totalTP = 0;
            for (TargetDecoyMap targetDecoyMap : psmSpecificMap.getTargetDecoyMaps()) {
                TargetDecoyResults targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
                nTP += targetDecoyResults.getnTP();
                totalTP += targetDecoyResults.getnTPTotal();
            }
            searchEngineTP.put(Advocate.peptideShaker.getIndex(), nTP);
            double nFN = totalTP - nTP;
            searchEngineFN.put(Advocate.peptideShaker.getIndex(), nFN);
        } else {
            totalNumberOfSpectra = spectrumFactory.getNSpectra(selectedFileName);
            for (int advocateId : inputMap.getInputAlgorithmsSorted()) {
                TargetDecoyMap targetDecoyMap = inputMap.getTargetDecoyMap(advocateId, selectedFileName);
                TargetDecoyResults targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
                double nTP;
                if (targetDecoyResults == null) {
                    nTP = 0;
                } else {
                    nTP = targetDecoyResults.getnTP();
                }
                searchEngineTP.put(advocateId, nTP);
                double nFN;
                if (targetDecoyResults == null) {
                    nFN = 0;
                } else {
                    nFN = targetDecoyResults.getnTPTotal() - nTP;
                }
                searchEngineFN.put(advocateId, nFN);
                double contribution = inputMap.getAdvocateContribution(advocateId, selectedFileName);
                searchEngineContribution.put(advocateId, contribution);
                double uniqueContribution = inputMap.getAdvocateUniqueContribution(advocateId, selectedFileName);
View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

                if (waitingHandler.isRunCanceled()) {
                    return;
                }
                waitingHandler.increaseSecondaryProgressCounter();
                TargetDecoyMap currentMap = psmPTMMap.getTargetDecoyMap(ptmMass, mapKey);
                TargetDecoyResults currentResults = currentMap.getTargetDecoyResults();
                currentResults.setInputType(1);
                currentResults.setUserInput(psmError);
                currentResults.setClassicalEstimators(true);
                currentResults.setClassicalValidation(true);
                currentResults.setFdrLimit(psmError);
                currentMap.getTargetDecoySeries().getFDRResults(currentResults);
            }
        }
    }
View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

            AnnotationPreferences annotationPreferences, IdentificationFeaturesGenerator identificationFeaturesGenerator, InputMap inputMap) {

        waitingHandler.setWaitingText("Finding FDR thresholds. Please Wait...");

        TargetDecoyMap currentMap = proteinMap.getTargetDecoyMap();
        TargetDecoyResults currentResults = currentMap.getTargetDecoyResults();
        currentResults.setInputType(1);
        currentResults.setUserInput(aProteinFDR);
        currentResults.setClassicalEstimators(true);
        currentResults.setClassicalValidation(true);
        currentResults.setFdrLimit(aProteinFDR);
        currentMap.getTargetDecoySeries().getFDRResults(currentResults);

        ArrayList<TargetDecoyMap> psmMaps = psmMap.getTargetDecoyMaps(),
                inputMaps = inputMap.getTargetDecoyMaps();

        int max = peptideMap.getKeys().size() + psmMaps.size() + inputMap.getNalgorithms();
        waitingHandler.setSecondaryProgressCounterIndeterminate(false);
        waitingHandler.setMaxSecondaryProgressCounter(max);

        for (String mapKey : peptideMap.getKeys()) {
            if (waitingHandler.isRunCanceled()) {
                return;
            }
            waitingHandler.increaseSecondaryProgressCounter();
            currentMap = peptideMap.getTargetDecoyMap(mapKey);
            currentResults = currentMap.getTargetDecoyResults();
            currentResults.setInputType(1);
            currentResults.setUserInput(aPeptideFDR);
            currentResults.setClassicalEstimators(true);
            currentResults.setClassicalValidation(true);
            currentResults.setFdrLimit(aPeptideFDR);
            currentMap.getTargetDecoySeries().getFDRResults(currentResults);
        }

        for (TargetDecoyMap targetDecoyMap : psmMaps) {
            if (waitingHandler.isRunCanceled()) {
                return;
            }
            waitingHandler.increaseSecondaryProgressCounter();
            currentResults = targetDecoyMap.getTargetDecoyResults();
            currentResults.setInputType(1);
            currentResults.setUserInput(aPSMFDR);
            currentResults.setClassicalEstimators(true);
            currentResults.setClassicalValidation(true);
            currentResults.setFdrLimit(aPSMFDR);
            targetDecoyMap.getTargetDecoySeries().getFDRResults(currentResults);
        }

        for (TargetDecoyMap targetDecoyMap : inputMaps) {
            if (waitingHandler.isRunCanceled()) {
                return;
            }
            waitingHandler.increaseSecondaryProgressCounter();
            currentResults = targetDecoyMap.getTargetDecoyResults();
            currentResults.setInputType(1);
            currentResults.setUserInput(aPSMFDR);
            currentResults.setClassicalEstimators(true);
            currentResults.setClassicalValidation(true);
            currentResults.setFdrLimit(aPSMFDR);
            targetDecoyMap.getTargetDecoySeries().getFDRResults(currentResults);
        }

        waitingHandler.setSecondaryProgressCounterIndeterminate(false);
View Full Code Here

Examples of eu.isas.peptideshaker.scoring.targetdecoy.TargetDecoyResults

            metrics.setPeptideLengthDistribution(lengthDistribution);
        }

        // validate the proteins
        TargetDecoyMap targetDecoyMap = proteinMap.getTargetDecoyMap();
        TargetDecoyResults targetDecoyResults = targetDecoyMap.getTargetDecoyResults();
        double proteinThreshold = targetDecoyResults.getScoreLimit();
        double proteinConfidentThreshold = targetDecoyResults.getConfidenceLimit() + targetDecoyMap.getResolution();
        if (proteinConfidentThreshold > 100) {
            proteinConfidentThreshold = 100;
        }
        boolean noValidated = proteinMap.getTargetDecoyMap().getTargetDecoyResults().noValidated();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.