Package com.compomics.util.experiment.identification

Examples of com.compomics.util.experiment.identification.Identification


     * @param match the key of the match
     */
    public void starPsm(String match) {

        try {
            Identification identification = peptideShakerGUI.getIdentification();
            FilterPreferences filterPreferences = peptideShakerGUI.getFilterPreferences();
            PSParameter psParameter = new PSParameter();
            psParameter = (PSParameter) identification.getSpectrumMatchParameter(match, psParameter);
            boolean validated = false;

            if (!validated) {
                for (PsmFilter matchFilter : filterPreferences.getPsmStarFilters().values()) {
                    if (matchFilter.getExceptions().contains(match)) {
                        matchFilter.removeException(match);
                    }
                    if (matchFilter.isValidated(match, peptideShakerGUI.getIdentification(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getAnnotationPreferences())) {
                        validated = true;
                    }
                }
                PsmFilter psmFilter;
                if (!filterPreferences.getPsmStarFilters().containsKey(MatchFilter.MANUAL_SELECTION)) {
                    psmFilter = new PsmFilter(MatchFilter.MANUAL_SELECTION);
                    psmFilter.setCharges(peptideShakerGUI.getMetrics().getFoundCharges());
                    psmFilter.setFileNames(peptideShakerGUI.getIdentification().getSpectrumFiles());
                    psmFilter.setDescription("Manual selection via the graphical interface");
                    filterPreferences.getPsmStarFilters().put(psmFilter.getName(), psmFilter);
                } else {
                    psmFilter = filterPreferences.getPsmStarFilters().get(MatchFilter.MANUAL_SELECTION);
                }
                psmFilter.addManualValidation(match);
            }

            psParameter.setStarred(true);
            identification.updateSpectrumMatchParameter(match, psParameter);
            peptideShakerGUI.setDataSaved(false);
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
        }
    }
View Full Code Here


     * @param match the key of the match
     */
    public void unStarPsm(String match) {

        try {
            Identification identification = peptideShakerGUI.getIdentification();
            FilterPreferences filterPreferences = peptideShakerGUI.getFilterPreferences();
            PSParameter psParameter = new PSParameter();
            psParameter = (PSParameter) identification.getSpectrumMatchParameter(match, psParameter);

            for (PsmFilter matchFilter : filterPreferences.getPsmStarFilters().values()) {
                if (matchFilter.getManualValidation().contains(match)) {
                    matchFilter.removeManualValidation(match);
                }
                if (matchFilter.isValidated(match, peptideShakerGUI.getIdentification(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getAnnotationPreferences())) {
                    matchFilter.addException(match);
                }
            }

            psParameter.setStarred(false);
            identification.updateSpectrumMatchParameter(match, psParameter);
            peptideShakerGUI.setDataSaved(false);
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
        }
    }
View Full Code Here

     * @param match the key of the match
     */
    public void hidePsm(String match) {

        try {
            Identification identification = peptideShakerGUI.getIdentification();
            FilterPreferences filterPreferences = peptideShakerGUI.getFilterPreferences();
            PSParameter psParameter = new PSParameter();
            psParameter = (PSParameter) identification.getSpectrumMatchParameter(match, psParameter);
            boolean validated = false;

            if (!validated) {
                for (PsmFilter matchFilter : filterPreferences.getPsmHideFilters().values()) {
                    if (matchFilter.getExceptions().contains(match)) {
                        matchFilter.removeException(match);
                    }
                    if (matchFilter.isValidated(match, peptideShakerGUI.getIdentification(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getAnnotationPreferences())) {
                        validated = true;
                    }
                }
                PsmFilter psmFilter;
                if (!filterPreferences.getPsmHideFilters().containsKey(MatchFilter.MANUAL_SELECTION)) {
                    psmFilter = new PsmFilter(MatchFilter.MANUAL_SELECTION);
                    psmFilter.setCharges(peptideShakerGUI.getMetrics().getFoundCharges());
                    psmFilter.setFileNames(peptideShakerGUI.getIdentification().getSpectrumFiles());
                    psmFilter.setDescription("Manual selection via the graphical interface");
                    filterPreferences.getPsmHideFilters().put(psmFilter.getName(), psmFilter);
                } else {
                    psmFilter = filterPreferences.getPsmHideFilters().get(MatchFilter.MANUAL_SELECTION);
                }
                psmFilter.addManualValidation(match);
            }

            psParameter.setHidden(true);
            identification.updateSpectrumMatchParameter(match, psParameter);
            peptideShakerGUI.setDataSaved(false);
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
        }
    }
View Full Code Here

     * @param match the key of the match
     */
    public void unHidePsm(String match) {

        try {
            Identification identification = peptideShakerGUI.getIdentification();
            FilterPreferences filterPreferences = peptideShakerGUI.getFilterPreferences();
            PSParameter psParameter = new PSParameter();
            psParameter = (PSParameter) identification.getSpectrumMatchParameter(match, psParameter);

            for (PsmFilter matchFilter : filterPreferences.getPsmHideFilters().values()) {
                if (matchFilter.getManualValidation().contains(match)) {
                    matchFilter.removeManualValidation(match);
                }
                if (matchFilter.isValidated(match, peptideShakerGUI.getIdentification(), peptideShakerGUI.getSearchParameters(), peptideShakerGUI.getAnnotationPreferences())) {
                    matchFilter.addException(match);
                }
            }

            psParameter.setHidden(false);
            identification.updateSpectrumMatchParameter(match, psParameter);
            peptideShakerGUI.setDataSaved(false);
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
        }
    }
View Full Code Here

     * @throws IOException
     * @throws InterruptedException
     */
    public ArrayList<String> getPossibilitiesDescriptions() throws SQLException, ClassNotFoundException, IOException, InterruptedException {

        Identification identification = peptideShakerGUI.getIdentification();

        // Some necessary pre-caching
        ArrayList<Type> typeList = types.get(jumpType);
        ArrayList<String> keys = possibilities.get(jumpType),
                proteinKeys = new ArrayList<String>(),
                peptideKeys = new ArrayList<String>();
        for (int i = 0; i < keys.size(); i++) {
            String key = keys.get(i);
            if (typeList.get(i) == Type.PROTEIN) {
                proteinKeys.add(key);
            } else if (typeList.get(i) == Type.PEPTIDE) {
                proteinKeys.add(key);
            }
        }
        if (!proteinKeys.isEmpty()) {
            identification.loadProteinMatches(proteinKeys, null);
        }
        if (!peptideKeys.isEmpty()) {
            identification.loadPeptideMatches(peptideKeys, null);
        }

        ArrayList<String> descriptions = new ArrayList<String>();
        for (int i = 0; i < keys.size(); i++) {
            String key = keys.get(i);
View Full Code Here

     * @throws IOException
     * @throws ClassNotFoundException
     * @throws InterruptedException
     */
    private String getItemDescription(String key, Type itemType) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException {
        Identification identification = peptideShakerGUI.getIdentification();
        switch (itemType) {
            case PROTEIN:
                ProteinMatch proteinMatch = identification.getProteinMatch(key);
                String mainMatch = proteinMatch.getMainMatch();
                String description = sequenceFactory.getHeader(mainMatch).getSimpleProteinDescription();
                String result = mainMatch;
                for (String accession : ProteinMatch.getAccessions(key)) {
                    if (!accession.equals(mainMatch)) {
                        if (!result.equals(mainMatch)) {
                            result += ", ";
                        }
                        result += accession;
                    }
                }
                result += " - " + description;
                return result;
            case PEPTIDE:
                PeptideMatch peptideMatch = identification.getPeptideMatch(key);
                return peptideShakerGUI.getDisplayFeaturesGenerator().getTaggedPeptideSequence(peptideMatch, true, true, true);
            case SPECTRUM:
                return Spectrum.getSpectrumTitle(key) + " (" + Spectrum.getSpectrumFile(key) + ")";
            default:
                return "Unknown";
View Full Code Here

        new Thread("Star/Hide") {
            @Override
            public void run() {

                try {
                    Identification identification = peptideShakerGUI.getIdentification();
                    progressDialog.setPrimaryProgressCounterIndeterminate(false);
                    progressDialog.setMaxPrimaryProgressCounter(identification.getProteinIdentification().size());

                    PSParameter psParameter = new PSParameter();

                    identification.loadProteinMatches(null);
                    identification.loadProteinMatchParameters(psParameter, null);

                    // @TODO: implement better database batch interaction!!

                    HashMap<String, ArrayList<Double>> fractionMW = new HashMap<String, ArrayList<Double>>();

                    for (String proteinKey : identification.getProteinIdentification()) {

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

                        ProteinMatch proteinMatch = identification.getProteinMatch(proteinKey);
                        boolean peptideSurvived = false;

                        identification.loadPeptideMatches(proteinMatch.getPeptideMatchesKeys(), null);
                        identification.loadPeptideMatchParameters(proteinMatch.getPeptideMatchesKeys(), psParameter, null);

                        for (String peptideKey : proteinMatch.getPeptideMatchesKeys()) {

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

                            PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
                            boolean psmSurvived = false;

                            identification.loadSpectrumMatchParameters(peptideMatch.getSpectrumMatches(), psParameter, null);

                            for (String spectrumKey : peptideMatch.getSpectrumMatches()) {

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

                                psParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, psParameter);

                                if (isPsmHidden(spectrumKey)) {
                                    psParameter.setHidden(true);
                                } else {
                                    psParameter.setHidden(false);
                                    psmSurvived = true;
                                }

                                psParameter.setStarred(isPsmStarred(spectrumKey));
                                identification.updateSpectrumMatchParameter(spectrumKey, psParameter);
                            }

                            psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, psParameter);

                            if (!psmSurvived) {
                                psParameter.setHidden(true);
                            } else if (isPeptideHidden(peptideKey)) {
                                psParameter.setHidden(true);
                            } else {
                                psParameter.setHidden(false);
                                peptideSurvived = true;
                            }

                            psParameter.setStarred(isPeptideStarred(peptideKey));

                            identification.updatePeptideMatchParameter(peptideKey, psParameter);
                        }

                        psParameter = (PSParameter) identification.getProteinMatchParameter(proteinKey, psParameter);

                        if (!peptideSurvived) {
                            psParameter.setHidden(true);
                        } else {
                            psParameter.setHidden(isProteinHidden(proteinKey));
                        }

                        psParameter.setStarred(isProteinStarred(proteinKey));

                        identification.updateProteinMatchParameter(proteinKey, psParameter);


                        // update the observed fractional molecular weights per fraction
                        if (!psParameter.isHidden() && psParameter.getMatchValidationLevel().isValidated() && !proteinMatch.isDecoy()) {
View Full Code Here

TOP

Related Classes of com.compomics.util.experiment.identification.Identification

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.