Package com.compomics.util.experiment.identification.matches

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


                    case 1:
                        int idSoftwareAgreement;
                        if (!identification.matchExists(spectrumKey)) {
                            idSoftwareAgreement = NO_ID;
                        } else {
                            SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);
                            idSoftwareAgreement = isBestPsmEqualForAllIdSoftware(spectrumMatch, peptideShakerGUI.getSequenceMatchingPreferences());
                        }
                        return idSoftwareAgreement;
                    case 2:
                        return spectrumFactory.getSpectrumTitles(fileSelected).get(row);
                    case 3:
                        Precursor precursor = peptideShakerGUI.getPrecursor(spectrumKey, false);
                        if (precursor != null) {
                            return precursor.getMz();
                        } else {
                            return null;
                        }
                    case 4:
                        precursor = peptideShakerGUI.getPrecursor(spectrumKey, false);
                        Integer charge = null;
                        if (precursor != null && !precursor.getPossibleCharges().isEmpty()) {
                            charge = precursor.getPossibleCharges().get(0).value; // @TODO: find a way of displaying multiple charges!!!
                        }
                        return charge;
                    case 5:
                        precursor = peptideShakerGUI.getPrecursor(spectrumKey, false);
                        if (precursor != null) {
                            return precursor.getIntensity();
                        } else {
                            return null;
                        }
                    case 6:
                        precursor = peptideShakerGUI.getPrecursor(spectrumKey, false);
                        if (precursor != null) {
                            return precursor.getRt();
                        } else {
                            return null;
                        }
                    case 7:
                        if (identification.matchExists(spectrumKey)) {
                            SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);
                            DisplayFeaturesGenerator displayFeaturesGenerator = peptideShakerGUI.getDisplayFeaturesGenerator();
                            if (spectrumMatch.getBestPeptideAssumption() != null) {
                                return displayFeaturesGenerator.getTaggedPeptideSequence(spectrumMatch, true, true, true);
                            } else if (spectrumMatch.getBestTagAssumption() != null) {
                                //TODO: include fixed ptms
                                return spectrumMatch.getBestTagAssumption().getTag().getTaggedModifiedSequence(peptideShakerGUI.getSearchParameters().getModificationProfile(), true, true, true, false, false);
                            }
                        }
                        return null;
                    case 8:
                        if (identification.matchExists(spectrumKey)) {
                            SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);
                            DisplayFeaturesGenerator displayFeaturesGenerator = peptideShakerGUI.getDisplayFeaturesGenerator();
                            if (spectrumMatch.getBestPeptideAssumption() != null) {
                                return displayFeaturesGenerator.addDatabaseLinks(spectrumMatch.getBestPeptideAssumption().getPeptide().getParentProteins(
                                        peptideShakerGUI.getSequenceMatchingPreferences()));
                            }
                        }
                        return null;
                    case 9:
View Full Code Here


        if (proteinKey.equals(PeptideShakerGUI.NO_SELECTION)
                && peptideKey.equals(PeptideShakerGUI.NO_SELECTION)
                && !psmKey.equals(PeptideShakerGUI.NO_SELECTION)) {
            if (peptideShakerGUI.getIdentification().matchExists(psmKey)) {
                try {
                    SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(psmKey);
                    if (spectrumMatch.getBestPeptideAssumption() != null) {
                        Peptide peptide = spectrumMatch.getBestPeptideAssumption().getPeptide();
                        peptideKey = peptide.getMatchingKey(peptideShakerGUI.getSequenceMatchingPreferences());
                    }
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                    return;
View Full Code Here

            if (column == selectedPsmsTable.getColumn("Sequence").getModelIndex()) {

                try {
                    String spectrumKey = identification.getPeptideMatch(getSelectedPeptide(false)).getSpectrumMatches().get(row);
                    SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);
                    selectedPsmsTable.setToolTipText(peptideShakerGUI.getDisplayFeaturesGenerator().getPeptideModificationTooltipAsHtml(spectrumMatch));
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                    e.printStackTrace();
                }
View Full Code Here

        if (row != -1 && column != -1 && relatedPsmsTable.getValueAt(row, column) != null) {
            if (column == relatedPsmsTable.getColumn("Sequence").getModelIndex()) {
                try {
                    String spectrumKey = identification.getPeptideMatch(getSelectedPeptide(true)).getSpectrumMatches().get(row);
                    SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);
                    relatedPsmsTable.setToolTipText(peptideShakerGUI.getDisplayFeaturesGenerator().getPeptideModificationTooltipAsHtml(spectrumMatch));
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                    e.printStackTrace();
                }
View Full Code Here

        if (selectedKey.equals(PeptideShakerGUI.NO_SELECTION)
                && !peptideShakerGUI.getSelectedPsmKey().equals(PeptideShakerGUI.NO_SELECTION)) {
            String psmKey = peptideShakerGUI.getSelectedPsmKey();
            if (peptideShakerGUI.getIdentification().matchExists(psmKey)) {
                try {
                    SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(psmKey);
                    if (spectrumMatch.getBestPeptideAssumption() != null) {
                        Peptide peptide = spectrumMatch.getBestPeptideAssumption().getPeptide();
                        selectedKey = peptide.getMatchingKey(peptideShakerGUI.getSequenceMatchingPreferences());
                    }
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                    return;
View Full Code Here

            MSnSpectrum currentSpectrum = peptideShakerGUI.getSpectrum(spectrumKey);

            if (currentSpectrum != null && currentSpectrum.getMzValuesAsArray().length > 0) {

                Precursor precursor = currentSpectrum.getPrecursor();
                SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(spectrumKey);
                spectrum = new SpectrumPanel(
                        currentSpectrum.getMzValuesAsArray(), currentSpectrum.getIntensityValuesAsArray(),
                        precursor.getMz(), spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().toString(),
                        "", 40, false, false, false, 2, false);
                spectrum.setKnownMassDeltas(peptideShakerGUI.getCurrentMassDeltas());
                spectrum.setDeltaMassWindow(peptideShakerGUI.getAnnotationPreferences().getFragmentIonAccuracy());
                spectrum.setBorder(null);
                spectrum.setDataPointAndLineColor(peptideShakerGUI.getUtilitiesUserPreferences().getSpectrumAnnotatedPeakColor(), 0);
                spectrum.setPeakWaterMarkColor(peptideShakerGUI.getUtilitiesUserPreferences().getSpectrumBackgroundPeakColor());
                spectrum.setPeakWidth(peptideShakerGUI.getUtilitiesUserPreferences().getSpectrumAnnotatedPeakWidth());
                spectrum.setBackgroundPeakWidth(peptideShakerGUI.getUtilitiesUserPreferences().getSpectrumBackgroundPeakWidth());

                // get the spectrum annotations
                PeptideAssumption peptideAssumption = spectrumMatch.getBestPeptideAssumption();
                Peptide peptide = peptideAssumption.getPeptide();
                int identificationCharge = spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().value;
                annotationPreferences.setCurrentSettings(peptideAssumption, !currentSpectrumKey.equalsIgnoreCase(spectrumMatch.getKey()), peptideShakerGUI.getSequenceMatchingPreferences());
                ArrayList<IonMatch> annotations = annotator.getSpectrumAnnotation(annotationPreferences.getIonTypes(),
                        annotationPreferences.getNeutralLosses(),
                        annotationPreferences.getValidatedCharges(),
                        identificationCharge,
                        currentSpectrum, peptide,
                        currentSpectrum.getIntensityLimit(annotationPreferences.getAnnotationIntensityLimit()),
                        annotationPreferences.getFragmentIonAccuracy(), false, annotationPreferences.isHighResolutionAnnotation());
                currentSpectrumKey = spectrumMatch.getKey();

                // add the spectrum annotations
                spectrum.setAnnotations(SpectrumAnnotator.getSpectrumAnnotation(annotations));
                spectrum.showAnnotatedPeaksOnly(!annotationPreferences.showAllPeaks());
                spectrum.setYAxisZoomExcludesBackgroundPeaks(annotationPreferences.yAxisZoomExcludesBackgroundPeaks());
View Full Code Here

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

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

                        if (!psmParameter.isHidden() && spectrumMatch.getBestPeptideAssumption() != null) {

                            Precursor precursor = peptideShakerGUI.getPrecursor(spectrumKey);
                            double value = spectrumMatch.getBestPeptideAssumption().getDeltaMass(
                                    precursor.getMz(),
                                    peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm());
                            if (value > maxValue) {
                                maxValue = value;
                            }

                            if (!spectrumMatch.getBestPeptideAssumption().getPeptide().isDecoy(peptideShakerGUI.getSequenceMatchingPreferences())) {
                                if (psmParameter.getMatchValidationLevel().isValidated()) {
                                    if (psmParameter.getMatchValidationLevel() == MatchValidationLevel.confident) {
                                        validatedValues.add(value);
                                    } else {
                                        validatedDoubtfulValues.add(value);
                                    }
                                } else {
                                    nonValidatedValues.add(value);
                                }
                            } else {
                                if (psmParameter.getMatchValidationLevel().isValidated()) {
                                    validatedDecoyValues.add(value);
                                } else {
                                    nonValidatedDecoyValues.add(value);
                                }
                            }
                        }

                        progressDialog.increasePrimaryProgressCounter();
                    }
                }
            } else if (psmPrecursorChargeJRadioButton.isSelected()) {

                // Values for the precursor charge
                validatedValues = new ArrayList<Double>();
                validatedDoubtfulValues = new ArrayList<Double>();
                nonValidatedValues = new ArrayList<Double>();
                validatedDecoyValues = new ArrayList<Double>();
                nonValidatedDecoyValues = new ArrayList<Double>();

                for (String spectrumFileName : identification.getSpectrumFiles()) {
                    identification.loadSpectrumMatches(spectrumFileName, progressDialog);
                    identification.loadSpectrumMatchParameters(spectrumFileName, psmParameter, progressDialog);
                    for (String spectrumKey : identification.getSpectrumIdentification(spectrumFileName)) {
                        if (progressDialog.isRunCanceled()) {
                            break;
                        }

                        SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(spectrumKey);
                        psmParameter = (PSParameter) peptideShakerGUI.getIdentification().getSpectrumMatchParameter(spectrumKey, psmParameter);

                        if (!psmParameter.isHidden() && spectrumMatch.getBestPeptideAssumption() != null) {

                            double value = spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().value;
                            if (value > maxValue) {
                                maxValue = value;
                            }

                            if (!spectrumMatch.getBestPeptideAssumption().getPeptide().isDecoy(peptideShakerGUI.getSequenceMatchingPreferences())) {
                                if (psmParameter.getMatchValidationLevel().isValidated()) {
                                    if (psmParameter.getMatchValidationLevel() == MatchValidationLevel.confident) {
                                        validatedValues.add(value);
                                    } else {
                                        validatedDoubtfulValues.add(value);
View Full Code Here

                        return;
                    }
                    waitingHandler.increaseSecondaryProgressCounter();
                }

                SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);

                for (int advocateId : spectrumMatch.getAdvocates()) {
                    HashMap<Double, ArrayList<SpectrumIdentificationAssumption>> assumptions = spectrumMatch.getAllAssumptions(advocateId);
                    ArrayList<Double> scores = new ArrayList<Double>(assumptions.keySet());
                    Collections.sort(scores);
                    for (double score : scores) {
                        for (SpectrumIdentificationAssumption assumption : assumptions.get(score)) {
View Full Code Here

            identification.loadSpectrumMatches(spectrumFileName, null);

            for (String spectrumKey : identification.getSpectrumIdentification(spectrumFileName)) {

                waitingHandler.increaseSecondaryProgressCounter();
                SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);

                for (int advocateIndex : spectrumMatch.getAdvocates()) {
                    for (double eValue : spectrumMatch.getAllAssumptions(advocateIndex).keySet()) {
                        for (SpectrumIdentificationAssumption assumption : spectrumMatch.getAllAssumptions(advocateIndex).get(eValue)) {

                            if (assumption instanceof PeptideAssumption) {

                                PeptideAssumption peptideAssumption = (PeptideAssumption) assumption;
                                annotationPreferences.setCurrentSettings(peptideAssumption, true, sequenceMatchingPreferences);
View Full Code Here

            for (String spectrumKey : identification.getSpectrumIdentification(spectrumFileName)) {

                waitingHandler.increaseSecondaryProgressCounter();

                SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);

                for (int advocateIndex : spectrumMatch.getAdvocates()) {

                    for (double eValue : spectrumMatch.getAllAssumptions(advocateIndex).keySet()) {

                        for (SpectrumIdentificationAssumption assumption : spectrumMatch.getAllAssumptions(advocateIndex).get(eValue)) {

                            if (assumption instanceof PeptideAssumption) {

                                psParameter = (PSParameter) assumption.getUrParam(psParameter);
View Full Code Here

TOP

Related Classes of com.compomics.util.experiment.identification.matches.SpectrumMatch

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.