Package com.compomics.util.experiment.massspectrometry

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


                                                    }
                                                    if (title) {
                                                        writer.write(Spectrum.getSpectrumTitle(spectrumMatch.getKey()) + SEPARATOR);
                                                    }
                                                    if (precursor) {
                                                        Precursor prec = spectrumFactory.getPrecursor(spectrumMatch.getKey());
                                                        writer.write(prec.getMz() + SEPARATOR);
                                                        writer.write(peptideAssumption.getIdentificationCharge().value + SEPARATOR);
                                                        writer.write(prec.getRt() + SEPARATOR);
                                                        writer.write(peptideAssumption.getPeptide().getMass() + SEPARATOR);
                                                        writer.write(peptideAssumption.getDeltaMass(prec.getMz(),
                                                                peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm()) + SEPARATOR);
                                                        writer.write(peptideAssumption.getIsotopeNumber(prec.getMz()) + SEPARATOR);
                                                    }
                                                    if (scores) {
                                                        for (Integer advocateIndex : peptideShakerGUI.getProjectDetails().getIdentificationAlgorithms()) {
                                                            if (se == advocateIndex) {
                                                                writer.write("" + eValue);
View Full Code Here


                cell.setCellValue(identification.getPeptideMatch(peptideKey).getTheoreticPeptide().getMass()
                        + ElementaryIon.proton.getTheoreticMass()); // theoretical mass for single charge: MH+ [Da]
                cell.setCellStyle(peptideRowCellStyle);
                cell.setCellType(Cell.CELL_TYPE_NUMERIC);

                Precursor precursor = spectrumFactory.getPrecursor(spectrumKey);

                cell = rowHead.createCell(column++);
                cell.setCellValue(peptideAssumption.getDeltaMass(precursor.getMz(), true)); // mass error in ppm
                cell.setCellStyle(peptideRowCellStyle);
                cell.setCellType(Cell.CELL_TYPE_NUMERIC);

                cell = rowHead.createCell(column++);
                Double rt = precursor.getRt();
                if (rt > 0) {
                    rt /= 60;
                } else {
                    rt = Double.NaN;
                }
View Full Code Here

                                                }
                                                if (title) {
                                                    writer.write(Spectrum.getSpectrumTitle(spectrumMatch.getKey()) + SEPARATOR);
                                                }
                                                if (precursor) {
                                                    Precursor prec = spectrumFactory.getPrecursor(spectrumMatch.getKey());
                                                    writer.write(prec.getMz() + SEPARATOR);
                                                    writer.write(prec.getPossibleChargesAsString() + SEPARATOR);
                                                    writer.write(bestAssumption.getIdentificationCharge().value + SEPARATOR);
                                                    writer.write(prec.getRt() + SEPARATOR);
                                                    writer.write(bestAssumption.getPeptide().getMass() + SEPARATOR);
                                                    writer.write(bestAssumption.getDeltaMass(prec.getMz(), peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm()) + SEPARATOR);
                                                    writer.write(bestAssumption.getIsotopeNumber(prec.getMz()) + SEPARATOR);
                                                }
                                                if (score) {
                                                    writer.write(psParameter.getPsmScore() + SEPARATOR);
                                                }
                                                if (confidence) {
View Full Code Here

                                }
                                writer.write(nPhospho + SEPARATOR);
                                writer.write(nSites + SEPARATOR);
                                writer.write(spectrumFile + SEPARATOR);
                                writer.write(Spectrum.getSpectrumTitle(spectrumMatch.getKey()) + SEPARATOR);
                                Precursor prec = spectrumFactory.getPrecursor(spectrumMatch.getKey());
                                writer.write(prec.getMz() + SEPARATOR);
                                writer.write(bestAssumption.getIdentificationCharge().value + SEPARATOR);
                                writer.write(prec.getRt() + SEPARATOR);
                                writer.write(bestAssumption.getPeptide().getMass() + SEPARATOR);
                                writer.write(bestAssumption.getDeltaMass(prec.getMz(), peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm()) + SEPARATOR);
                                writer.write(bestAssumption.getIsotopeNumber(prec.getMz()) + SEPARATOR);
                                writer.write(psParameter.getPsmConfidence() + SEPARATOR);
                                MatchValidationLevel matchValidationLevel = psParameter.getMatchValidationLevel();
                                writer.write(matchValidationLevel.toString());
                                if (matchValidationLevel == MatchValidationLevel.doubtful && !psParameter.getReasonDoubtful().equals("")) {
                                    writer.write(" (" + psParameter.getReasonDoubtful() + ")");
View Full Code Here

                        orderingMap.put(charge, new HashMap<Double, ArrayList<String>>());
                    }
                    if (hasRT) {
                        try {

                            Precursor precursor = spectrumFactory.getPrecursor(spectrumKey, true);
                            rt = precursor.getRt();

                            if (rt == -1) {
                                hasRT = false;
                            }
                        } catch (Exception e) {
View Full Code Here

                                        if (spectrumKey.toLowerCase().contains(input)) {
                                            possibilities.get(jumpType).add(spectrumKey);
                                            types.get(jumpType).add(Type.SPECTRUM);
                                        } else {
                                            try {
                                                Precursor precursor = peptideShakerGUI.getPrecursor(spectrumKey, false);
                                                doubleString = precursor.getMz() + "";
                                                if (doubleString.startsWith(input)) {
                                                    possibilities.get(jumpType).add(spectrumKey);
                                                    types.get(jumpType).add(Type.SPECTRUM);
                                                } else {
                                                    doubleString = precursor.getRt() + "";
                                                    if (doubleString.startsWith(input)) {
                                                        possibilities.get(jumpType).add(spectrumKey);
                                                        types.get(jumpType).add(Type.SPECTRUM);
                                                    }
                                                }
View Full Code Here

                            } else if (!useDB) {
                                dataMissingAtRow(row);
                                return DisplayPreferences.LOADING_MESSAGE;
                            }
                        }
                        Precursor precursor = peptideShakerGUI.getPrecursor(psmKey);
                        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 " + psmKey + ".");
                        }
                    case 6:
                        psParameter = (PSParameter) identification.getSpectrumMatchParameter(psmKey, new PSParameter(), useDB && !isScrolling);
View Full Code Here

        if (psmFilter.getPrecursorMz() != null
                || psmFilter.getPrecursorRT() != null) {

            SpectrumFactory spectrumFactory = SpectrumFactory.getInstance();
            Precursor precursor = spectrumFactory.getPrecursor(spectrumKey);

            if (psmFilter.getPrecursorMz() != null) {
                if (psmFilter.getPrecursorMzComparison() == RowFilter.ComparisonType.AFTER) {
                    if (precursor.getMz() <= psmFilter.getPrecursorMz()) {
                        return false;
                    }
                } else if (psmFilter.getPrecursorMzComparison() == RowFilter.ComparisonType.BEFORE) {
                    if (precursor.getMz() >= psmFilter.getPrecursorMz()) {
                        return false;
                    }
                } else if (psmFilter.getPrecursorMzComparison() == RowFilter.ComparisonType.EQUAL) {
                    if (precursor.getMz() != psmFilter.getPrecursorMz()) {
                        return false;
                    }
                } else if (psmFilter.getPrecursorMzComparison() == RowFilter.ComparisonType.NOT_EQUAL) {
                    if (precursor.getMz() == psmFilter.getPrecursorMz()) {
                        return false;
                    }
                }
            }

            if (psmFilter.getPrecursorRT() != null) {
                if (psmFilter.getPrecursorRTComparison() == RowFilter.ComparisonType.AFTER) {
                    if (precursor.getRt() <= psmFilter.getPrecursorRT()) {
                        return false;
                    }
                } else if (psmFilter.getPrecursorRTComparison() == RowFilter.ComparisonType.BEFORE) {
                    if (precursor.getRt() >= psmFilter.getPrecursorRT()) {
                        return false;
                    }
                } else if (psmFilter.getPrecursorRTComparison() == RowFilter.ComparisonType.EQUAL) {
                    if (precursor.getRt() != psmFilter.getPrecursorRT()) {
                        return false;
                    }
                } else if (psmFilter.getPrecursorRTComparison() == RowFilter.ComparisonType.NOT_EQUAL) {
                    if (precursor.getRt() == psmFilter.getPrecursorRT()) {
                        return false;
                    }
                }
            }
        }
View Full Code Here

            ExportFormat exportFormat, SearchParameters searchParameters) throws IOException, MzMLUnmarshallerException {

        String spectrumKey = spectrumMatch.getKey();

        SpectrumFactory spectrumFactory = SpectrumFactory.getInstance();
        Precursor precursor = spectrumFactory.getPrecursor(spectrumKey);

        switch (exportFormat) {
            case Thermo:
                int index = (int) (0.25 * retentionTimes.size());
                double rtMin = retentionTimes.get(index) / 60;
                index = (int) (0.75 * retentionTimes.size());
                double rtMax = retentionTimes.get(index) / 60;
                if (rtMax - rtMin < rtWindow / 60) {
                    index = (int) (0.5 * retentionTimes.size());
                    rtMin = (retentionTimes.get(index) - rtWindow / 2) / 60;
                    rtMax = (retentionTimes.get(index) + rtWindow / 2) / 60;
                }
                return precursor.getMz() + "\t" + rtMin + "\t" + rtMax;
            case ABI:
                index = (int) (0.5 * retentionTimes.size());
                double rtInMin = retentionTimes.get(index) / 60;
                return rtInMin + "\t" + precursor.getMz();
            case Bruker:
                index = (int) 0.5 * retentionTimes.size();
                double rt = retentionTimes.get(index);
                int index25 = (int) (0.25 * retentionTimes.size());
                int index75 = (int) (0.75 * retentionTimes.size());
                double range = retentionTimes.get(index75) - retentionTimes.get(index25);
                if (range < rtWindow) {
                    range = rtWindow;
                }
                if (searchParameters.getPrecursorAccuracyType() == SearchParameters.MassAccuracyType.PPM) {
                    double deltaMZ = searchParameters.getPrecursorAccuracy() / 1000000 * precursor.getMz();
                    double mzMin = precursor.getMz() - deltaMZ;
                    double mzMax = precursor.getMz() + deltaMZ;
                    return rt + "," + range + "," + mzMin + "," + mzMax;
                } else { // Dalton
                    double deltaMZ = searchParameters.getPrecursorAccuracy() / spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().value;
                    double mzMin = precursor.getMz() - deltaMZ;
                    double mzMax = precursor.getMz() + deltaMZ;
                    return rt + "," + range + "," + mzMin + "," + mzMax;
                }
            case MassLynx:
                index = (int) (0.5 * retentionTimes.size());
                rt = retentionTimes.get(index);
                return precursor.getMz() + "," + rt;
            default:
                return "";
        }
    }
View Full Code Here

        if (assumptionFilter.getPrecursorMzError() != null
                || assumptionFilter.getMinPrecursorMzError() != null
                || assumptionFilter.getMaxPrecursorMzError() != null) {

            SpectrumFactory spectrumFactory = SpectrumFactory.getInstance();
            Precursor precursor = spectrumFactory.getPrecursor(spectrumKey);

            if (assumptionFilter.getPrecursorMzError() != null) {
                double error = Math.abs(peptideAssumption.getDeltaMass(precursor.getMz(), searchParameters.isPrecursorAccuracyTypePpm()));
                if (assumptionFilter.getPrecursorMzErrorComparison() == RowFilter.ComparisonType.AFTER) {
                    if (error <= assumptionFilter.getPrecursorMzError()) {
                        return false;
                    }
                } else if (assumptionFilter.getPrecursorMzErrorComparison() == RowFilter.ComparisonType.BEFORE) {
                    if (error >= assumptionFilter.getPrecursorMzError()) {
                        return false;
                    }
                } else if (assumptionFilter.getPrecursorMzErrorComparison() == RowFilter.ComparisonType.EQUAL) {
                    if (error != assumptionFilter.getPrecursorMzError()) {
                        return false;
                    }
                } else if (assumptionFilter.getPrecursorMzErrorComparison() == RowFilter.ComparisonType.NOT_EQUAL) {
                    if (error == assumptionFilter.getPrecursorMzError()) {
                        return false;
                    }
                }
            }

            if (assumptionFilter.getMinPrecursorMzError() != null) {
                double error = peptideAssumption.getDeltaMass(precursor.getMz(), searchParameters.isPrecursorAccuracyTypePpm());
                if (assumptionFilter.getPrecursorMinMzErrorComparison() == RowFilter.ComparisonType.AFTER) {
                    if (error <= assumptionFilter.getMinPrecursorMzError()) {
                        return false;
                    }
                } else if (assumptionFilter.getPrecursorMinMzErrorComparison() == RowFilter.ComparisonType.BEFORE) {
                    if (error >= assumptionFilter.getMinPrecursorMzError()) {
                        return false;
                    }
                } else if (assumptionFilter.getPrecursorMinMzErrorComparison() == RowFilter.ComparisonType.EQUAL) {
                    if (error != assumptionFilter.getMinPrecursorMzError()) {
                        return false;
                    }
                } else if (assumptionFilter.getPrecursorMinMzErrorComparison() == RowFilter.ComparisonType.NOT_EQUAL) {
                    if (error == assumptionFilter.getMinPrecursorMzError()) {
                        return false;
                    }
                }
            }

            if (assumptionFilter.getMaxPrecursorMzError() != null) {
                double error = peptideAssumption.getDeltaMass(precursor.getMz(), searchParameters.isPrecursorAccuracyTypePpm());
                if (assumptionFilter.getPrecursorMaxMzErrorComparison() == RowFilter.ComparisonType.AFTER) {
                    if (error <= assumptionFilter.getMaxPrecursorMzError()) {
                        return false;
                    }
                } else if (assumptionFilter.getPrecursorMaxMzErrorComparison() == RowFilter.ComparisonType.BEFORE) {
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.