Package eu.isas.peptideshaker.scoring

Examples of eu.isas.peptideshaker.scoring.PtmScoring


        ArrayList<com.compomics.util.gui.protein.ModificationProfile> profiles = new ArrayList<com.compomics.util.gui.protein.ModificationProfile>();
        if (scores != null) {
            for (String ptmName : scores.getScoredPTMs()) {
                Color ptmColor = peptideShakerGUI.getSearchParameters().getModificationProfile().getColor(ptmName);
                com.compomics.util.gui.protein.ModificationProfile tempProfile = new com.compomics.util.gui.protein.ModificationProfile(ptmName, new double[peptide.getSequence().length()][2], ptmColor);
                PtmScoring locationScoring = scores.getPtmScoring(ptmName);
                for (int aa = 1; aa <= peptide.getSequence().length(); aa++) {
                    tempProfile.getProfile()[aa - 1][com.compomics.util.gui.protein.ModificationProfile.SCORE_1_ROW_INDEX] = locationScoring.getDeltaScore(aa);
                    tempProfile.getProfile()[aa - 1][com.compomics.util.gui.protein.ModificationProfile.SCORE_2_ROW_INDEX] = locationScoring.getProbabilisticScore(aa);
                }

                profiles.add(tempProfile);
            }
        }
View Full Code Here


                                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);
                                        if (tableDScore == null || tableDScore < ptmDScore) {
                                            dScores.put(site, ptmDScore);
                                        }
                                        double ptmPScore = ptmScoring.getProbabilisticScore(site);
                                        Double tablePScore = pScores.get(site);
                                        if (tablePScore == null || tablePScore < ptmPScore) {
                                            pScores.put(site, ptmPScore);
                                        }
                                    }
View Full Code Here

                        return peptideShakerGUI.getDisplayFeaturesGenerator().getTaggedPeptideSequence(peptideMatch, true, true, true);
                    case 4:
                        PSPtmScores ptmScores = new PSPtmScores();
                        ptmScores = (PSPtmScores) identification.getPeptideMatch(displayedPeptides.get(row)).getUrParam(ptmScores);
                        if (ptmScores != null && ptmScores.getPtmScoring(getSelectedModification()) != null) {
                            PtmScoring ptmScoring = ptmScores.getPtmScoring(getSelectedModification());
                            return ptmScoring.getMinimalLocalizationConfidence();
                        } else {
                            return PtmScoring.NOT_FOUND;
                        }
                    case 5:
                        probabilities = new PSParameter();
View Full Code Here

                        return peptideShakerGUI.getDisplayFeaturesGenerator().getTaggedPeptideSequence(peptideMatch, true, true, true);
                    case 4:
                        PSPtmScores ptmScores = new PSPtmScores();
                        ptmScores = (PSPtmScores) identification.getPeptideMatch(relatedPeptides.get(row)).getUrParam(ptmScores);
                        if (ptmScores != null && ptmScores.getPtmScoring(getSelectedModification()) != null) {
                            PtmScoring ptmScoring = ptmScores.getPtmScoring(getSelectedModification());
                            return ptmScoring.getMinimalLocalizationConfidence();
                        } else {
                            return PtmScoring.NOT_FOUND;
                        }
                    case 5:
                        probabilities = new PSParameter();
View Full Code Here

                    case 3:
                        spectrumKey = identification.getPeptideMatch(getSelectedPeptide(relatedTable)).getSpectrumMatches().get(row);
                        PSPtmScores ptmScores = new PSPtmScores();
                        ptmScores = (PSPtmScores) identification.getSpectrumMatch(spectrumKey).getUrParam(ptmScores);
                        if (ptmScores != null && ptmScores.getPtmScoring(getSelectedModification()) != null) {
                            PtmScoring ptmScoring = ptmScores.getPtmScoring(getSelectedModification());
                            return ptmScoring.getMinimalLocalizationConfidence();
                        } else {
                            return PtmScoring.NOT_FOUND;
                        }
                    case 4:
                        spectrumKey = identification.getPeptideMatch(getSelectedPeptide(relatedTable)).getSpectrumMatches().get(row);
View Full Code Here

                if (ptmScores != null) {
                    StringBuilder result = new StringBuilder();
                    ArrayList<String> modList = new ArrayList<String>(ptmScores.getScoredPTMs());
                    Collections.sort(modList);
                    for (String mod : modList) {
                        PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                        ArrayList<Integer> sites = new ArrayList<Integer>(ptmScoring.getProbabilisticSites());
                        if (!sites.isEmpty()) {
                            Collections.sort(sites);
                            if (result.length() > 0) {
                                result.append(", ");
                            }
                            result.append(mod).append(" (");
                            boolean firstSite = true;
                            for (int site : sites) {
                                if (firstSite) {
                                    firstSite = false;
                                } else {
                                    result.append(", ");
                                }
                                result.append(site).append(": ").append(ptmScoring.getProbabilisticScore(site));
                            }
                            result.append(")");
                        }
                    }
                    return result.toString();
                }
                return "";
            case d_score:
                StringBuilder result = new StringBuilder();
                ptmScores = new PSPtmScores();
                ptmScores = (PSPtmScores) peptideMatch.getUrParam(ptmScores);
                if (ptmScores != null) {
                    ArrayList<String> modList = new ArrayList<String>(ptmScores.getScoredPTMs());
                    Collections.sort(modList);
                    for (String mod : modList) {
                        PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                        ArrayList<Integer> sites = new ArrayList<Integer>(ptmScoring.getDSites());
                        if (!sites.isEmpty()) {
                            Collections.sort(sites);
                            if (result.length() > 0) {
                                result.append(", ");
                            }
                            result.append(mod).append(" (");
                            boolean firstSite = true;
                            for (int site : sites) {
                                if (firstSite) {
                                    firstSite = false;
                                } else {
                                    result.append(", ");
                                }
                                result.append(site).append(": ").append(ptmScoring.getDeltaScore(site));
                            }
                            result.append(")");
                        }
                    }
                    return result.toString();
View Full Code Here

                if (result.length() > 0) {
                    result.append(", ");
                }
                PSPtmScores ptmScores = (PSPtmScores) peptideMatch.getUrParam(new PSPtmScores());
                result.append(mod).append(" (");
                PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                boolean firstSite = true;
                for (int site : ptmScoring.getOrderedPtmLocations()) {
                    if (firstSite) {
                        firstSite = false;
                    } else {
                        result.append(", ");
                    }
                    int ptmConfidence = ptmScoring.getLocalizationConfidence(site);
                    if (ptmConfidence == PtmScoring.NOT_FOUND) {
                        result.append(site).append(": Not Scored");
                    } else if (ptmConfidence == PtmScoring.RANDOM) {
                        result.append(site).append(": Random");
                    } else if (ptmConfidence == PtmScoring.DOUBTFUL) {
View Full Code Here

                                                                writer.write(", ");
                                                            }
                                                            ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
                                                            writer.write(mod + " (");
                                                            if (ptmScores != null && ptmScores.getPtmScoring(mod) != null) {
                                                                PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                                                                boolean firstSite = true;
                                                                for (int site : ptmScoring.getOrderedPtmLocations()) {
                                                                    if (firstSite) {
                                                                        firstSite = false;
                                                                    } else {
                                                                        writer.write(", ");
                                                                    }
                                                                    int ptmConfidence = ptmScoring.getLocalizationConfidence(site);
                                                                    if (ptmConfidence == PtmScoring.NOT_FOUND) {
                                                                        writer.write(site + ": Not Scored"); // Well this should not happen
                                                                    } else if (ptmConfidence == PtmScoring.RANDOM) {
                                                                        writer.write(site + ": Random");
                                                                    } else if (ptmConfidence == PtmScoring.DOUBTFUL) {
                                                                        writer.write(site + ": Doubtfull");
                                                                    } else if (ptmConfidence == PtmScoring.CONFIDENT) {
                                                                        writer.write(site + ": Confident");
                                                                    } else if (ptmConfidence == PtmScoring.VERY_CONFIDENT) {
                                                                        writer.write(site + ": Very Confident");
                                                                    }
                                                                }
                                                            } else {
                                                                writer.write("Not Scored");
                                                            }
                                                            writer.write(")");
                                                        }
                                                    }
                                                    writer.write(SEPARATOR);
                                                    if (ptmScoringPreferences.isProbabilitsticScoreCalculation()) {
                                                        first = true;
                                                        for (String mod : modList) {
                                                            if (spectrumMatch.getUrParam(ptmScores) != null) {
                                                                if (first) {
                                                                    first = false;
                                                                } else {
                                                                    writer.write(", ");
                                                                }
                                                                ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
                                                                writer.write(mod + " (");
                                                                if (ptmScores != null && ptmScores.getPtmScoring(mod) != null) {
                                                                    PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                                                                    boolean firstSite = true;
                                                                    ArrayList<Integer> sites = new ArrayList<Integer>(ptmScoring.getProbabilisticSites());
                                                                    Collections.sort(sites);
                                                                    for (int site : sites) {
                                                                        if (firstSite) {
                                                                            firstSite = false;
                                                                        } else {
                                                                            writer.write(", ");
                                                                        }
                                                                        writer.write(site + ": " + ptmScoring.getProbabilisticScore(site));
                                                                    }
                                                                } else {
                                                                    writer.write("Not Scored");
                                                                }
                                                                writer.write(")");
                                                            }
                                                        }
                                                    }
                                                    writer.write(SEPARATOR);
                                                    first = true;
                                                    for (String mod : modList) {
                                                        if (spectrumMatch.getUrParam(ptmScores) != null) {
                                                            if (first) {
                                                                first = false;
                                                            } else {
                                                                writer.write(", ");
                                                            }
                                                            ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
                                                            writer.write(mod + " (");
                                                            if (ptmScores != null && ptmScores.getPtmScoring(mod) != null) {
                                                                PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                                                                boolean firstSite = true;
                                                                ArrayList<Integer> sites = new ArrayList<Integer>(ptmScoring.getDSites());
                                                                Collections.sort(sites);
                                                                for (int site : sites) {
                                                                    if (firstSite) {
                                                                        firstSite = false;
                                                                    } else {
                                                                        writer.write(", ");
                                                                    }
                                                                    writer.write(site + ": " + ptmScoring.getDeltaScore(site));
                                                                }
                                                            } else {
                                                                writer.write("Not Scored");
                                                            }
                                                            writer.write(")");
View Full Code Here

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

                result += ", ";
            }
            PSPtmScores ptmScores = (PSPtmScores) peptideMatch.getUrParam(new PSPtmScores());
            result += mod + " (";
            if (ptmScores != null && ptmScores.getPtmScoring(mod) != null) {
                PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                boolean firstSite = true;
                for (int site : ptmScoring.getOrderedPtmLocations()) {
                    if (firstSite) {
                        firstSite = false;
                    } else {
                        result += ", ";
                    }
                    int ptmConfidence = ptmScoring.getLocalizationConfidence(site);
                    if (ptmConfidence == PtmScoring.NOT_FOUND) {
                        result += site + ": Not Scored"; // Well this should not happen
                    } else if (ptmConfidence == PtmScoring.RANDOM) {
                        result += site + ": Random";
                    } else if (ptmConfidence == PtmScoring.DOUBTFUL) {
View Full Code Here

TOP

Related Classes of eu.isas.peptideshaker.scoring.PtmScoring

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.