Package eu.isas.peptideshaker.myparameters

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores


     * updated, otherwise the related peptide profile is updated
     */
    private void updateModificationProfile(PeptideMatch peptideMatch, boolean selectedPeptideProfile) {

        try {
            PSPtmScores scores = new PSPtmScores();
            scores = (PSPtmScores) peptideMatch.getUrParam(scores);
            ArrayList<com.compomics.util.gui.protein.ModificationProfile> profiles = getModificationProfile(peptideMatch.getTheoreticPeptide(), scores);

            SequenceModificationPanel sequenceModificationPanel
                    = new SequenceModificationPanel(peptideMatch.getTheoreticPeptide().getNTerminal() + "-"
View Full Code Here


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

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

                        if (ptmScores != null) {

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

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

                                PTM ptm = ptmFactory.getPTM(ptmName);

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

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

                    case 3:
                        String peptideKey = displayedPeptides.get(row);
                        PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
                        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:
View Full Code Here

                    case 3:
                        String peptideKey = relatedPeptides.get(row);
                        PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
                        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:
View Full Code Here

                    case 2:
                        spectrumKey = identification.getPeptideMatch(getSelectedPeptide(relatedTable)).getSpectrumMatches().get(row);
                        return peptideShakerGUI.getDisplayFeaturesGenerator().getTaggedPeptideSequence(identification.getSpectrumMatch(spectrumKey), true, true, true);
                    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:
View Full Code Here

            case validated:
                return psParameter.getMatchValidationLevel().toString();
            case validated_psms:
                return identificationFeaturesGenerator.getNValidatedSpectraForPeptide(peptideMatch.getKey()) + "";
            case probabilistic_score:
                PSPtmScores ptmScores = new PSPtmScores();
                ptmScores = (PSPtmScores) peptideMatch.getUrParam(ptmScores);
                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(", ");
View Full Code Here

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

        PSPtmScores psPtmScores = new PSPtmScores();
        psPtmScores = (PSPtmScores) peptideMatch.getUrParam(psPtmScores);

        if (psPtmScores != null) {
            ArrayList<String> modList = psPtmScores.getScoredPTMs();

            StringBuilder result = new StringBuilder();
            Collections.sort(modList);

            for (String mod : modList) {
                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 {
View Full Code Here

                            }
                        }

                        StringBuilder dScore = new StringBuilder();
                        Collections.sort(modifications);
                        PSPtmScores ptmScores = new PSPtmScores();

                        for (String mod : modifications) {

                            if (spectrumMatch.getUrParam(ptmScores) != null) {

                                if (dScore.length() > 0) {
                                    dScore.append(", ");
                                }

                                ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
                                dScore.append(mod).append(" (");

                                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 {
                                            dScore.append(", ");
                                        }
                                        dScore.append(site).append(": ").append(ptmScoring.getDeltaScore(site));
                                    }
                                } else {
                                    dScore.append("Not Scored");
                                }
                                dScore.append(")");
                            }
                        }

                        StringBuilder probabilisticScore = new StringBuilder();

                        if (ptmScoringPreferences.isProbabilitsticScoreCalculation()) {

                            for (String mod : modifications) {

                                if (spectrumMatch.getUrParam(ptmScores) != null) {

                                    if (probabilisticScore.length() > 0) {
                                        probabilisticScore.append(", ");
                                    }

                                    ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
                                    probabilisticScore.append(mod).append(" (");

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

    public String getConfidentPtmSites(String proteinKey)
            throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException {

        ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
        String sequence = sequenceFactory.getProtein(proteinMatch.getMainMatch()).getSequence();
        PSPtmScores psPtmScores = new PSPtmScores();
        psPtmScores = (PSPtmScores) proteinMatch.getUrParam(psPtmScores);

        StringBuilder result = new StringBuilder();
        boolean firstPtm = true;
        ArrayList<String> ptms = psPtmScores.getConfidentlyLocalizedPtms();
        Collections.sort(ptms);

        for (String ptm : ptms) {
            if (firstPtm) {
                firstPtm = false;
            } else {
                result.append("; ");
            }
            result.append(ptm);
            result.append("(");
            boolean firstSite = true;
            ArrayList<Integer> sites = psPtmScores.getConfidentSitesForPtm(ptm);
            Collections.sort(sites);
            for (Integer site : sites) {
                if (!firstSite) {
                    result.append(", ");
                } else {
View Full Code Here

    public String getConfidentPtmSites(String proteinKey, ArrayList<String> targetedPtms)
            throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException {

        ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
        String sequence = sequenceFactory.getProtein(proteinMatch.getMainMatch()).getSequence();
        PSPtmScores psPtmScores = new PSPtmScores();
        psPtmScores = (PSPtmScores) proteinMatch.getUrParam(psPtmScores);

        StringBuilder result = new StringBuilder();

        Collections.sort(targetedPtms);
        ArrayList<Integer> sites = new ArrayList<Integer>();
        for (String ptm : targetedPtms) {
            for (Integer site : psPtmScores.getConfidentSitesForPtm(ptm)) {
                if (!sites.contains(site)) {
                    sites.add(site);
                }
            }
        }
View Full Code Here

TOP

Related Classes of eu.isas.peptideshaker.myparameters.PSPtmScores

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.