Package com.compomics.util.preferences

Examples of com.compomics.util.preferences.ModificationProfile


                    SpectrumMatch spectrumMatch = identification.getSpectrumMatch(key);

                    SearchParameters searchParameters = peptideShakerGUI.getSearchParameters();
                    int forwardIon = searchParameters.getIonSearched1();
                    int rewindIon = searchParameters.getIonSearched2();
                    ModificationProfile modificationProfile = searchParameters.getModificationProfile();

                    if (currentSpectrum != null && tempSpectrumPanel != null) {

                        if (currentSpectrum.getMzValuesAsArray().length > 0 && currentSpectrum.getIntensityValuesAsArray().length > 0) {
View Full Code Here


        Integer validationType = probabilities.getMatchValidationLevel().getIndex();

        String sequence;
        if (currentAssumption instanceof PeptideAssumption) {
            SearchParameters searchParameters = peptideShakerGUI.getSearchParameters();
            ModificationProfile modificationProfile = searchParameters.getModificationProfile();
            Peptide peptide = ((PeptideAssumption) currentAssumption).getPeptide();

            boolean showFixed = false; // @TODO: has to be a better way of doing this?
            for (String ptmName : peptideShakerGUI.getDisplayPreferences().getDisplayedPtms()) {
                if (modificationProfile.getFixedModifications().contains(ptmName)) {
                    showFixed = true;
                }
            }

            sequence = peptide.getTaggedModifiedSequence(modificationProfile, true, true, true, !showFixed);
View Full Code Here

                    DefaultTableModel dm = (DefaultTableModel) ptmJTable.getModel();
                    dm.getDataVector().removeAllElements();
                    dm.fireTableDataChanged();

                    ModificationProfile modificationProfile = peptideShakerGUI.getSearchParameters().getModificationProfile();

                    for (String modification : modificationProfile.getAllNotFixedModifications()) {
                        if (!modification.equalsIgnoreCase(NO_MODIFICATION)) {
                            ((DefaultTableModel) ptmJTable.getModel()).addRow(new Object[]{modificationProfile.getColor(modification), modification});
                        }
                    }

                    ((DefaultTableModel) ptmJTable.getModel()).addRow(new Object[]{
                        Color.lightGray,
View Full Code Here

    private void loadModificationProfile(File aFile) {
        try {
            FileInputStream fis = new FileInputStream(aFile);
            BufferedInputStream bis = new BufferedInputStream(fis);
            ObjectInputStream in = new ObjectInputStream(bis);
            ModificationProfile modificationProfile = (ModificationProfile) in.readObject();
            in.close();
            bis.close();
            fis.close();
            getSearchParameters().setModificationProfile(modificationProfile);
        } catch (FileNotFoundException e) {
View Full Code Here

//        knownMassDeltas.put(NeutralLoss.H3PO4.mass, "H3PO4");
//        knownMassDeltas.put(NeutralLoss.HPO3.mass, "HPO3");
//        knownMassDeltas.put(4d, "18O"); // @TODO: should this be added to neutral losses??
//        knownMassDeltas.put(44d, "PEG"); // @TODO: should this be added to neutral losses??
        // add the modifications
        ModificationProfile modificationProfile = getSearchParameters().getModificationProfile();
        ArrayList<String> modificationList = modificationProfile.getAllModifications();
        Collections.sort(modificationList);

        // iterate the modifications list and add the non-terminal modifications
        for (String modification : modificationList) {
            PTM ptm = ptmFactory.getPTM(modification);
View Full Code Here

                saveException.printStackTrace();
                JOptionPane.showMessageDialog(null, "Error occurred while reading " + file + ". Please verify the search paramters.", "File error", JOptionPane.ERROR_MESSAGE);
            }
        }

        ModificationProfile modificationProfile = searchParameters.getModificationProfile();

        ArrayList<String> missing = new ArrayList<String>();

        for (String name : modificationProfile.getAllNotFixedModifications()) {
            if (!ptmFactory.containsPTM(name)) {
                missing.add(name);
            } else {
                if (modificationProfile.getColor(name) == null) {
                    searchParameters.getModificationProfile().setColor(name, Color.lightGray);
                }
            }
        }
        if (!missing.isEmpty()) {
View Full Code Here

     * Updates the sequence label based on the selection in the table.
     */
    private void updateSequenceLabel() {
        try {
            DisplayPreferences displayPreferences = peptideShakerGUI.getDisplayPreferences();
            ModificationProfile modificationProfile = peptideShakerGUI.getSearchParameters().getModificationProfile();
            Peptide peptide = peptideMatch.getTheoreticPeptide();
            PSPtmScores ptmScores = new PSPtmScores();
            ptmScores = (PSPtmScores) peptideMatch.getUrParam(ptmScores);
            HashMap<Integer, ArrayList<String>> fixedModifications = DisplayFeaturesGenerator.getFilteredModifications(peptide.getIndexedFixedModifications(), displayPreferences.getDisplayedPtms());
            HashMap<Integer, ArrayList<String>> confidentLocations = DisplayFeaturesGenerator.getFilteredConfidentModificationsSites(ptmScores, displayPreferences.getDisplayedPtms());
View Full Code Here

                        PSParameter peptidePSParameter = new PSParameter();
                        PSParameter secondaryPSParameter = new PSParameter();
                        int peptideCounter = 0;
                        HashMap<String, HashMap<Integer, String[]>> surroundingAAs = new HashMap<String, HashMap<Integer, String[]>>();
                        ProteinMatch proteinMatch = null;
                        ModificationProfile ptmProfile = peptideShakerGUI.getSearchParameters().getModificationProfile();

                        // @TODO: try to batch load the spectra? as this would speed up the export...
                        progressDialog.setTitle("Loading Peptide Matches. Please Wait...");
                        identification.loadPeptideMatches(progressDialog);
                        progressDialog.setTitle("Loading Peptide Details. Please Wait...");
View Full Code Here

                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

                            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);
                                            }
                                        }
                                    }
                                }

                                Collections.sort(modList);
                                PSPtmScores ptmScores = new PSPtmScores();
                                first = true;
                                StringBuilder dLocalizations = new StringBuilder();
                                StringBuilder probabilisticLocalizations = new StringBuilder();
                                String mdLocation = "";
                                String mdScore = "";
                                String[] split = sequence.split("[STY]");
                                int nSites = split.length - 1;
                                ArrayList<String> phosphoNames = new ArrayList<String>();

                                for (String mod : modList) {
                                    if (mod.contains("phospho")) {
                                        phosphoNames.add(mod);
                                        if (spectrumMatch.getUrParam(ptmScores) != null) {
                                            ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
                                            if (ptmScores != null && ptmScores.getPtmScoring(mod) != null) {
                                                PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                                                ArrayList<Integer> sites = new ArrayList<Integer>(ptmScoring.getProbabilisticSites());
                                                Collections.sort(sites);
                                                for (Integer site : sites) {
                                                    if (probabilisticLocalizations.length() > 0) {
                                                        probabilisticLocalizations.append(", ");
                                                    }
                                                    probabilisticLocalizations.append(site.toString()).append(": ").append(ptmScoring.getProbabilisticScore(site));
                                                }
                                                sites = new ArrayList<Integer>(ptmScoring.getDSites());
                                                Collections.sort(sites);
                                                for (Integer site : sites) {
                                                    if (dLocalizations.length() > 0) {
                                                        dLocalizations.append(", ");
                                                    }
                                                    dLocalizations.append(site.toString()).append(": ").append(ptmScoring.getDeltaScore(site));
                                                }
                                            }
                                        }
                                    }
                                }
                                if (algorithms.size() == 1 && algorithms.get(0) == Advocate.mascot.getIndex()) {
                                    if (!phosphoNames.isEmpty() && spectrumMatch.hasAssumption(Advocate.mascot.getIndex())) {
                                        PeptideAssumption mascotAssumption = null;
                                        double bestScore = 0;
                                        for (ArrayList<SpectrumIdentificationAssumption> peptideAssumptionList : spectrumMatch.getAllAssumptions(Advocate.mascot.getIndex()).values()) {
                                            for (SpectrumIdentificationAssumption assumption : peptideAssumptionList) {
                                                PeptideAssumption peptideAssumption = (PeptideAssumption) assumption;
                                                MascotScore mascotScore = new MascotScore();
                                                mascotScore = (MascotScore) peptideAssumption.getUrParam(mascotScore);
                                                if (mascotScore.getScore() > bestScore) {
                                                    mascotAssumption = peptideAssumption;
                                                    bestScore = mascotScore.getScore();
                                                }
                                            }
                                        }
                                        if (mascotAssumption != null) {
                                            Peptide mascotPeptide = mascotAssumption.getPeptide();
                                            Double score = MDScore.getMDScore(spectrumMatch, mascotPeptide, phosphoNames, peptideShakerGUI.getSequenceMatchingPreferences());
                                            if (score != null) {
                                                mdScore = score.toString();
                                            }
                                            ArrayList<Integer> sites = new ArrayList<Integer>();
                                            for (ModificationMatch modificationMatch : mascotPeptide.getModificationMatches()) {
                                                if (modificationMatch.getTheoreticPtm().contains("phospho")) {
                                                    sites.add(modificationMatch.getModificationSite());
                                                }
                                            }
                                            Collections.sort(sites);
                                            for (int site : sites) {
                                                if (!mdLocation.equals("")) {
                                                    mdLocation += ", ";
                                                }
                                                mdLocation += site;
                                            }
                                        }
                                    }
                                }
                                if (ptmScoringPreferences.isProbabilitsticScoreCalculation()) {
                                    writer.write(probabilisticLocalizations + SEPARATOR);
                                }
                                writer.write(dLocalizations + SEPARATOR);
                                if (algorithms.size() == 1 && algorithms.get(0) == Advocate.mascot.getIndex()) {
                                    writer.write(mdLocation + SEPARATOR);
                                    writer.write(mdScore + SEPARATOR);
                                }
                                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() + ")");
                                }
                                writer.write(SEPARATOR);
                                if (bestAssumption.getPeptide().isDecoy(peptideShakerGUI.getSequenceMatchingPreferences())) {
                                    writer.write(1 + SEPARATOR);
                                } else {
                                    writer.write(0 + SEPARATOR);
                                }
                                writer.write(System.getProperty("line.separator"));
                                progressDialog.increasePrimaryProgressCounter();
                            }
                        }
                        writer.close();
                        try {
                            File outputFile = new File(selectedFile.getParent(), reducedName + "_Proteins_phospho.txt");
                            writer = new BufferedWriter(new FileWriter(outputFile));
                        } catch (IOException e) {
                            JOptionPane.showMessageDialog(null, "An error occurred when saving the protein details.", "Saving Failed", JOptionPane.ERROR_MESSAGE);
                            e.printStackTrace();
                            return;
                        }

                        ArrayList<String> targetedPtms = new ArrayList<String>();
                        for (String ptm : ptmProfile.getAllNotFixedModifications()) {
                            if (ptm.contains("phospho")) {
                                targetedPtms.add(ptm);
                            }
                        }
View Full Code Here

TOP

Related Classes of com.compomics.util.preferences.ModificationProfile

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.