Examples of PSPtmScores


Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

     */
    public String getConfidentPtmSitesNumber(String proteinKey)
            throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException {

        ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
        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("(");
            result.append(psPtmScores.getConfidentSitesForPtm(ptm).size());
            result.append(")");
        }

        return result.toString();
    }
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

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

        ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
        PSPtmScores psPtmScores = new PSPtmScores();
        psPtmScores = (PSPtmScores) proteinMatch.getUrParam(psPtmScores);

        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

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

    public String getAmbiguousPtmSites(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();
        ArrayList<String> ptms = psPtmScores.getAmbiguouslyLocalizedPtms();
        Collections.sort(ptms);
        for (String ptmName : ptms) {
            if (result.length() > 0) {
                result.append(", ");
            }
            result.append(ptmName).append(" (");
            HashMap<Integer, ArrayList<Integer>> sites = psPtmScores.getAmbiguousModificationsSites(ptmName);
            ArrayList<Integer> representativeSites = new ArrayList<Integer>(sites.keySet());
            Collections.sort(representativeSites);
            boolean firstRepresentativeSite = true;
            for (int representativeSite : representativeSites) {
                if (firstRepresentativeSite) {
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

    public String getAmbiguousPtmSites(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);
        HashMap<Integer, ArrayList<String>> reportPerSite = new HashMap<Integer, ArrayList<String>>();

        for (String ptmName : targetedPtms) {

            HashMap<Integer, ArrayList<Integer>> sites = psPtmScores.getAmbiguousModificationsSites(ptmName);
            ArrayList<Integer> representativeSites = new ArrayList<Integer>(sites.keySet());
            Collections.sort(representativeSites);

            for (int representativeSite : representativeSites) {
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

     */
    public String getAmbiguousPtmSiteNumber(String proteinKey)
            throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException {

        ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
        PSPtmScores psPtmScores = new PSPtmScores();
        psPtmScores = (PSPtmScores) proteinMatch.getUrParam(psPtmScores);
        StringBuilder result = new StringBuilder();
        ArrayList<String> ptms = psPtmScores.getAmbiguouslyLocalizedPtms();
        Collections.sort(ptms);

        for (String ptmName : ptms) {
            if (result.length() > 0) {
                result.append(", ");
            }
            result.append(ptmName).append(" (").append(psPtmScores.getAmbiguousModificationsSites(ptmName).size()).append(")");
        }

        return result.toString();
    }
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

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

        ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
        PSPtmScores psPtmScores = new PSPtmScores();
        psPtmScores = (PSPtmScores) proteinMatch.getUrParam(psPtmScores);
        ArrayList<Integer> sites = new ArrayList<Integer>();

        for (String ptmName : targetedPtms) {
            HashMap<Integer, ArrayList<Integer>> ptmAmbiguousSites = psPtmScores.getAmbiguousModificationsSites(ptmName);
            for (int site : ptmAmbiguousSites.keySet()) {
                if (!sites.contains(site)) {
                    sites.add(site);
                }
            }
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

     */
    public String getModifiedSequence(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();

        for (int aa = 0; aa < sequence.length(); aa++) {
            result.append(sequence.charAt(aa));
            if (!psPtmScores.getConfidentModificationsAt(aa).isEmpty()) {
                boolean first = true;
                result.append("<");
                for (String ptm : psPtmScores.getConfidentModificationsAt(aa)) {
                    if (first) {
                        first = false;
                    } else {
                        result.append(", ");
                    }
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

                ArrayList<Double> data = new ArrayList<Double>();
                data.add(new Double(1));
                JSparklinesDataSeries sparklineDataseriesPtm = new JSparklinesDataSeries(data, new Color(0, 0, 0, 0), null);
                sparkLineDataSeriesPtm.add(sparklineDataseriesPtm);

                PSPtmScores psPtmScores = new PSPtmScores();
                ProteinMatch proteinMatch = peptideShakerGUI.getIdentification().getProteinMatch(proteinKey);

                String sequence = sequenceFactory.getProtein(proteinMatch.getMainMatch()).getSequence();
                psPtmScores = (PSPtmScores) proteinMatch.getUrParam(psPtmScores);
                int unmodifiedCounter = 0;

                // get the fixed ptms
                HashMap<Integer, String> fixedPtms = new HashMap<Integer, String>(); // @TODO: note this this only supports one fixed ptm per residue

                Identification identification = peptideShakerGUI.getIdentification();
                identification.loadPeptideMatches(peptideKeys, null);
                DisplayPreferences displayPreferences = peptideShakerGUI.getDisplayPreferences();

                for (String peptideKey : peptideKeys) {
                    boolean modified = false;
                    for (String ptmName : displayPreferences.getDisplayedPtms()) {
                        if (Peptide.isModified(peptideKey, ptmName)) {
                            modified = true;
                            break;
                        }
                    }
                    if (modified) {
                        PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
                        for (ModificationMatch modMatch : peptideMatch.getTheoreticPeptide().getModificationMatches()) {
                            if (!modMatch.isVariable()) {
                                String ptmName = modMatch.getTheoreticPtm();
                                if (displayPreferences.isDisplayedPTM(ptmName)) {
                                    ArrayList<Integer> indexes = sequenceFactory.getProtein(proteinAccession).getPeptideStart(Peptide.getSequence(peptideKey),
                                            peptideShakerGUI.getSequenceMatchingPreferences());
                                    for (Integer index : indexes) {
                                        fixedPtms.put(modMatch.getModificationSite() + index - 2, ptmName);
                                    }
                                }
                            }
                        }
                    }
                }

                for (int aa = 0; aa < sequence.length(); aa++) {

                    String ptmName = fixedPtms.get(aa);
                    for (String variablePTM : psPtmScores.getPtmsAtRepresentativeSite(aa)) {
                        if (displayPreferences.isDisplayedPTM(variablePTM)) {
                            ptmName = variablePTM;
                            break;
                        }
                    }
                    for (String variablePTM : psPtmScores.getConfidentModificationsAt(aa)) {
                        if (displayPreferences.isDisplayedPTM(variablePTM)) {
                            ptmName = variablePTM;
                            break;
                        }
                    }
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

            ClassNotFoundException, InterruptedException, MzMLUnmarshallerException {

        switch (psmFeature) {
            case probabilistic_score:
                if (spectrumMatch.getBestPeptideAssumption() != null) {
                    PSPtmScores ptmScores = new PSPtmScores();
                    ptmScores = (PSPtmScores) spectrumMatch.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:
                if (spectrumMatch.getBestPeptideAssumption() != null) {
                    StringBuilder result = new StringBuilder();
                    PSPtmScores ptmScores = new PSPtmScores();
                    ptmScores = (PSPtmScores) spectrumMatch.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();
                }
                return "";
            case localization_confidence:
                if (spectrumMatch.getBestPeptideAssumption() != null) {
                    PSPtmScores ptmScores = new PSPtmScores();
                    ptmScores = (PSPtmScores) spectrumMatch.getUrParam(ptmScores);
                    if (ptmScores != null) {
                        StringBuilder result = new StringBuilder();
                        ArrayList<String> modList = ptmScores.getScoredPTMs();
                        Collections.sort(modList);
                        for (String mod : modList) {

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

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

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

                                result.append(" (");
                                PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
                                boolean firstSite = true;

                                ArrayList<Integer> sites = ptmScoring.getOrderedPtmLocations();
                                if (sites.isEmpty()) {
                                    result.append("Not Scored");
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSPtmScores

        double ptmMass = ptm.getMass();

        try {
            peptideMatch = peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey);
            Peptide peptide = peptideMatch.getTheoreticPeptide();
            peptidePtmScore = (PSPtmScores) peptideMatch.getUrParam(new PSPtmScores());
            if (peptidePtmScore != null) {

                mainSelection = new boolean[peptide.getSequence().length()];
                for (String ptmName : peptidePtmScore.getConfidentlyLocalizedPtms()) {
                    PTM tempPTM = ptmFactory.getPTM(ptmName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.