Package com.compomics.util.experiment.biology

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


        } else {
            msToleranceUnit = "Da";
        }
        String msmsToleranceUnit = "Da";
        text += searchParameters.getPrecursorAccuracy() + " " + msToleranceUnit + " as MS1 and " + searchParameters.getFragmentIonAccuracy() + " " + msmsToleranceUnit + " as MS2 tolerances; ";
        PTMFactory ptmFactory = PTMFactory.getInstance();
        ArrayList<String> fixedPtmsNames = searchParameters.getModificationProfile().getFixedModifications();
        if (!fixedPtmsNames.isEmpty()) {
            text += "fixed modifications: ";
            for (int i = 0; i < fixedPtmsNames.size(); i++) {
                if (i > 0) {
                    if (i == fixedPtmsNames.size() - 1) {
                        text += " and ";
                    } 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 = "+";
View Full Code Here


     *
     * @param peptideMatch the considered peptide match
     * @return the corresponding key
     */
    public String getKey(PeptideMatch peptideMatch) {
        PTMFactory ptmFactory = PTMFactory.getInstance();
        PTM ptm;
        ArrayList<Double> modificationMasses = new ArrayList<Double>();
        for (ModificationMatch modificationMatch : peptideMatch.getTheoreticPeptide().getModificationMatches()) {
            if (modificationMatch.getTheoreticPtm() != null
                    && modificationMatch.isVariable()) {
                ptm = ptmFactory.getPTM(modificationMatch.getTheoreticPtm());
                modificationMasses.add(ptm.getMass());
            }
        }
        Collections.sort(modificationMasses);
        String key = "";
View Full Code Here

            return "Unmodified";
        } else if (key.equals(PeptideSpecificMap.DUSTBIN)) {
            return "Other";
        } else {

            PTMFactory ptmFactory = PTMFactory.getInstance();
            String result = "";
            String[] split = key.split(SEPARATOR);
            boolean shortNames = split.length > 1;

            for (String massString : split) {

                if (!result.equals("")) {
                    result += ", ";
                }

                boolean found = false;

                try {
                    Double mass = new Double(massString);
                    for (String ptmName : modificationProfile.getAllNotFixedModifications()) {
                        PTM ptm = ptmFactory.getPTM(ptmName);
                        if (mass == ptm.getMass()) {
                            if (shortNames && ptm.getShortName() != null) {
                                result += ptm.getShortName();
                            } else {
                                result += ptm.getName();
View Full Code Here

        MSnSpectrum spectrum = (MSnSpectrum) SpectrumFactory.getInstance().getSpectrum(spectrumKey);

        if (accessions == null) {
            accessions = peptide.getParentProteins(sequenceMatchingPreferences);
        }
        PTMFactory ptmFactory = PTMFactory.getInstance();
        PtmToPrideMap ptmToPrideMap = null;
        // get the psi-mod mappings
        try {
            PrideObjectsFactory prideObjectsFactory = PrideObjectsFactory.getInstance();
            ptmToPrideMap = prideObjectsFactory.getPtmToPrideMap();
        } catch (Exception e) {
            e.printStackTrace();
        }

        for (String accession : accessions) {

            PeptideSpectrumAnnotator spectrumAnnotator = new PeptideSpectrumAnnotator();

            ArrayList<IonMatch> annotations = spectrumAnnotator.getSpectrumAnnotation(
                    annotationPreferences.getIonTypes(),
                    annotationPreferences.getNeutralLosses(),
                    annotationPreferences.getValidatedCharges(),
                    spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().value,
                    spectrum,
                    spectrumMatch.getBestPeptideAssumption().getPeptide(),
                    spectrum.getIntensityLimit(annotationPreferences.getAnnotationIntensityLimit()),
                    annotationPreferences.getFragmentIonAccuracy(), false,
                    annotationPreferences.isHighResolutionAnnotation());

            for (IonMatch ionMatch : annotations) {

                if (ionMatch.ion.getType() == Ion.IonType.PEPTIDE_FRAGMENT_ION) {

                    PeptideFragmentIon peptideFragmentIon = (PeptideFragmentIon) ionMatch.ion;

                    if (peptideFragmentIon.getNeutralLosses().isEmpty()) {

                        //Q1
                        Charge charge = bestAssumption.getIdentificationCharge();
                        double theoreticPrecMz = (peptide.getMass() + charge.value * ElementaryIon.proton.getTheoreticMass()) / charge.value;
                        writer.write(theoreticPrecMz + SEPARATOR);

                        //Q3
                        double theoreticFragMz = ionMatch.ion.getTheoreticMz(charge.value);
                        writer.write(theoreticFragMz + SEPARATOR);

                        // RT_detected
                        double rt = spectrum.getPrecursor().getRt();
                        writer.write(rt + SEPARATOR);

                        // isotope
                        writer.write("Light" + SEPARATOR);

                        // uniprot_id
                        writer.write(accession + SEPARATOR);

                        // relative intensity
                        double intensity = ionMatch.peak.intensity; //@TODO: normalize in some way?
                        writer.write(intensity + SEPARATOR);

                        // sequence
                        String sequence = peptide.getSequence();
                        writer.write(sequence + SEPARATOR);

                        // modified sequence
                        String modifiedSequence = "";
                        for (int aa = 0; aa < sequence.length(); aa++) {
                            modifiedSequence += sequence.charAt(aa);
                            for (ModificationMatch modificationMatch : peptide.getModificationMatches()) {
                                if (modificationMatch.getModificationSite() == aa + 1) {
                                    String ptmName = modificationMatch.getTheoreticPtm();
                                    PTM ptm = ptmFactory.getPTM(ptmName);
                                    CvTerm cvTerm = null;
                                    if (ptmToPrideMap != null) {
                                        try {
                                            cvTerm = ptmToPrideMap.getCVTerm(ptmName);
                                            if (cvTerm == null) {
View Full Code Here

                @Override
                public void run() {

                    try {

                        PTMFactory ptmFactory = PTMFactory.getInstance();
                        ModificationProfile ptmProfile = peptideShakerGUI.getSearchParameters().getModificationProfile();
                        PTMScoringPreferences ptmScoringPreferences = peptideShakerGUI.getPtmScoringPreferences();

                        progressDialog.setPrimaryProgressCounterIndeterminate(false);
                        if (psmKeys != null) {
                            progressDialog.setMaxPrimaryProgressCounter(psmKeys.size());
                        } else {
                            progressDialog.setMaxPrimaryProgressCounter(identification.getSpectrumIdentificationSize());
                        }

                        if (includeHeader) {
                            if (indexes) {
                                writer.write(SEPARATOR);
                            }
                            if (accessions) {
                                writer.write("Protein(s)" + SEPARATOR);
                            }
                            if (proteinDescription) {
                                writer.write("Protein(s) Descriptions" + SEPARATOR);
                            }
                            if (sequence) {
                                writer.write("Sequence" + SEPARATOR);
                            }
                            if (modification) {
                                writer.write("Variable Modification(s)" + SEPARATOR);
                            }
                            if (location) {
                                writer.write("Location Confidence" + SEPARATOR);
                                if (ptmScoringPreferences.isProbabilitsticScoreCalculation()) {
                                    writer.write(ptmScoringPreferences.getSelectedProbabilisticScore().getName() + SEPARATOR);
                                }
                                writer.write("D-score" + SEPARATOR);
                            }
                            if (file) {
                                writer.write("Spectrum File" + SEPARATOR);
                            }
                            if (title) {
                                writer.write("Spectrum Title" + SEPARATOR);
                            }
                            if (precursor) {
                                writer.write("Precursor m/z" + SEPARATOR);
                                writer.write("Precursor Charge" + SEPARATOR);
                                writer.write("Idenitification Charge" + SEPARATOR);
                                writer.write("Precursor Retention Time" + SEPARATOR);
                                writer.write("Peptide Theoretical Mass" + SEPARATOR);

                                if (peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm()) {
                                    writer.write("Mass Error [ppm]" + SEPARATOR);
                                } else {
                                    writer.write("Mass Error [Da]" + SEPARATOR);
                                }
                                writer.write("Isotope number" + SEPARATOR);
                            }
                            if (score) {
                                writer.write("Score" + SEPARATOR);
                            }
                            if (confidence) {
                                writer.write("Confidence" + SEPARATOR);
                            }
                            writer.write("Validation" + SEPARATOR);
                            if (!onlyValidated) {
                                writer.write("Decoy" + SEPARATOR);
                            }
                            if (includeHidden) {
                                writer.write("Hidden" + SEPARATOR);
                            }

                            writer.write(System.getProperty("line.separator"));
                        }

                        PSParameter psParameter = new PSParameter();
                        int psmCounter = 0;

                        HashMap<String, ArrayList<String>> spectrumKeys = new HashMap<String, ArrayList<String>>();
                        if (psmKeys == null) {
                            spectrumKeys = identification.getSpectrumIdentificationMap();
                        } else {
                            for (String spectrumKey : psmKeys) {
                                String spectrumFile = Spectrum.getSpectrumFile(spectrumKey);
                                if (!spectrumKeys.containsKey(spectrumFile)) {
                                    spectrumKeys.put(spectrumFile, new ArrayList<String>());
                                }
                                spectrumKeys.get(spectrumFile).add(spectrumKey);
                            }
                        }

                        int fileCounter = 0;

                        for (String spectrumFile : spectrumKeys.keySet()) {

                            if (psmKeys == null) {
                                progressDialog.setTitle("Copying Spectrum Matches to File. Please Wait... (" + ++fileCounter + "/" + spectrumKeys.size() + ")");
                                identification.loadSpectrumMatches(spectrumFile, progressDialog);
                                progressDialog.setTitle("Copying Spectrum Matches Details to File. Please Wait... (" + fileCounter + "/" + spectrumKeys.size() + ")");
                                identification.loadSpectrumMatchParameters(spectrumFile, psParameter, progressDialog);
                            } else {
                                progressDialog.setTitle("Copying Spectrum Matches to File. Please Wait... (" + ++fileCounter + "/" + spectrumKeys.size() + ")");
                                identification.loadSpectrumMatches(spectrumKeys.get(spectrumFile), progressDialog);
                                progressDialog.setTitle("Copying Spectrum Matches Details to File. Please Wait... (" + fileCounter + "/" + spectrumKeys.size() + ")");
                                identification.loadSpectrumMatchParameters(spectrumKeys.get(spectrumFile), psParameter, progressDialog);
                            }

                            progressDialog.setMaxPrimaryProgressCounter(spectrumKeys.get(spectrumFile).size());
                            progressDialog.setValue(0);
                            for (String psmKey : spectrumKeys.get(spectrumFile)) {

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

                                SpectrumMatch spectrumMatch = identification.getSpectrumMatch(psmKey);
                                psParameter = (PSParameter) identification.getSpectrumMatchParameter(psmKey, psParameter);
                                PeptideAssumption bestAssumption = spectrumMatch.getBestPeptideAssumption();

                                if (!bestAssumption.getPeptide().isDecoy(peptideShakerGUI.getSequenceMatchingPreferences()) || !onlyValidated) {
                                    if ((onlyValidated && psParameter.getMatchValidationLevel().isValidated()) || !onlyValidated) {
                                        if ((!includeHidden && !psParameter.isHidden()) || includeHidden) {
                                            if ((onlyStarred && psParameter.isStarred()) || !onlyStarred) {

                                                if (indexes) {
                                                    writer.write(++psmCounter + SEPARATOR);
                                                }

                                                if (accessions || proteinDescription) {

                                                    String proteinAccessions = "";
                                                    String proteinDescriptions = "";

                                                    boolean first = true;
                                                    for (String protein : bestAssumption.getPeptide().getParentProteins(peptideShakerGUI.getSequenceMatchingPreferences())) {
                                                        if (first) {
                                                            first = false;
                                                        } else {
                                                            if (accessions) {
                                                                proteinAccessions += ", ";
                                                            }
                                                            if (proteinDescription) {
                                                                proteinDescriptions += "; ";
                                                            }
                                                        }
                                                        if (accessions) {
                                                            proteinAccessions += protein;
                                                        }
                                                        if (proteinDescription) {
                                                            proteinDescriptions += sequenceFactory.getHeader(protein).getSimpleProteinDescription();
                                                        }
                                                    }
                                                    if (accessions) {
                                                        writer.write(proteinAccessions + SEPARATOR);
                                                    }
                                                    if (proteinDescription) {
                                                        writer.write(proteinDescriptions + SEPARATOR);
                                                    }
                                                }
                                                if (sequence) {
                                                    writer.write(bestAssumption.getPeptide().getSequence() + SEPARATOR);
                                                }
                                                if (modification) {
                                                    HashMap<String, ArrayList<Integer>> modMap = new HashMap<String, ArrayList<Integer>>();
                                                    for (ModificationMatch modificationMatch : bestAssumption.getPeptide().getModificationMatches()) {
                                                        if (modificationMatch.isVariable()) {
                                                            if (!modMap.containsKey(modificationMatch.getTheoreticPtm())) {
                                                                modMap.put(modificationMatch.getTheoreticPtm(), new ArrayList<Integer>());
                                                            }
                                                            modMap.get(modificationMatch.getTheoreticPtm()).add(modificationMatch.getModificationSite());
                                                        }
                                                    }
                                                    boolean first = true, first2;
                                                    ArrayList<String> mods = new ArrayList<String>(modMap.keySet());
                                                    Collections.sort(mods);
                                                    for (String mod : mods) {
                                                        if (first) {
                                                            first = false;
                                                        } else {
                                                            writer.write(", ");
                                                        }
                                                        first2 = true;
                                                        writer.write(mod + "(");
                                                        for (int aa : modMap.get(mod)) {
                                                            if (first2) {
                                                                first2 = false;
                                                            } else {
                                                                writer.write(", ");
                                                            }
                                                            writer.write(aa + "");
                                                        }
                                                        writer.write(")");
                                                    }
                                                    writer.write(SEPARATOR);
                                                }
                                                if (location) {
                                                    ArrayList<String> modList = new ArrayList<String>();
                                                    for (ModificationMatch modificationMatch : bestAssumption.getPeptide().getModificationMatches()) {
                                                        if (modificationMatch.isVariable()) {
                                                            PTM refPtm = ptmFactory.getPTM(modificationMatch.getTheoreticPtm());
                                                            for (String equivalentPtm : ptmProfile.getSimilarNotFixedModifications(refPtm.getMass())) {
                                                                if (!modList.contains(equivalentPtm)) {
                                                                    modList.add(equivalentPtm);
                                                                }
                                                            }
View Full Code Here

                            JOptionPane.showMessageDialog(null, "An error occurred when saving the file.", "Saving Failed", JOptionPane.ERROR_MESSAGE);
                            e.printStackTrace();
                            return;
                        }

                        PTMFactory ptmFactory = PTMFactory.getInstance();
                        ModificationProfile ptmProfile = peptideShakerGUI.getSearchParameters().getModificationProfile();
                        PTMScoringPreferences ptmScoringPreferences = peptideShakerGUI.getPtmScoringPreferences();

                        ProjectDetails projectDetails = peptideShakerGUI.getProjectDetails();
                        ArrayList<Integer> algorithms = projectDetails.getIdentificationAlgorithms();

                        progressDialog.setPrimaryProgressCounterIndeterminate(false);
                        progressDialog.setMaxPrimaryProgressCounter(identification.getSpectrumIdentificationSize());

                        writer.write("Index" + SEPARATOR);
                        writer.write("Protein(s)" + SEPARATOR);
                        writer.write("Protein(s) Descriptions" + SEPARATOR);
                        writer.write("Sequence" + SEPARATOR);
                        writer.write("Modification(s)" + SEPARATOR);
                        if (ptmScoringPreferences.isProbabilitsticScoreCalculation()) {
                            writer.write(ptmScoringPreferences.getSelectedProbabilisticScore().getName() + " localization" + SEPARATOR);
                        }
                        writer.write("D-score localization" + SEPARATOR);
                        if (algorithms.size() == 1 && algorithms.get(0) == Advocate.mascot.getIndex()) {
                            writer.write("MD-score localization" + SEPARATOR);
                            writer.write("MD-score" + SEPARATOR);
                        }
                        writer.write("# phosphorylations" + SEPARATOR);
                        writer.write("# phosphorylation sites" + SEPARATOR);
                        writer.write("Spectrum File" + SEPARATOR);
                        writer.write("Spectrum Title" + SEPARATOR);
                        writer.write("Precursor m/z" + SEPARATOR);
                        writer.write("Precursor Charge" + SEPARATOR);
                        writer.write("Precursor Retention Time" + SEPARATOR);
                        writer.write("Peptide Theoretical Mass" + SEPARATOR);
                        if (peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm()) {
                            writer.write("Mass Error [ppm]" + SEPARATOR);
                        } else {
                            writer.write("Mass Error [Da]" + SEPARATOR);
                        }
                        writer.write("Isotope" + SEPARATOR);
                        writer.write("Confidence" + SEPARATOR);
                        writer.write("Validation" + SEPARATOR);
                        writer.write("Decoy" + SEPARATOR);

                        writer.write(System.getProperty("line.separator"));

                        PSParameter psParameter = new PSParameter();
                        int psmCounter = 0;

                        HashMap<String, ArrayList<String>> spectrumKeys = identification.getSpectrumIdentificationMap();

                        int fileCounter = 0;

                        for (String spectrumFile : spectrumKeys.keySet()) {

                            progressDialog.setTitle("Loading Spectrum Matches. Please Wait... (" + ++fileCounter + "/" + spectrumKeys.size() + ")");
                            identification.loadSpectrumMatches(spectrumKeys.get(spectrumFile), progressDialog);
                            progressDialog.setTitle("Loading Spectrum Matches Details. Please Wait... (" + fileCounter + "/" + spectrumKeys.size() + ")");
                            identification.loadSpectrumMatchParameters(spectrumKeys.get(spectrumFile), psParameter, progressDialog);
                            progressDialog.setTitle("Copying Spectrum Matches Phospho Details to File. Please Wait... (" + fileCounter + "/" + spectrumKeys.size() + ")");
                            progressDialog.setMaxPrimaryProgressCounter(spectrumKeys.get(spectrumFile).size());
                            progressDialog.setValue(0);

                            for (String psmKey : spectrumKeys.get(spectrumFile)) {

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

                                SpectrumMatch spectrumMatch = identification.getSpectrumMatch(psmKey);
                                psParameter = (PSParameter) identification.getSpectrumMatchParameter(psmKey, psParameter);
                                PeptideAssumption bestAssumption = spectrumMatch.getBestPeptideAssumption();

                                writer.write(++psmCounter + SEPARATOR);

                                String proteinAccessions = "";
                                String proteinDescriptions = "";

                                for (String protein : bestAssumption.getPeptide().getParentProteins(peptideShakerGUI.getSequenceMatchingPreferences())) {
                                    if (!proteinAccessions.equals("")) {
                                        proteinAccessions += ", ";
                                        proteinDescriptions += "; ";
                                    }
                                    proteinAccessions += protein;
                                    proteinDescriptions += sequenceFactory.getHeader(protein).getSimpleProteinDescription();
                                }
                                writer.write(proteinAccessions + SEPARATOR);
                                writer.write(proteinDescriptions + SEPARATOR);
                                String sequence = bestAssumption.getPeptide().getSequence();
                                writer.write(sequence + SEPARATOR);
                                HashMap<String, ArrayList<Integer>> modMap = new HashMap<String, ArrayList<Integer>>();
                                for (ModificationMatch modificationMatch : bestAssumption.getPeptide().getModificationMatches()) {
                                    if (modificationMatch.isVariable()) {
                                        if (!modMap.containsKey(modificationMatch.getTheoreticPtm())) {
                                            modMap.put(modificationMatch.getTheoreticPtm(), new ArrayList<Integer>());
                                        }
                                        modMap.get(modificationMatch.getTheoreticPtm()).add(modificationMatch.getModificationSite());
                                    }
                                }
                                boolean first = true, first2;
                                ArrayList<String> mods = new ArrayList<String>(modMap.keySet());
                                Collections.sort(mods);
                                for (String mod : mods) {
                                    if (first) {
                                        first = false;
                                    } else {
                                        writer.write(", ");
                                    }
                                    first2 = true;
                                    writer.write(mod + "(");
                                    for (int aa : modMap.get(mod)) {
                                        if (first2) {
                                            first2 = false;
                                        } else {
                                            writer.write(", ");
                                        }
                                        writer.write(aa + "");
                                    }
                                    writer.write(")");
                                }
                                writer.write(SEPARATOR);
                                int nPhospho = 0;
                                ArrayList<String> modList = new ArrayList<String>();
                                for (ModificationMatch modificationMatch : bestAssumption.getPeptide().getModificationMatches()) {
                                    if (modificationMatch.isVariable()) {
                                        String ptmName = modificationMatch.getTheoreticPtm();
                                        if (ptmName.contains("phospho")) {
                                            nPhospho++;
                                        }
                                        PTM refPtm = ptmFactory.getPTM(ptmName);
                                        for (String equivalentPtm : ptmProfile.getSimilarNotFixedModifications(refPtm.getMass())) {
                                            if (!modList.contains(equivalentPtm)) {
                                                modList.add(equivalentPtm);
                                            }
                                        }
View Full Code Here

     * @param ptmProfile the PTM profile
     * @return the peptide modification location confidence as a string.
     */
    public static String getPeptideModificationLocations(Peptide peptide, PeptideMatch peptideMatch, ModificationProfile ptmProfile) {

        PTMFactory ptmFactory = PTMFactory.getInstance();

        String result = "";
        ArrayList<String> modList = new ArrayList<String>();

        for (ModificationMatch modificationMatch : peptide.getModificationMatches()) {
            if (modificationMatch.isVariable()) {
                PTM refPtm = ptmFactory.getPTM(modificationMatch.getTheoreticPtm());
                for (String equivalentPtm : ptmProfile.getSimilarNotFixedModifications(refPtm.getMass())) {
                    if (!modList.contains(equivalentPtm)) {
                        modList.add(equivalentPtm);
                    }
                }
View Full Code Here

     * map is filled based on the secondary modification sites map. Secondary
     * sites are grouped when separated by less than 10 amino acids.
     */
    public void compatibilityCheck() {
        if (ambiguousModificationsByPTM == null && secondaryModificationSites != null) {
            PTMFactory ptmFactory = PTMFactory.getInstance();
            ArrayList<Integer> sites = new ArrayList<Integer>(secondaryModificationSites.keySet());
            Collections.sort(sites);
            HashMap<Double, Integer> lastSites = new HashMap<Double, Integer>();
            HashMap<Double, HashMap<Integer, ArrayList<String>>> currentAmbiguityGroups = new HashMap<Double, HashMap<Integer, ArrayList<String>>>();
            for (int site : sites) {
                for (String ptmName : secondaryModificationSites.get(site)) {
                    PTM ptm = ptmFactory.getPTM(ptmName);
                    double ptmMass = ptm.getMass();
                    Integer lastSite = lastSites.get(ptmMass);
                    HashMap<Integer, ArrayList<String>> ambiguityGroups = currentAmbiguityGroups.get(ptmMass);
                    if (lastSite != null && lastSite < site - 10) {
                        addAmbiguousModificationSites(lastSite, ambiguityGroups);
View Full Code Here

TOP

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

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.