Package eu.isas.peptideshaker.utils

Examples of eu.isas.peptideshaker.utils.IdentificationFeaturesGenerator


        progressDialog.setValue(0);

        try {

            Identification identification = peptideShakerGUI.getIdentification();
            IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();

            PSParameter proteinParameter = new PSParameter();
            maxValue = Double.MIN_VALUE;

            validatedValues = new ArrayList<Double>();
            validatedDoubtfulValues = new ArrayList<Double>();
            nonValidatedValues = new ArrayList<Double>();
            validatedDecoyValues = new ArrayList<Double>();
            nonValidatedDecoyValues = new ArrayList<Double>();

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

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

                double value = 0;

                if (proteinNumberValidatedPeptidesJRadioButton.isSelected()) {
                    value = identificationFeaturesGenerator.getNValidatedPeptides(proteinKey);
                } else if (proteinSpectrumCountingScoreJRadioButton.isSelected()) {
                    value = identificationFeaturesGenerator.getSpectrumCounting(proteinKey);
                } else if (proteinSequenceCoverageJRadioButton.isSelected()) {
                        HashMap<Integer, Double> sequenceCoverage;
                        try {
                            sequenceCoverage = peptideShakerGUI.getIdentificationFeaturesGenerator().getSequenceCoverage(proteinKey);
                        } catch (Exception e) {
View Full Code Here


                            exportType = FastaExport.ExportType.getTypeFromIndex(proteinExportCmb1.getSelectedIndex());
                        } else {
                            exportType = FastaExport.ExportType.getTypeFromIndex(proteinExportCmb2.getSelectedIndex());
                        }
                        SequenceFactory sequenceFactory = SequenceFactory.getInstance();
                        IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();

                        progressDialog.setPrimaryProgressCounterIndeterminate(false);
                        if (exportType == FastaExport.ExportType.non_validated) {
                            progressDialog.setMaxPrimaryProgressCounter(sequenceFactory.getAccessions().size());
                        } else {
                            progressDialog.setMaxPrimaryProgressCounter(identificationFeaturesGenerator.getNValidatedProteins());
                        }

                        FastaExport.export(selectedFile, peptideShakerGUI.getIdentification(), identificationFeaturesGenerator, exportType, progressDialog, peptideShakerGUI.getFilterPreferences(), finalAccessionsOnly);

                        boolean processCancelled = progressDialog.isRunCanceled();
View Full Code Here

                ((DefaultTableModel) peptideTable.getModel()).fireTableDataChanged();

                String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Peptides (";
                try {
                    IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();
                    int nValidatedPeptides = identificationFeaturesGenerator.getNValidatedPeptides(proteinMatchKey);
                    int nConfidentPeptides = identificationFeaturesGenerator.getNConfidentPeptides(proteinMatchKey);
                    int nPeptides = proteinMatch.getPeptideCount();
                    if (nConfidentPeptides > 0) {
                        title += nValidatedPeptides + "/" + nPeptides + " - " + nConfidentPeptides + " confident, " + (nValidatedPeptides - nConfidentPeptides) + " doubtful";
                    } else {
                        title += nValidatedPeptides + "/" + nPeptides;
View Full Code Here

     */
    public void updatePeptidePanelTitle() {
        String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Peptides (";
        try {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
            IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();
            String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));
            ProteinMatch proteinMatch = peptideShakerGUI.getIdentification().getProteinMatch(proteinKey);
            int nValidatedPeptides = identificationFeaturesGenerator.getNValidatedPeptides(proteinKey);
            int nConfidentPeptides = identificationFeaturesGenerator.getNConfidentPeptides(proteinKey);
            int nPeptides = proteinMatch.getPeptideCount();
            if (nConfidentPeptides > 0) {
                title += nValidatedPeptides + "/" + nPeptides + " - " + nConfidentPeptides + " confident, " + (nValidatedPeptides - nConfidentPeptides) + " doubtful";
            } else {
                title += nValidatedPeptides + "/" + nPeptides;
View Full Code Here

     * @throws java.lang.ClassNotFoundException
     * @throws java.lang.InterruptedException
     */
    public void updatePsmPanelTitle() throws SQLException, IOException, ClassNotFoundException, InterruptedException {
        SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
        IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();
        int peptideIndex = tableModel.getViewIndex(peptideTable.getSelectedRow());
        String peptideKey = peptideKeys.get(peptideIndex);
        int nValidatedPsms = identificationFeaturesGenerator.getNValidatedSpectraForPeptide(peptideKey);
        int nConfidentPsms = identificationFeaturesGenerator.getNConfidentSpectraForPeptide(peptideKey);
        int nPsms = psmTable.getRowCount();
        String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Peptide-Spectrum Matches (";
        if (nConfidentPsms > 0) {
            title += nValidatedPsms + "/" + nPsms + " - " + nConfidentPsms + " confident, " + (nValidatedPsms - nConfidentPsms) + " doubtful";
        } else {
View Full Code Here

                    selectedPeptideStart.add(startIndex - 1);
                }
                selectionLength = peptideSequence.length();
            }

            IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();

            int[] validationCoverage;
            if (coverageShowAllPeptidesJRadioButtonMenuItem.isSelected()) {
                validationCoverage = identificationFeaturesGenerator.getAACoverage(proteinKey);
            } else {
                validationCoverage = identificationFeaturesGenerator.estimateAACoverage(proteinKey, coverageShowEnzymaticPeptidesOnlyJRadioButtonMenuItem.isSelected());
            }

            double minHeight = 0.2, maxHeight = 1;
            NonSymmetricalNormalDistribution peptideLengthDistribution = peptideShakerGUI.getMetrics().getPeptideLengthDistribution();
            if (peptideLengthDistribution != null) {
                double medianLength = peptideLengthDistribution.getMean();
                maxHeight = (1 - minHeight) * peptideLengthDistribution.getProbabilityAt(medianLength);
            }

            double[] coverageLikelihood = identificationFeaturesGenerator.getCoverableAA(proteinKey);
            double[] coverageHeight = new double[coverageLikelihood.length];
            for (int i = 0; i < coverageLikelihood.length; i++) {
                double p = coverageLikelihood[i];
                coverageHeight[i] = minHeight + p / maxHeight;
            }
View Full Code Here

        if (row != -1) {
            this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));

            try {
                Identification identification = peptideShakerGUI.getIdentification();
                IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();
                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
                int peptideIndex = tableModel.getViewIndex(row);
                String peptideKey = peptideKeys.get(peptideIndex);
                try {
                    psmKeys = identificationFeaturesGenerator.getSortedPsmKeys(peptideKey);
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                    try {
                        // ok let's try without order
                        PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
                        psmKeys = peptideMatch.getSpectrumMatches();
                    } catch (Exception e1) {
                        // just hope the GUI holds...
                        peptideShakerGUI.catchException(e1);
                        psmKeys = new ArrayList<String>();
                    }
                }

                // clear the selection in case more than one row was selected for the last peptide
                psmTable.clearSelection();

                // update the table model
                if (psmTable.getModel() instanceof PsmTableModel) {
                    ((PsmTableModel) psmTable.getModel()).updateDataModel(peptideShakerGUI, psmKeys);
                    ((PsmTableModel) psmTable.getModel()).setSelfUpdating(true);
                    ((PsmTableModel) psmTable.getModel()).resetSorting(new ProgressDialogX(peptideShakerGUI,
                            Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")),
                            Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")),
                            true));
                } else {
                    PsmTableModel psmTableModel = new PsmTableModel(peptideShakerGUI, psmKeys);
                    psmTable.setModel(psmTableModel);
                }

                setPsmTableProperties();
                showSparkLines(peptideShakerGUI.showSparklines());

                int nValidatedPsms = identificationFeaturesGenerator.getNValidatedSpectraForPeptide(peptideKey);
                int nConfidentPsms = identificationFeaturesGenerator.getNConfidentSpectraForPeptide(peptideKey);
                int nPsms = psmTable.getRowCount();
                String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Peptide-Spectrum Matches (";
                if (nConfidentPsms > 0) {
                    title += nValidatedPsms + "/" + nPsms + " - " + nConfidentPsms + " confident, " + (nValidatedPsms - nConfidentPsms) + " doubtful";
                } else {
View Full Code Here

            this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));

            try {
                Identification identification = peptideShakerGUI.getIdentification();
                IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();

                String proteinMatchKey = proteinKeys.get(proteinIndex);
                ProteinMatch proteinMatch = identification.getProteinMatch(proteinMatchKey);
                String accession = proteinMatch.getMainMatch();

                try {
                    peptideKeys = identificationFeaturesGenerator.getSortedPeptideKeys(proteinMatchKey);
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                    try {
                        // Let's try without order
                        peptideKeys = proteinMatch.getPeptideMatchesKeys();
View Full Code Here

    public void processIdentifications(InputMap inputMap, WaitingHandler waitingHandler, SearchParameters searchParameters, AnnotationPreferences annotationPreferences,
            IdFilter idFilter, ProcessingPreferences processingPreferences, PTMScoringPreferences ptmScoringPreferences, SpectrumCountingPreferences spectrumCountingPreferences, ProjectDetails projectDetails, SequenceMatchingPreferences sequenceMatchingPreferences)
            throws IllegalArgumentException, IOException, Exception {

        Identification identification = experiment.getAnalysisSet(sample).getProteomicAnalysis(replicateNumber).getIdentification(IdentificationMethod.MS2_IDENTIFICATION);
        identificationFeaturesGenerator = new IdentificationFeaturesGenerator(identification, searchParameters, idFilter, metrics, spectrumCountingPreferences, sequenceMatchingPreferences);

        if (!objectsCache.memoryCheck()) {
            waitingHandler.appendReport("PeptideShaker is encountering memory issues! See http://peptide-shaker.googlecode.com for help.", true, true);
        }
        if (waitingHandler.isRunCanceled()) {
View Full Code Here

TOP

Related Classes of eu.isas.peptideshaker.utils.IdentificationFeaturesGenerator

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.