Package com.compomics.util.experiment.massspectrometry

Examples of com.compomics.util.experiment.massspectrometry.Precursor


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


                        spectrumKey = identification.getPeptideMatch(getSelectedPeptide(relatedTable)).getSpectrumMatches().get(row);
                        return identification.getSpectrumMatch(spectrumKey).getBestPeptideAssumption().getIdentificationCharge().value;
                    case 5:
                        spectrumKey = identification.getPeptideMatch(getSelectedPeptide(relatedTable)).getSpectrumMatches().get(row);
                        try {
                            Precursor precursor = peptideShakerGUI.getPrecursor(spectrumKey); // @TODO: there is sometimes an IOException when closing the tool...

                            if (precursor != null) {
                                return precursor.getRt();
                            } else {
                                return null;
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
View Full Code Here

            for (int i = 0; i < relatedPsmsTable.getRowCount(); i++) {

                progressDialog.increasePrimaryProgressCounter();

                String spectrumKey = identification.getPeptideMatch(getSelectedPeptide(true)).getSpectrumMatches().get(i);
                Precursor precursor = peptideShakerGUI.getPrecursor(spectrumKey, false);

                if (precursor != null) {

                    double retentionTime = precursor.getRt();

                    if (!retentionTimeValues && retentionTime != -1) {
                        retentionTimeValues = true;
                    }
View Full Code Here

            AnnotationPreferences annotationPreferences = peptideShakerGUI.getAnnotationPreferences();
            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);
View Full Code Here

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

                    return "0";
                }
            case identification_charge:
                return peptideAssumption.getIdentificationCharge().toString();
            case isotope:
                Precursor precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return peptideAssumption.getIsotopeNumber(precursor.getMz()) + "";
            case mz:
                precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return precursor.getMz() + "";
            case total_spectrum_intensity:
                Spectrum spectrum = SpectrumFactory.getInstance().getSpectrum(spectrumKey);
                return spectrum.getTotalIntensity() + "";
            case max_intensity:
                spectrum = SpectrumFactory.getInstance().getSpectrum(spectrumKey);
                return spectrum.getMaxIntensity() + "";
            case intensity_coverage:
                spectrum = SpectrumFactory.getInstance().getSpectrum(spectrumKey);
                double coveredIntensity = 0;
                Peptide peptide = peptideAssumption.getPeptide();
                ArrayList<IonMatch> matches = peptideSpectrumAnnotator.getSpectrumAnnotation(
                        annotationPreferences.getIonTypes(), annotationPreferences.getNeutralLosses(), annotationPreferences.getValidatedCharges(),
                        peptideAssumption.getIdentificationCharge().value,
                        (MSnSpectrum) spectrum, peptide, 0, searchParameters.getFragmentIonAccuracy(), false, true);
                for (IonMatch ionMatch : matches) {
                    coveredIntensity += ionMatch.peak.intensity;
                }
                double coverage = 100 * coveredIntensity / spectrum.getTotalIntensity();
                return coverage + "";
            case mz_error:
                precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return peptideAssumption.getDeltaMass(precursor.getMz(), true) + "";
            case rt:
                precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return precursor.getRt() + "";
            case algorithm_score:
                int id = peptideAssumption.getAdvocate();
                double score = peptideAssumption.getScore();
                return Advocate.getAdvocate(id).getName() + " (" + score + ")";
            case sequence:
                return peptideAssumption.getPeptide().getSequence();
            case missed_cleavages:
                String sequence = peptideAssumption.getPeptide().getSequence();
                return Peptide.getNMissedCleavages(sequence, searchParameters.getEnzyme()) + "";
            case modified_sequence:
                return peptideAssumption.getPeptide().getTaggedModifiedSequence(searchParameters.getModificationProfile(), false, false, true) + "";
            case spectrum_charge:
                precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return precursor.getPossibleChargesAsString() + "";
            case spectrum_file:
                String spectrumFile = Spectrum.getSpectrumFile(spectrumKey);
                return spectrumFile;
            case spectrum_scan_number:
                return SpectrumFactory.getInstance().getSpectrum(spectrumKey).getScanNumber();
View Full Code Here

                    return "0";
                }
            case identification_charge:
                return tagAssumption.getIdentificationCharge().toString();
            case isotope:
                Precursor precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return tagAssumption.getIsotopeNumber(precursor.getMz()) + "";
            case mz:
                precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return precursor.getMz() + "";
            case total_spectrum_intensity:
                Spectrum spectrum = SpectrumFactory.getInstance().getSpectrum(spectrumKey);
                return spectrum.getTotalIntensity() + "";
            case max_intensity:
                spectrum = SpectrumFactory.getInstance().getSpectrum(spectrumKey);
                return spectrum.getMaxIntensity() + "";
            case mz_error:
                precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return tagAssumption.getDeltaMass(precursor.getMz(), true) + "";
            case rt:
                precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return precursor.getRt() + "";
            case algorithm_score:
                int id = tagAssumption.getAdvocate();
                double score = tagAssumption.getScore();
                return Advocate.getAdvocate(id).getName() + " (" + score + ")";
            case sequence:
                return tagAssumption.getTag().asSequence();
            case missed_cleavages:
                return "";
            case modified_sequence:
                return tagAssumption.getTag().getTaggedModifiedSequence(searchParameters.getModificationProfile(), false, false, true, false);
            case spectrum_charge:
                precursor = SpectrumFactory.getInstance().getPrecursor(spectrumKey);
                return precursor.getPossibleChargesAsString() + "";
            case spectrum_file:
                String spectrumFile = Spectrum.getSpectrumFile(spectrumKey);
                return spectrumFile;
            case spectrum_scan_number:
                return SpectrumFactory.getInstance().getSpectrum(spectrumKey).getScanNumber();
View Full Code Here

                MSnSpectrum currentSpectrum = peptideShakerGUI.getSpectrum(key);
                SpectrumPanel tempSpectrumPanel = null;
                AnnotationPreferences annotationPreferences = peptideShakerGUI.getAnnotationPreferences();

                if (currentSpectrum != null) {
                    Precursor precursor = currentSpectrum.getPrecursor();
                    String charge;
                    if (identification.matchExists(currentSpectrumKey)) {
                        SpectrumMatch spectrumMatch = identification.getSpectrumMatch(currentSpectrumKey);
                        if (spectrumMatch.getBestPeptideAssumption() != null) {
                            charge = spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().toString();
                        } else if (spectrumMatch.getBestTagAssumption() != null) {
                            charge = spectrumMatch.getBestTagAssumption().getIdentificationCharge().toString();
                        } else {
                            throw new IllegalArgumentException("Best hit not found for spectrum " + key + ".");
                        }
                    } else {
                        charge = precursor.getPossibleChargesAsString();
                    }
                    if (currentSpectrum.getMzValuesAsArray().length > 0 && currentSpectrum.getIntensityValuesAsArray().length > 0) {
                        tempSpectrumPanel = new SpectrumPanel(
                                currentSpectrum.getMzValuesAsArray(), currentSpectrum.getIntensityValuesAsArray(),
                                precursor.getMz(), charge,
                                "", 40, false, false, false, 2, false);
                        tempSpectrumPanel.setKnownMassDeltas(peptideShakerGUI.getCurrentMassDeltas());
                        tempSpectrumPanel.setDeltaMassWindow(annotationPreferences.getFragmentIonAccuracy());
                        tempSpectrumPanel.setBorder(null);
                        tempSpectrumPanel.setDataPointAndLineColor(peptideShakerGUI.getUtilitiesUserPreferences().getSpectrumAnnotatedPeakColor(), 0);
View Full Code Here

                if (spectrumKey == null) {
                    return "";
                }
                PSParameter psParameter;
                SpectrumMatch spectrumMatch;
                Precursor precursor;
                switch (column) {
                    case 0:
                        return row + 1;
                    case 1:
                        psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, new PSParameter());
                        return psParameter.isStarred();
                    case 2:
                        psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, new PSParameter());
                        return psParameter.isHidden();
                    case 3:
                        return Spectrum.getSpectrumFile(spectrumKey);
                    case 4:
                        return Spectrum.getSpectrumTitle(spectrumKey);
                    case 5:
                        precursor = peptideShakerGUI.getPrecursor(spectrumKey);
                        return precursor.getRt();
                    case 6:
                        precursor = peptideShakerGUI.getPrecursor(spectrumKey);
                        return precursor.getMz();
                    case 7:
                        spectrumMatch = identification.getSpectrumMatch(spectrumKey);
                        if (spectrumMatch.getBestPeptideAssumption() != null) {
                            return spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().value;
                        } else if (spectrumMatch.getBestTagAssumption() != null) {
                            return spectrumMatch.getBestTagAssumption().getIdentificationCharge().value;
                        } else {
                            throw new IllegalArgumentException("No best assumption found for spectrum " + spectrumKey + ".");
                        }
                    case 8:
                        spectrumMatch = identification.getSpectrumMatch(spectrumKey);
                        precursor = peptideShakerGUI.getPrecursor(spectrumKey);
                        if (spectrumMatch.getBestPeptideAssumption() != null) {
                            return Math.abs(spectrumMatch.getBestPeptideAssumption().getDeltaMass(precursor.getMz(), peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm()));
                        } else if (spectrumMatch.getBestTagAssumption() != null) {
                            return Math.abs(spectrumMatch.getBestTagAssumption().getDeltaMass(precursor.getMz(), peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm()));
                        } else {
                            throw new IllegalArgumentException("No best assumption found for spectrum " + spectrumKey + ".");
                        }
                    case 9:
                        psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, new PSParameter());
View Full Code Here

                                lowerMzZoomRange = spectrumPanel.getXAxisZoomRangeLowerValue();
                                upperMzZoomRange = spectrumPanel.getXAxisZoomRangeUpperValue();
                            }

                            // add the data to the spectrum panel
                            Precursor precursor = currentSpectrum.getPrecursor();
                            SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(spectrumKey);
                            spectrumPanel = new SpectrumPanel(
                                    currentSpectrum.getMzValuesAsArray(), currentSpectrum.getIntensityValuesAsArray(),
                                    precursor.getMz(), spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().toString(),
                                    "", 40, false, false, false, 2, false);
                            spectrumPanel.setKnownMassDeltas(peptideShakerGUI.getCurrentMassDeltas());
                            spectrumPanel.setDeltaMassWindow(peptideShakerGUI.getAnnotationPreferences().getFragmentIonAccuracy());
                            spectrumPanel.setBorder(null);
                            spectrumPanel.setDataPointAndLineColor(peptideShakerGUI.getUtilitiesUserPreferences().getSpectrumAnnotatedPeakColor(), 0);
View Full Code Here

TOP

Related Classes of com.compomics.util.experiment.massspectrometry.Precursor

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.