Package com.compomics.util.experiment.biology

Examples of com.compomics.util.experiment.biology.PTM


                        ((DefaultTableModel) psmAScoresTable.getModel()).addColumn(columnName);
                        ((DefaultTableModel) psmDeltaScoresTable.getModel()).addColumn(columnName);
                    }

                    String selectedPtmName = getSelectedModification();
                    PTM selectedPtm = ptmFactory.getPTM(selectedPtmName);

                    // add the psm scores (a score and delta score)
                    identification.loadSpectrumMatches(peptideMatch.getSpectrumMatches(), null);
                    for (int i = 0; i < peptideMatch.getSpectrumMatches().size(); i++) {

                        String spectrumKey = peptideMatch.getSpectrumMatches().get(i);
                        PSPtmScores ptmScores = new PSPtmScores();
                        ptmScores = (PSPtmScores) identification.getSpectrumMatch(spectrumKey).getUrParam(ptmScores);
                        ((DefaultTableModel) psmAScoresTable.getModel()).addRow(new Object[]{(i + 1)});
                        ((DefaultTableModel) psmDeltaScoresTable.getModel()).addRow(new Object[]{(i + 1)});

                        if (ptmScores != null) {

                            HashMap<Integer, Double> dScores = new HashMap<Integer, Double>();
                            HashMap<Integer, Double> pScores = new HashMap<Integer, Double>();

                            for (String ptmName : ptmScores.getScoredPTMs()) {

                                PTM ptm = ptmFactory.getPTM(ptmName);

                                if (ptm.getMass() == selectedPtm.getMass()) {

                                    PtmScoring ptmScoring = ptmScores.getPtmScoring(ptmName);
                                    for (int site : ptmScoring.getAllPtmLocations()) {
                                        double ptmDScore = ptmScoring.getDeltaScore(site);
                                        Double tableDScore = dScores.get(site);
View Full Code Here


            br.write(getCurrentTabSpace() + "<ModificationItem>" + System.getProperty("line.separator"));
            tabCounter++;

            ModificationMatch modMatch = peptide.getModificationMatches().get(i);
            String modName = modMatch.getTheoreticPtm();
            PTM ptm = ptmFactory.getPTM(modName);

            CvTerm cvTerm = ptmToPrideMap.getCVTerm(modName);

            if (cvTerm == null) {
                cvTerm = PtmToPrideMap.getDefaultCVTerm(ptm.getName());
            }

            String cvTermName;
            String ptmMass;

            if (cvTerm == null) {
                cvTermName = modName;
                ptmMass = "" + ptm.getMass();
            } else {
                cvTermName = cvTerm.getName();
                ptmMass = cvTerm.getValue();

                // two extra tests to guard against problems with the cv terms, better to have a valid ptm than no ptm at all...
                if (cvTermName == null) {
                    cvTermName = modName;
                }
                if (ptmMass == null) {
                    ptmMass = "" + ptm.getMass();
                }
            }

            // get the modification location
            int modLocation = modMatch.getModificationSite();

            // have to handle terminal ptms separatly
            if (ptm.isNTerm()) {
                modLocation = 0;
            } else if (ptm.isCTerm()) {
                modLocation = peptide.getSequence().length() + 1;
            }

            br.write(getCurrentTabSpace() + "<ModLocation>" + modLocation + "</ModLocation>" + System.getProperty("line.separator"));
View Full Code Here

                    } else {
                        text += ", ";
                    }
                }
                String ptmName = fixedPtmsNames.get(i);
                PTM ptm = ptmFactory.getPTM(ptmName);
                String sign;
                if (ptm.getMass() < 0) {
                    sign = "";
                } else {
                    sign = "+";
                }
                text += ptmName + " (" + sign + ptm.getMass() + " Da)";
            }
           
            text += ", ";
        }
        ArrayList<String> variablePtmsNames = searchParameters.getModificationProfile().getVariableModifications();
        if (!variablePtmsNames.isEmpty()) {
            text += " variable modifications: ";
            for (int i = 0; i < variablePtmsNames.size(); i++) {
                if (i > 0) {
                    if (i == variablePtmsNames.size() - 1) {
                        text += " and ";
                    } else {
                        text += ", ";
                    }
                }
                String ptmName = variablePtmsNames.get(i);
                PTM ptm = ptmFactory.getPTM(ptmName);
                String sign;
                if (ptm.getMass() < 0) {
                    sign = "-";
                } else {
                    sign = "+";
                }
                text += ptmName + " (" + sign + ptm.getMass() + " Da)";
            }
           
            text += ", ";
        }
        ArrayList<String> refinementFixedPtmsNames = searchParameters.getModificationProfile().getRefinementFixedModifications();
        if (!refinementFixedPtmsNames.isEmpty()) {
            text += "fixed modifications during refinement procedure: ";
            for (int i = 0; i < refinementFixedPtmsNames.size(); i++) {
                if (i > 0) {
                    if (i == refinementFixedPtmsNames.size() - 1) {
                        text += " and ";
                    } else {
                        text += ", ";
                    }
                }
                String ptmName = refinementFixedPtmsNames.get(i);
                PTM ptm = ptmFactory.getPTM(ptmName);
                String sign;
                if (ptm.getMass() < 0) {
                    sign = "-";
                } else {
                    sign = "+";
                }
                text += ptmName + " (" + sign + ptm.getMass() + " Da)";
            }
           
            text += ", ";
        }
        ArrayList<String> refinementVariablePtmsNames = searchParameters.getModificationProfile().getRefinementVariableModifications();
        if (!refinementVariablePtmsNames.isEmpty()) {
            text += "variable modifications during refinement procedure: ";
            for (int i = 0; i < refinementVariablePtmsNames.size(); i++) {
                if (i > 0) {
                    if (i == refinementVariablePtmsNames.size() - 1) {
                        text += " and ";
                    } else {
                        text += ", ";
                    }
                }
                String ptmName = refinementVariablePtmsNames.get(i);
                PTM ptm = ptmFactory.getPTM(ptmName);
                String sign;
                if (ptm.getMass() < 0) {
                    sign = "-";
                } else {
                    sign = "+";
                }
                text += ptmName + " (" + sign + ptm.getMass() + " Da)";
            }
        }
        text += ". All algorithms specific settings are listed in the Certificate of Analysis available in the supplementary information.";
        return text;
    }
View Full Code Here

            report += ".";
            JOptionPane.showMessageDialog(peptideShakerGUI, report, "PTM PSI-MOD Mapping", JOptionPane.WARNING_MESSAGE);

            // have the user add the CV term mappings
            for (String modName : missingMods) {
                PTM currentPtm = PTMFactory.getInstance().getPTM(modName);
                new PtmDialog(this, this, ptmToPrideMap, currentPtm, false);
            }
        }
    }
View Full Code Here

                        StringBuilder result = new StringBuilder();
                        ArrayList<String> modList = ptmScores.getScoredPTMs();
                        Collections.sort(modList);
                        for (String mod : modList) {

                            PTM ptm = PTMFactory.getInstance().getPTM(mod);

                            if (ptm.getType() == PTM.MODAA) {

                                if (result.length() > 0) {
                                    result.append(", ");
                                }
                                result.append(mod);
View Full Code Here

            peptidePtmScore = (PSPtmScores) peptideMatch.getUrParam(new PSPtmScores());
            if (peptidePtmScore != null) {

                mainSelection = new boolean[peptide.getSequence().length()];
                for (String ptmName : peptidePtmScore.getConfidentlyLocalizedPtms()) {
                    PTM tempPTM = ptmFactory.getPTM(ptmName);
                    if (tempPTM.getMass() == ptmMass) {
                        for (int site : peptidePtmScore.getConfidentSitesForPtm(ptmName)) {
                            mainSelection[site] = true;
                        }
                    }
                }

                secondarySelection = new boolean[peptide.getSequence().length()];
                for (String ptmName : peptidePtmScore.getAmbiguouslyLocalizedPtms()) {
                    PTM tempPTM = ptmFactory.getPTM(ptmName);
                    if (tempPTM.getMass() == ptmMass) {
                        for (int site : peptidePtmScore.getAmbiguousModificationsSites(ptmName).keySet()) {
                            secondarySelection[site] = true;
                        }
                    }
                }
View Full Code Here

                                String utilitiesPtmName = searchParameters.getModificationProfile().getVariableModifications().get(directagIndex);
                                if (utilitiesPtmName == null) {
                                    throw new IllegalArgumentException("DirecTag PTM " + directagIndex + " not recognized.");
                                }
                                modificationMatch.setTheoreticPtm(utilitiesPtmName);
                                PTM ptm = ptmFactory.getPTM(utilitiesPtmName);
                                ArrayList<Character> aaAtTarget = ptm.getPattern().getAminoAcidsAtTarget();
                                if (aaAtTarget.size() > 1) {
                                    throw new IllegalArgumentException("More than one amino acid can be targeted by the modification " + ptm + ", tag duplication required.");
                                }
                                int aaIndex = aa - 1;
                                aminoAcidPattern.setTargeted(aaIndex, aaAtTarget);
                            } else {
                                Advocate notImplemented = Advocate.getAdvocate(advocateId);
                                if (notImplemented == null) {
                                    throw new IllegalArgumentException("Advocate of id " + advocateId + " not recognized.");
                                }
                                throw new IllegalArgumentException("PTM mapping not implemented for " + Advocate.getAdvocate(advocateId).getName() + ".");
                            }
                        }
                    }
                }
            } else if (tagComponent instanceof AminoAcidSequence) {

                AminoAcidSequence aminoAcidSequence = (AminoAcidSequence) tagComponent;

                for (int aa : aminoAcidSequence.getModificationIndexes()) {
                    for (ModificationMatch modificationMatch : aminoAcidSequence.getModificationsAt(aa)) {
                        if (modificationMatch.isVariable()) {
                            if (advocateId == Advocate.pepnovo.getIndex()) {
                                String pepnovoPtmName = modificationMatch.getTheoreticPtm();
                                PepnovoParameters pepnovoParameters = (PepnovoParameters) searchParameters.getIdentificationAlgorithmParameter(advocateId);
                                String utilitiesPtmName = pepnovoParameters.getUtilitiesPtmName(pepnovoPtmName);
                                if (utilitiesPtmName == null) {
                                    throw new IllegalArgumentException("PepNovo+ PTM " + pepnovoPtmName + " not recognized.");
                                }
                                modificationMatch.setTheoreticPtm(utilitiesPtmName);
                            } else if (advocateId == Advocate.direcTag.getIndex()) {
                                Integer directagIndex = new Integer(modificationMatch.getTheoreticPtm());
                                String utilitiesPtmName = searchParameters.getModificationProfile().getVariableModifications().get(directagIndex);
                                if (utilitiesPtmName == null) {
                                    throw new IllegalArgumentException("DirecTag PTM " + directagIndex + " not recognized.");
                                }
                                modificationMatch.setTheoreticPtm(utilitiesPtmName);
                                PTM ptm = ptmFactory.getPTM(utilitiesPtmName);
                                ArrayList<Character> aaAtTarget = ptm.getPattern().getAminoAcidsAtTarget();
                                if (aaAtTarget.size() > 1) {
                                    throw new IllegalArgumentException("More than one amino acid can be targeted by the modification " + ptm + ", tag duplication required.");
                                }
                                int aaIndex = aa - 1;
                                aminoAcidSequence.setAaAtIndex(aaIndex, aaAtTarget.get(0));
View Full Code Here

                                                            + "Error encountered in peptide " + peptideSequence + " spectrum " + spectrumTitle + " in spectrum file " + fileName + ".\n"
                                                            + "Identification file: " + idFile.getName());
                                                }
                                                tempNames = ptmFactory.getExpectedPTMs(modificationProfile, peptide, seMass, ptmMassTolerance, sequenceMatchingPreferences);
                                            } else if (fileReader instanceof DirecTagIdfileReader) {
                                                PTM ptm = ptmFactory.getPTM(sePTM);
                                                if (ptm == PTMFactory.unknownPTM) {
                                                    throw new IllegalArgumentException("PTM not recognized spectrum " + spectrumTitle + " of file " + fileName + ".");
                                                }
                                                tempNames = ptmFactory.getExpectedPTMs(modificationProfile, peptide, ptm.getMass(), ptmMassTolerance, sequenceMatchingPreferences);
                                            } else {
                                                throw new IllegalArgumentException("PTM mapping not implemented for the parsing of " + idFile.getName() + ".");
                                            }

                                            ArrayList<String> allNames = new ArrayList<String>();
                                            for (ArrayList<String> namesAtAA : tempNames.values()) {
                                                for (String name : namesAtAA) {
                                                    if (!allNames.contains(name)) {
                                                        allNames.add(name);
                                                    }
                                                }
                                            }
                                            modNames.put(modMatch, allNames);
                                            for (int pos : tempNames.keySet()) {
                                                ArrayList<String> namesAtPosition = expectedNames.get(pos);
                                                if (namesAtPosition == null) {
                                                    namesAtPosition = new ArrayList<String>(2);
                                                    expectedNames.put(pos, namesAtPosition);
                                                }
                                                for (String ptmName : tempNames.get(pos)) {
                                                    if (!namesAtPosition.contains(ptmName)) {
                                                        namesAtPosition.add(ptmName);
                                                    }
                                                }
                                            }
                                        }
                                    }

                                    // If a terminal modification cannot be elsewhere lock the terminus
                                    ModificationMatch nTermModification = null;
                                    for (ModificationMatch modMatch : peptide.getModificationMatches()) {
                                        if (modMatch.isVariable() && !modMatch.getTheoreticPtm().equals(PTMFactory.unknownPTM.getName())) {
                                            double refMass = getRefMass(modMatch.getTheoreticPtm(), modificationProfile);
                                            int modSite = modMatch.getModificationSite();
                                            if (modSite == 1) {
                                                ArrayList<String> expectedNamesAtSite = expectedNames.get(modSite);
                                                if (expectedNamesAtSite != null) {
                                                    ArrayList<String> filteredNamesAtSite = new ArrayList<String>(expectedNamesAtSite.size());
                                                    for (String ptmName : expectedNamesAtSite) {
                                                        PTM ptm = ptmFactory.getPTM(ptmName);
                                                        if (Math.abs(ptm.getMass() - refMass) < searchParameters.getFragmentIonAccuracy()) {
                                                            filteredNamesAtSite.add(ptmName);
                                                        }
                                                    }
                                                    for (String modName : filteredNamesAtSite) {
                                                        PTM ptm = ptmFactory.getPTM(modName);
                                                        if (ptm.isNTerm()) {
                                                            boolean otherPossibleMod = false;
                                                            for (String tempName : modificationProfile.getAllNotFixedModifications()) {
                                                                if (!tempName.equals(modName)) {
                                                                    PTM tempPTM = ptmFactory.getPTM(tempName);
                                                                    if (tempPTM.getMass() == ptm.getMass() && !tempPTM.isNTerm()) {
                                                                        otherPossibleMod = true;
                                                                        break;
                                                                    }
                                                                }
                                                            }
                                                            if (!otherPossibleMod) {
                                                                nTermModification = modMatch;
                                                                modMatch.setTheoreticPtm(modName);
                                                                break;
                                                            }
                                                        }
                                                    }
                                                    if (nTermModification != null) {
                                                        break;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    ModificationMatch cTermModification = null;
                                    for (ModificationMatch modMatch : peptide.getModificationMatches()) {
                                        if (modMatch.isVariable() && !modMatch.getTheoreticPtm().equals(PTMFactory.unknownPTM.getName()) && modMatch != nTermModification) {
                                            double refMass = getRefMass(modMatch.getTheoreticPtm(), modificationProfile);
                                            int modSite = modMatch.getModificationSite();
                                            if (modSite == peptideSequence.length()) {
                                                ArrayList<String> expectedNamesAtSite = expectedNames.get(modSite);
                                                if (expectedNamesAtSite != null) {
                                                    ArrayList<String> filteredNamesAtSite = new ArrayList<String>(expectedNamesAtSite.size());
                                                    for (String ptmName : expectedNamesAtSite) {
                                                        PTM ptm = ptmFactory.getPTM(ptmName);
                                                        if (Math.abs(ptm.getMass() - refMass) < searchParameters.getFragmentIonAccuracy()) {
                                                            filteredNamesAtSite.add(ptmName);
                                                        }
                                                    }
                                                    for (String modName : filteredNamesAtSite) {
                                                        PTM ptm = ptmFactory.getPTM(modName);
                                                        if (ptm.isCTerm()) {
                                                            boolean otherPossibleMod = false;
                                                            for (String tempName : modificationProfile.getAllNotFixedModifications()) {
                                                                if (!tempName.equals(modName)) {
                                                                    PTM tempPTM = ptmFactory.getPTM(tempName);
                                                                    if (tempPTM.getMass() == ptm.getMass() && !tempPTM.isCTerm()) {
                                                                        otherPossibleMod = true;
                                                                        break;
                                                                    }
                                                                }
                                                            }
                                                            if (!otherPossibleMod) {
                                                                cTermModification = modMatch;
                                                                modMatch.setTheoreticPtm(modName);
                                                                break;
                                                            }
                                                        }
                                                    }
                                                    if (cTermModification != null) {
                                                        break;
                                                    }
                                                }
                                            }
                                        }
                                    }

                                    // Map the modifications according to search engine localization
                                    HashMap<Integer, ArrayList<String>> siteToPtmMap = new HashMap<Integer, ArrayList<String>>(); // Site to ptm name including termini
                                    HashMap<Integer, ModificationMatch> siteToMatchMap = new HashMap<Integer, ModificationMatch>(); // Site to Modification match excluding termini
                                    HashMap<ModificationMatch, Integer> matchToSiteMap = new HashMap<ModificationMatch, Integer>(); // Modification match to site excluding termini
                                    boolean allMapped = true;

                                    for (ModificationMatch modMatch : peptide.getModificationMatches()) {
                                        boolean mapped = false;
                                        if (modMatch.isVariable() && modMatch != nTermModification && modMatch != cTermModification && !modMatch.getTheoreticPtm().equals(PTMFactory.unknownPTM.getName())) {
                                            double refMass = getRefMass(modMatch.getTheoreticPtm(), modificationProfile);
                                            int modSite = modMatch.getModificationSite();
                                            boolean terminal = false;
                                            ArrayList<String> expectedNamesAtSite = expectedNames.get(modSite);
                                            if (expectedNamesAtSite != null) {
                                                ArrayList<String> filteredNamesAtSite = new ArrayList<String>(expectedNamesAtSite.size());
                                                ArrayList<String> modificationAtSite = siteToPtmMap.get(modSite);
                                                for (String ptmName : expectedNamesAtSite) {
                                                    PTM ptm = ptmFactory.getPTM(ptmName);
                                                    if (Math.abs(ptm.getMass() - refMass) < searchParameters.getFragmentIonAccuracy()
                                                            && (modificationAtSite == null || !modificationAtSite.contains(ptmName))) {
                                                        filteredNamesAtSite.add(ptmName);
                                                    }
                                                }
                                                if (filteredNamesAtSite.size() == 1) {
                                                    String ptmName = filteredNamesAtSite.get(0);
                                                    PTM ptm = ptmFactory.getPTM(ptmName);
                                                    if (ptm.isNTerm() && nTermModification == null) {
                                                        nTermModification = modMatch;
                                                        mapped = true;
                                                    } else if (ptm.isCTerm() && cTermModification == null) {
                                                        cTermModification = modMatch;
                                                        mapped = true;
                                                    } else if (!ptm.isNTerm() && !ptm.isCTerm()) {
                                                        matchToSiteMap.put(modMatch, modSite);
                                                        siteToMatchMap.put(modSite, modMatch);
                                                        mapped = true;
                                                    }
                                                    if (mapped) {
                                                        modMatch.setTheoreticPtm(ptmName);
                                                        if (modificationAtSite == null) {
                                                            modificationAtSite = new ArrayList<String>(2);
                                                            siteToPtmMap.put(modSite, modificationAtSite);
                                                        }
                                                        modificationAtSite.add(ptmName);
                                                    }
                                                }
                                                if (!mapped) {
                                                    if (filteredNamesAtSite.isEmpty()) {
                                                        filteredNamesAtSite = expectedNamesAtSite;
                                                    }
                                                    if (modSite == 1) {
                                                        Double minDiff = null;
                                                        String bestPtmName = null;
                                                        for (String modName : filteredNamesAtSite) {
                                                            PTM ptm = ptmFactory.getPTM(modName);
                                                            if (ptm.isNTerm() && nTermModification == null) {
                                                                double massError = Math.abs(refMass - ptm.getMass());
                                                                if (massError <= searchParameters.getFragmentIonAccuracy()
                                                                        && (minDiff == null || massError < minDiff)) {
                                                                    bestPtmName = modName;
                                                                    minDiff = massError;
                                                                }
                                                            }
                                                        }
                                                        if (bestPtmName != null) {
                                                            nTermModification = modMatch;
                                                            modMatch.setTheoreticPtm(bestPtmName);
                                                            terminal = true;
                                                            if (modificationAtSite == null) {
                                                                modificationAtSite = new ArrayList<String>(2);
                                                                siteToPtmMap.put(modSite, modificationAtSite);
                                                            }
                                                            modificationAtSite.add(bestPtmName);
                                                            mapped = true;
                                                        }
                                                    } else if (modSite == peptideSequence.length()) {
                                                        Double minDiff = null;
                                                        String bestPtmName = null;
                                                        for (String modName : filteredNamesAtSite) {
                                                            PTM ptm = ptmFactory.getPTM(modName);
                                                            if (ptm.isCTerm() && cTermModification == null) {
                                                                double massError = Math.abs(refMass - ptm.getMass());
                                                                if (massError <= searchParameters.getFragmentIonAccuracy()
                                                                        && (minDiff == null || massError < minDiff)) {
                                                                    bestPtmName = modName;
                                                                    minDiff = massError;
                                                                }
                                                            }
                                                        }
                                                        if (bestPtmName != null) {
                                                            cTermModification = modMatch;
                                                            modMatch.setTheoreticPtm(bestPtmName);
                                                            terminal = true;
                                                            if (modificationAtSite == null) {
                                                                modificationAtSite = new ArrayList<String>(2);
                                                                siteToPtmMap.put(modSite, modificationAtSite);
                                                            }
                                                            modificationAtSite.add(bestPtmName);
                                                            mapped = true;
                                                        }
                                                    }
                                                    if (!terminal) {
                                                        Double minDiff = null;
                                                        String bestPtmName = null;
                                                        for (String modName : filteredNamesAtSite) {
                                                            PTM ptm = ptmFactory.getPTM(modName);
                                                            if (!ptm.isCTerm() && !ptm.isNTerm() && modNames.get(modMatch).contains(modName) && !siteToMatchMap.containsKey(modSite)) {
                                                                double massError = Math.abs(refMass - ptm.getMass());
                                                                if (massError <= searchParameters.getFragmentIonAccuracy()
                                                                        && (minDiff == null || massError < minDiff)) {
                                                                    bestPtmName = modName;
                                                                    minDiff = massError;
                                                                }
                                                            }
                                                        }
                                                        if (bestPtmName != null) {
                                                            modMatch.setTheoreticPtm(bestPtmName);
                                                            if (modificationAtSite == null) {
                                                                modificationAtSite = new ArrayList<String>(2);
                                                                siteToPtmMap.put(modSite, modificationAtSite);
                                                            }
                                                            modificationAtSite.add(bestPtmName);
                                                            matchToSiteMap.put(modMatch, modSite);
                                                            siteToMatchMap.put(modSite, modMatch);
                                                            mapped = true;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        if (!mapped) {
                                            allMapped = false;
                                        }
                                    }

                                    if (!allMapped) {

                                        // Try to correct incompatible localizations
                                        HashMap<Integer, ArrayList<Integer>> remap = new HashMap<Integer, ArrayList<Integer>>();

                                        for (ModificationMatch modMatch : peptide.getModificationMatches()) {
                                            if (modMatch.isVariable() && modMatch != nTermModification && modMatch != cTermModification && !matchToSiteMap.containsKey(modMatch) && !modMatch.getTheoreticPtm().equals(PTMFactory.unknownPTM.getName())) {
                                                int modSite = modMatch.getModificationSite();
                                                for (int candidateSite : expectedNames.keySet()) {
                                                    if (!siteToMatchMap.containsKey(candidateSite)) {
                                                        for (String modName : expectedNames.get(candidateSite)) {
                                                            if (modNames.get(modMatch).contains(modName)) {
                                                                PTM ptm = ptmFactory.getPTM(modName);
                                                                if ((!ptm.isCTerm() || cTermModification == null)
                                                                        && (!ptm.isNTerm() || nTermModification == null)) {
                                                                    ArrayList<Integer> ptmSites = remap.get(modSite);
                                                                    if (ptmSites == null) {
                                                                        ptmSites = new ArrayList<Integer>(4);
                                                                        remap.put(modSite, ptmSites);
                                                                    }
View Full Code Here

            ModificationProfile modificationProfile = searchParameters.getModificationProfile();
            IdentificationAlgorithmParameter algorithmParameter = searchParameters.getIdentificationAlgorithmParameter(Advocate.xtandem.getIndex());
            if (algorithmParameter != null) {
                XtandemParameters xtandemParameters = (XtandemParameters) algorithmParameter;
                if (xtandemParameters.isProteinQuickAcetyl() && !modificationProfile.contains("acetylation of protein n-term")) {
                    PTM ptm = PTMFactory.getInstance().getPTM("acetylation of protein n-term");
                    modificationProfile.addVariableModification(ptm);
                }
                String[] pyroMods = {"pyro-cmc", "pyro-glu from n-term e", "pyro-glu from n-term q"};
                if (xtandemParameters.isQuickPyrolidone()) {
                    for (String ptmName : pyroMods) {
                        if (!modificationProfile.getVariableModifications().contains(ptmName)) {
                            PTM ptm = PTMFactory.getInstance().getPTM(ptmName);
                            modificationProfile.addVariableModification(ptm);
                        }
                    }
                }
            }
View Full Code Here

     * @return the mass of the PTM
     */
    private double getRefMass(String sePtmName, ModificationProfile modificationProfile) {
        Double refMass = 0.0;
        // Try utilities modifications
        PTM refPtm = ptmFactory.getPTM(sePtmName);
        if (refPtm == PTMFactory.unknownPTM) {
            // Try mass@AA
            int atIndex = sePtmName.indexOf("@");
            if (atIndex > 0) {
                refMass = new Double(sePtmName.substring(0, atIndex));
            } else {
                // Try OMSSA indexes
                try {
                    int omssaIndex = new Integer(sePtmName);
                    String omssaName = modificationProfile.getModification(omssaIndex);
                    if (omssaName != null) {
                        refPtm = ptmFactory.getPTM(omssaName);
                        if (refPtm != PTMFactory.unknownPTM) {
                            refMass = refPtm.getMass();
                        }
                    }
                } catch (Exception e) {
                    // ignore
                }
            }
        } else {
            refMass = refPtm.getMass();
        }
        return refMass;
    }
View Full Code Here

TOP

Related Classes of com.compomics.util.experiment.biology.PTM

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.