Examples of PeptideMatch


Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

        super(aPeptideShakerGUI, modal);

        this.peptideMatchKey = peptideMatchKey;
        this.peptideShakerGUI = aPeptideShakerGUI;

        PeptideMatch peptideMatch = peptideShakerGUI.getIdentification().getPeptideMatch(peptideMatchKey);

        initComponents();

        PSParameter psParameter = new PSParameter();
        psParameter = (PSParameter) peptideShakerGUI.getIdentification().getPeptideMatchParameter(peptideMatchKey, psParameter);
        protInferenceTypeCmb.setSelectedIndex(psParameter.getProteinInferenceClass());

        protInferenceTypeCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));

        // make sure that the scroll panes are see-through
        proteinsJScrollPane.getViewport().setOpaque(false);
        otherProteinsJScrollPane.getViewport().setOpaque(false);

        // set up the table properties
        otherProteinJTable.getTableHeader().setReorderingAllowed(false);
        otherProteinJTable.getColumn("Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));

        retainedProteinJTable.getTableHeader().setReorderingAllowed(false);
        retainedProteinJTable.getColumn("Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));

        // insert the values
        sequenceLabel.setText(peptideShakerGUI.getDisplayFeaturesGenerator().getTaggedPeptideSequence(peptideMatch, true, true, true));

        // set the modification tooltip
        String tooltip = peptideShakerGUI.getDisplayFeaturesGenerator().getPeptideModificationTooltipAsHtml(peptideShakerGUI.getIdentification().getPeptideMatch(peptideMatchKey));
        sequenceLabel.setToolTipText(tooltip);

        ArrayList<String> possibleProteins = peptideMatch.getTheoreticPeptide().getParentProteins(peptideShakerGUI.getSequenceMatchingPreferences());
        List<String> retainedProteins;

        if (proteinMatchKey != null) {
            retainedProteins = Arrays.asList(ProteinMatch.getAccessions(proteinMatchKey));
        } else {
            retainedProteins = new ArrayList<String>();
            for (String proteinKey : peptideShakerGUI.getIdentification().getProteinMatches(peptideMatch.getTheoreticPeptide())) {
                for (String protein : possibleProteins) {
                    if (!retainedProteins.contains(protein) && proteinKey.contains(protein)) {
                        retainedProteins.add(protein);
                        if (retainedProteins.size() == possibleProteins.size()) {
                            break;
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

        }

        String psmKey = PeptideShakerGUI.NO_SELECTION;

        try {
            PeptideMatch peptideMatch = getIdentification().getPeptideMatch(peptideKey);
            ArrayList<String> psmKeys;

            try {
                psmKeys = getIdentificationFeaturesGenerator().getSortedPsmKeys(peptideKey);
            } catch (Exception e) {
                try {
                    // try without order
                    psmKeys = peptideMatch.getSpectrumMatches();
                } catch (Exception e1) {
                    e1.printStackTrace();
                    psmKeys = new ArrayList<String>();
                }
            }
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

                            return DisplayPreferences.LOADING_MESSAGE;
                        }
                    }
                    return psParameter.getProteinInferenceClass();
                case 3:
                    PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey, useDB && !isScrolling);
                    if (peptideMatch == null) {
                        if (isScrolling()) {
                            return null;
                        } else if (!useDB) {
                            dataMissingAtRow(row);
                            return Peptide.getSequence(peptideKey);
                        }
                    }
                    return peptideShakerGUI.getDisplayFeaturesGenerator().getTaggedPeptideSequence(peptideMatch, true, true, true);
                case 4:
                    if (isScrolling) {
                        return null;
                    }
                    ArrayList<Integer> indexes;
                    if (sequenceFactory == null) {
                        return null;
                    }
                    try {
                        Protein currentProtein = sequenceFactory.getProtein(proteinAccession);
                        String peptideSequence = Peptide.getSequence(peptideKey);
                        indexes = currentProtein.getPeptideStart(peptideSequence,
                                peptideShakerGUI.getSequenceMatchingPreferences());
                    } catch (IOException e) {
                        peptideShakerGUI.catchException(e);
                        return "IO Exception";
                    }
                    Collections.sort(indexes);
                    return new StartIndexes(indexes); // note: have to be "packed" like this in order to be able to resetSorting on the first index if multiple indexes
                case 5:
                    if (isScrolling) {
                        return null;
                    }
                    peptideMatch = identification.getPeptideMatch(peptideKey, useDB);
                    if (!useDB
                            && (peptideMatch == null || !peptideShakerGUI.getIdentificationFeaturesGenerator().nValidatedSpectraForPeptideInCache(peptideKey))
                            && (peptideMatch == null || !identification.peptideDetailsInCache(peptideKey))) {
                        dataMissingAtRow(row);
                        return DisplayPreferences.LOADING_MESSAGE;
                    }

                    double nConfidentSpectra = peptideShakerGUI.getIdentificationFeaturesGenerator().getNConfidentSpectraForPeptide(peptideKey);
                    double nDoubtfulSpectra = peptideShakerGUI.getIdentificationFeaturesGenerator().getNValidatedSpectraForPeptide(peptideKey) - nConfidentSpectra;
                    int nSpectra = peptideMatch.getSpectrumMatches().size();

                    ArrayList<Double> doubleValues = new ArrayList<Double>();
                    doubleValues.add(nConfidentSpectra);
                    doubleValues.add(nDoubtfulSpectra);
                    doubleValues.add(nSpectra - nConfidentSpectra - nDoubtfulSpectra);
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

        try {
            if (column == 0) {
                return row + 1;
            } else if (column == 1) {
                String peptideKey = peptideKeys.get(row);
                PeptideMatch peptideMatch = peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey);
                return peptideShakerGUI.getDisplayFeaturesGenerator().getTaggedPeptideSequence(peptideMatch, true, true, true);
            } else if (column > 1 && column - 2 < fileNames.size()) {
                String fraction = fileNames.get(column - 2);
                PSParameter pSParameter = new PSParameter();
                String peptideKey = peptideKeys.get(row);
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

                        }

                        if (!peptideMatches.isEmpty()) {
                            identification.loadPeptideMatches(peptideMatches, null);
                            for (String peptideKey : peptideMatches) {
                                PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
                                ArrayList<String> validatedPsms = new ArrayList<String>();
                                identification.loadSpectrumMatchParameters(peptideMatch.getSpectrumMatches(), psParameter, null);
                                for (String spectrumKey : peptideMatch.getSpectrumMatches()) {
                                    psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, psParameter);
                                    if (psParameter.getMatchValidationLevel().isValidated()) {
                                        validatedPsms.add(spectrumKey);
                                    }
                                }
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

        if (peptideFilter.getNSpectra() != null
                || peptideFilter.getNValidatedSpectra() != null
                || peptideFilter.getNConfidentSpectra() != null
                || peptideFilter.getProtein() != null) {
            PeptideMatch peptideMatch = identification.getPeptideMatch(peptideMatchKey);

            if (peptideFilter.getNSpectra() != null) {
                if (peptideFilter.getnSpectraComparison() == ComparisonType.AFTER) {
                    if (peptideMatch.getSpectrumCount() <= peptideFilter.getNSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnSpectraComparison() == ComparisonType.BEFORE) {
                    if (peptideMatch.getSpectrumCount() >= peptideFilter.getNSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnSpectraComparison() == ComparisonType.EQUAL) {
                    if (peptideMatch.getSpectrumCount() != peptideFilter.getNSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnSpectraComparison() == ComparisonType.NOT_EQUAL) {
                    if (peptideMatch.getSpectrumCount() != peptideFilter.getNSpectra()) {
                        return false;
                    }
                }
            }

            if (peptideFilter.getNValidatedSpectra() != null) {
                int nValidatedSpectra = identificationFeaturesGenerator.getNValidatedSpectraForPeptide(peptideMatchKey);
                if (peptideFilter.getnValidatedSpectraComparison() == ComparisonType.AFTER) {
                    if (nValidatedSpectra <= peptideFilter.getNValidatedSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnValidatedSpectraComparison() == ComparisonType.BEFORE) {
                    if (nValidatedSpectra >= peptideFilter.getNValidatedSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnValidatedSpectraComparison() == ComparisonType.EQUAL) {
                    if (nValidatedSpectra != peptideFilter.getNValidatedSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnValidatedSpectraComparison() == ComparisonType.NOT_EQUAL) {
                    if (nValidatedSpectra != peptideFilter.getNValidatedSpectra()) {
                        return false;
                    }
                }
            }

            if (peptideFilter.getNConfidentSpectra() != null) {
                int nConfidentPeptides = identificationFeaturesGenerator.getNConfidentSpectraForPeptide(peptideMatchKey);
                if (peptideFilter.getnConfidentSpectraComparison() == ComparisonType.AFTER) {
                    if (nConfidentPeptides <= peptideFilter.getNConfidentSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnConfidentSpectraComparison() == ComparisonType.BEFORE) {
                    if (nConfidentPeptides >= peptideFilter.getNConfidentSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnConfidentSpectraComparison() == ComparisonType.EQUAL) {
                    if (nConfidentPeptides != peptideFilter.getNConfidentSpectra()) {
                        return false;
                    }
                } else if (peptideFilter.getnConfidentSpectraComparison() == ComparisonType.NOT_EQUAL) {
                    if (nConfidentPeptides != peptideFilter.getNConfidentSpectra()) {
                        return false;
                    }
                }
            }

            if (peptideFilter.getProtein() != null) {
                 boolean found = false;
                for (String accession : peptideMatch.getTheoreticPeptide().getParentProteinsNoRemapping()) {
                    if (accession.split(peptideFilter.getProtein()).length > 1) {
                        found = true;
                        break;
                    }
                    if (sequenceFactory.getHeader(accession).getSimpleProteinDescription() != null
                            && sequenceFactory.getHeader(accession).getSimpleProteinDescription().split(peptideFilter.getProtein()).length > 1) {
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    return false;
                }
            }
        }

        // sequence pattern
        if (peptideFilter.getSequence() != null && peptideFilter.getSequence().trim().length() > 0) {
            PeptideMatch peptideMatch = identification.getPeptideMatch(peptideMatchKey);
            String peptideSequence = peptideMatch.getTheoreticPeptide().getSequence();
            Matcher m;
            if (peptideFilter.getSequencePattern() != null) {
                m = peptideFilter.getSequencePattern().matcher(peptideSequence);
            } else {
                Pattern p = Pattern.compile("(.*?)" + peptideFilter.getSequence() + "(.*?)");
                m = p.matcher(peptideSequence);
            }
            if (!m.matches()) {
                return false;
            }
        }

        // protein pattern
        if (peptideFilter.getProtein() != null && peptideFilter.getProtein().trim().length() > 0) {
            PeptideMatch peptideMatch = identification.getPeptideMatch(peptideMatchKey);
            String accessions = "";
            for (String accession : peptideMatch.getTheoreticPeptide().getParentProteinsNoRemapping()) {
                accessions += accession + " ";
            }
            Matcher m;
            if (peptideFilter.getProteinPattern() != null) {
                m = peptideFilter.getProteinPattern().matcher(accessions);
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

        ArrayList<String> peptideKeys = new ArrayList<String>(proteinMatch.getPeptideMatchesKeys());
        for (String peptideKey : peptideKeys) {
            psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, psParameter);
            if (psParameter.getMatchValidationLevel().isValidated() && Peptide.isModified(peptideKey)) {
                PeptideMatch peptideMath = identification.getPeptideMatch(peptideKey);
                String peptideSequence = Peptide.getSequence(peptideKey);
                if (peptideMath.getUrParam(new PSPtmScores()) == null || scorePeptides) {
                    scorePTMs(identification, peptideMath, searchParameters, annotationPreferences, ptmScoringPreferences, sequenceMatchingPreferences);
                }
                PSPtmScores peptideScores = (PSPtmScores) peptideMath.getUrParam(new PSPtmScores());
                if (peptideScores != null) {

                    if (protein == null) {
                        protein = sequenceFactory.getProtein(proteinMatch.getMainMatch());
                    }
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

        identification.loadPeptideMatches(null);

        ArrayList<String> peptideKeys = new ArrayList<String>(identification.getPeptideIdentification());
        for (String peptideKey : peptideKeys) {
            PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
            scorePTMs(identification, peptideMatch, searchParameters, annotationPreferences, ptmScoringPreferences, sequenceMatchingPreferences);
            waitingHandler.increaseSecondaryProgressCounter();
            if (waitingHandler.isRunCanceled()) {
                return;
            }
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

        // batch load the required data
        identification.loadPeptideMatches(proteinMatch.getPeptideMatchesKeys(), null);

        for (String peptideKey : proteinMatch.getPeptideMatchesKeys()) {
            PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
            String peptideSequence = peptideMatch.getTheoreticPeptide().getSequence();
            boolean enzymaticPeptide = true;
            if (!allPeptides) {
                enzymaticPeptide = currentProtein.isEnzymaticPeptide(peptideSequence, searchParameters.getEnzyme(),
                        sequenceMatchingPreferences);
            }
View Full Code Here

Examples of com.compomics.util.experiment.identification.matches.PeptideMatch

                }
            }

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