Examples of PSMaps


Examples of eu.isas.peptideshaker.myparameters.PSMaps

                try {
                    identification = peptideShakerGUI.getIdentification();

                    spectrumTable.getColumn("Charge").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL,
                            (double) ((PSMaps) identification.getUrParam(new PSMaps())).getPsmSpecificMap().getMaxCharge(), peptideShakerGUI.getSparklineColor()));
                    spectrumTable.getColumn("Int").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL,
                            SpectrumFactory.getInstance().getMaxIntensity(), peptideShakerGUI.getSparklineColor()));
                    spectrumTable.getColumn("RT").setCellRenderer(new JSparklinesIntervalChartTableCellRenderer(PlotOrientation.HORIZONTAL, SpectrumFactory.getInstance().getMinRT(),
                            SpectrumFactory.getInstance().getMaxRT(), SpectrumFactory.getInstance().getMaxRT() / 50, peptideShakerGUI.getSparklineColor(), peptideShakerGUI.getSparklineColor()));
                    ((JSparklinesBarChartTableCellRenderer) spectrumTable.getColumn("Charge").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 30);
                    ((JSparklinesBarChartTableCellRenderer) spectrumTable.getColumn("Int").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() + 20);
                    ((JSparklinesBarChartTableCellRenderer) spectrumTable.getColumn("Int").getCellRenderer()).setLogScale(true);
                    ((JSparklinesIntervalChartTableCellRenderer) spectrumTable.getColumn("RT").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() + 5);
                    ((JSparklinesIntervalChartTableCellRenderer) spectrumTable.getColumn("RT").getCellRenderer()).showReferenceLine(true, 0.02, java.awt.Color.BLACK);

                    PSMaps pSMaps = new PSMaps();
                    pSMaps = (PSMaps) identification.getUrParam(pSMaps);
                    eu.isas.peptideshaker.scoring.InputMap inputMap = pSMaps.getInputMap();
                    if (inputMap == null || !inputMap.hasAdvocateContribution()) {
                        // Backward compatibility
                        loadDataFromIdentification();
                    } else {
                        advocatesUsed = new ArrayList<Integer>(inputMap.getInputAlgorithmsSorted());
                        ArrayList<String> spectrumFileNames = identification.getSpectrumFiles();
                        numberOfValidatedPsmsMap = new HashMap<String, Integer>();
                        for (String fileName : spectrumFileNames) {
                            numberOfValidatedPsmsMap.put(fileName, inputMap.getAdvocateContribution(Advocate.peptideShaker.getIndex(), fileName));
                        }
                        updateOverviewPlots(inputMap, pSMaps.getPsmSpecificMap());
                    }

                    // update the advocates color legend
                    ArrayList<Integer> usedAdvocatedAndPeptideShaker = new ArrayList<Integer>();
                    usedAdvocatedAndPeptideShaker.addAll(advocatesUsed);
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

            new Thread("RecalculateThread") {
                @Override
                public void run() {

                    try {
                        PSMaps pSMaps = new PSMaps();
                        pSMaps = (PSMaps) peptideShakerGUI.getIdentification().getUrParam(pSMaps);

                        MatchesValidator matchesValidator = new MatchesValidator(pSMaps.getPsmSpecificMap(), pSMaps.getPeptideSpecificMap(), pSMaps.getProteinMap());
                        matchesValidator.validateIdentifications(peptideShakerGUI.getIdentification(), peptideShakerGUI.getMetrics(), pSMaps.getInputMap(), progressDialog, peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getAnnotationPreferences(), peptideShakerGUI.getSequenceMatchingPreferences());

                        progressDialog.setPrimaryProgressCounterIndeterminate(true);

                        if (!progressDialog.isRunCanceled()) {
                            // update the other tabs
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

                // empty the group table
                DefaultTableModel dm = (DefaultTableModel) groupSelectionTable.getModel();
                dm.getDataVector().removeAllElements();
                dm.fireTableDataChanged();

                PSMaps pSMaps = new PSMaps();
                pSMaps = (PSMaps) peptideShakerGUI.getIdentification().getUrParam(pSMaps);

                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);
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

     *
     * @return the corresponding target/decoy map
     */
    private TargetDecoyMap getTargetDecoyMap(int selectedGroup) {

        PSMaps pSMaps = new PSMaps();
        pSMaps = (PSMaps) peptideShakerGUI.getIdentification().getUrParam(pSMaps);

        if (selectedGroup == 0) {
            return pSMaps.getProteinMap().getTargetDecoyMap();
        } else if (peptideMap.containsKey(selectedGroup)) {

            return pSMaps.getPeptideSpecificMap().getTargetDecoyMap(peptideMap.get(selectedGroup));
        } else if (psmMap.containsKey(selectedGroup)) {
            HashMap<Integer, String> psmKey = psmMap.get(selectedGroup);
            for (int charge : psmKey.keySet()) {
                return pSMaps.getPsmSpecificMap().getTargetDecoyMap(charge, psmKey.get(charge));
            }
        }
        throw new IllegalArgumentException("Target decoy map not found for selection " + selectedGroup + ".");
    }
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

    /**
     * Method called whenever a new group selection occurred.
     */
    private void groupSelectionChanged() {
        PSMaps pSMaps = new PSMaps();
        pSMaps = (PSMaps) peptideShakerGUI.getIdentification().getUrParam(pSMaps);
        int selectedGroup = groupSelectionTable.getSelectedRow();

        if (selectedGroup == 0) {
            currentTargetDecoyMap = pSMaps.getProteinMap().getTargetDecoyMap();
            boolean found = false;
            // Verify that probabilities are up to date
            for (int key : psmMap.keySet()) {
                if (modifiedMaps.get(key)) {
                    found = true;
                    break;
                }
            }
            if (found) {
                int outcome = JOptionPane.showConfirmDialog(this,
                        "Probabilities modifications at the PSM level will influence protein results.\n"
                        + "Recalculate probabilities?", "Apply Changes?", JOptionPane.YES_NO_OPTION);
                if (outcome == JOptionPane.YES_OPTION) {
                    recalculatePeptidesAndProteins();
                }
            } else {
                for (int key : peptideMap.keySet()) {
                    if (modifiedMaps.get(key)) {
                        found = true;
                        break;
                    }
                }

                if (found) {
                    int outcome = JOptionPane.showConfirmDialog(this,
                            "Probabilities modifications at the peptide level will influence protein results.\n"
                            + "Recalculate probabilities?", "Apply Changes", JOptionPane.YES_NO_OPTION);
                    if (outcome == JOptionPane.YES_OPTION) {
                        recalculateProteins();
                    }
                }
            }
        } else if (peptideMap.containsKey(selectedGroup)) {

            currentTargetDecoyMap = pSMaps.getPeptideSpecificMap().getTargetDecoyMap(peptideMap.get(selectedGroup));
            boolean found = false;

            for (int key : psmMap.keySet()) {
                if (modifiedMaps.get(key)) {
                    found = true;
                    break;
                }
            }

            if (found) {
                int outcome = JOptionPane.showConfirmDialog(this,
                        "Probabilities modifications at the PSM level will influence peptide results.\n"
                        + "Recalculate probabilities?", "Apply Changes?", JOptionPane.YES_NO_OPTION);
                if (outcome == JOptionPane.YES_OPTION) {
                    recalculatePeptidesAndProteins();
                }
            }
        } else if (psmMap.containsKey(selectedGroup)) {
            HashMap<Integer, String> psmKey = psmMap.get(selectedGroup);
            for (int charge : psmKey.keySet()) {
                currentTargetDecoyMap = pSMaps.getPsmSpecificMap().getTargetDecoyMap(charge, psmKey.get(charge));
            }
        } else {
            // This should not happen
            clearScreen();
            return;
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

        new Thread("RecalculateThread") {
            @Override
            public void run() {

                PSMaps pSMaps = new PSMaps();
                pSMaps = (PSMaps) peptideShakerGUI.getIdentification().getUrParam(pSMaps);
                PeptideShaker miniShaker = new PeptideShaker(peptideShakerGUI.getExperiment(), peptideShakerGUI.getSample(), peptideShakerGUI.getReplicateNumber(), pSMaps);

                try {
                    miniShaker.spectrumMapChanged(peptideShakerGUI.getIdentification(), progressDialog, peptideShakerGUI.getProcessingPreferences(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getSequenceMatchingPreferences());
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

        new Thread("RecalculateThread") {
            @Override
            public void run() {

                PSMaps pSMaps = new PSMaps();
                pSMaps = (PSMaps) peptideShakerGUI.getIdentification().getUrParam(pSMaps);
                PeptideShaker miniShaker = new PeptideShaker(peptideShakerGUI.getExperiment(), peptideShakerGUI.getSample(), peptideShakerGUI.getReplicateNumber(), pSMaps);

                try {
                    miniShaker.peptideMapChanged(peptideShakerGUI.getIdentification(), progressDialog, peptideShakerGUI.getProcessingPreferences(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getSequenceMatchingPreferences());
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

        new Thread("RecalculateThread") {
            @Override
            public void run() {

                try {
                    PSMaps pSMaps = new PSMaps();
                    pSMaps = (PSMaps) peptideShakerGUI.getIdentification().getUrParam(pSMaps);
                    PeptideShaker miniShaker = new PeptideShaker(peptideShakerGUI.getExperiment(), peptideShakerGUI.getSample(), peptideShakerGUI.getReplicateNumber(), pSMaps);

                    miniShaker.proteinMapChanged(progressDialog, peptideShakerGUI.getProcessingPreferences());
                    modifiedMaps.put(0, false);
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

                    double accuracy = (accuracySlider.getValue() / 100.0) * peptideShakerGUI.getSearchParameters().getFragmentIonAccuracy();
                    accuracySlider.setToolTipText("Annotation Accuracy: " + Util.roundDouble(accuracy, 2) + " Da");
                    intensitySlider.setToolTipText("Annotation Level: " + intensitySlider.getValue() + "%");

                    ((JSparklinesBarChartTableCellRenderer) selectedPsmsTable.getColumn("Charge").getCellRenderer()).setMaxValue(
                            (double) ((PSMaps) peptideShakerGUI.getIdentification().getUrParam(new PSMaps())).getPsmSpecificMap().getMaxCharge());
                    ((JSparklinesBarChartTableCellRenderer) relatedPsmsTable.getColumn("Charge").getCellRenderer()).setMaxValue(
                            (double) ((PSMaps) peptideShakerGUI.getIdentification().getUrParam(new PSMaps())).getPsmSpecificMap().getMaxCharge());

                    // enable the contextual export options
                    exportModifiedPeptideProfileJButton.setEnabled(true);
                    exportRelatedPeptideProfileJButton.setEnabled(true);
                    exportSpectrumJButton.setEnabled(true);
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSMaps

                        currentPsmPlotType = PlotType.PSM_Precursor_Mass_Error;

                    } else if (psmPrecursorChargeJRadioButton.isSelected()) {

                        int maxCharge = ((PSMaps) peptideShakerGUI.getIdentification().getUrParam(new PSMaps())).getPsmSpecificMap().getMaxCharge();

                        for (int i = 0; i <= maxCharge; i++) {
                            bins.add((double) i);
                        }
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.