Examples of PSParameter


Examples of eu.isas.peptideshaker.myparameters.PSParameter

        }

        int totalNumberOfSpectra = 0, totalPeptideShakerIds = 0;

        int fileCounter = 1;
        PSParameter probabilities = new PSParameter();

        numberOfValidatedPsmsMap = new HashMap<String, Integer>();

        progressDialog.setPrimaryProgressCounterIndeterminate(false);
        progressDialog.setMaxPrimaryProgressCounter(identification.getSpectrumIdentificationSize());
        progressDialog.setValue(0);

        ArrayList<String> spectrumFiles = identification.getSpectrumFiles();
        for (String fileName : spectrumFiles) {

            int numberOfValidatedPsms = 0;
            totalNumberOfSpectra += spectrumFactory.getNSpectra(fileName);

            progressDialog.setTitle("Loading Spectrum Information. Please Wait... (" + fileCounter + "/" + spectrumFiles.size() + ")");
            identification.loadSpectrumMatchParameters(fileName, probabilities, progressDialog);
            progressDialog.setTitle("Loading Spectrum Matches. Please Wait... (" + fileCounter + "/" + spectrumFiles.size() + ")");
            identification.loadSpectrumMatches(fileName, progressDialog);
            progressDialog.setTitle("Loading Data. Please Wait... (" + fileCounter++ + "/" + spectrumFiles.size() + ") ");

            for (String spectrumKey : identification.getSpectrumIdentification(fileName)) {
                if (progressDialog.isRunCanceled()) {
                    break;
                }

                SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);

                if (spectrumMatch.getBestPeptideAssumption() != null) {
                    ArrayList<Integer> currentAdvocates = new ArrayList<Integer>();
                    probabilities = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, probabilities);

                    if (probabilities.getMatchValidationLevel().isValidated()) {

                        totalPeptideShakerIds++;
                        numberOfValidatedPsms++;

                        for (Integer tempAdvocate : advocatesUsed) {
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

                fileSelected = (String) fileNamesCmb.getSelectedItem();
                double maxMz = spectrumFactory.getMaxMz(fileSelected);
                try {
                    progressDialog.setTitle("Loading Spectrum Information for " + fileSelected + ". Please Wait..."); // @TODO: problem with progress bar??
                    identification.loadSpectrumMatchParameters(fileSelected, new PSParameter(), progressDialog);
                    identification.loadSpectrumMatches(fileSelected, progressDialog);
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                }
                progressDialog.setPrimaryProgressCounterIndeterminate(true);
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

                String key = getSelectedSpectrumKey();

                if (identification.matchExists(key)) {

                    SpectrumMatch spectrumMatch = identification.getSpectrumMatch(key);
                    PSParameter probabilities = new PSParameter();
                    probabilities = (PSParameter) identification.getSpectrumMatchParameter(key, probabilities);

                    // fill peptide shaker table
                    DisplayFeaturesGenerator displayFeaturesGenerator = peptideShakerGUI.getDisplayFeaturesGenerator();
                    String proteins = "";
                    String sequence;
                    if (spectrumMatch.getBestPeptideAssumption() != null) {
                        proteins = displayFeaturesGenerator.addDatabaseLinks(spectrumMatch.getBestPeptideAssumption().getPeptide().getParentProteins(peptideShakerGUI.getSequenceMatchingPreferences()));
                        sequence = displayFeaturesGenerator.getTaggedPeptideSequence(spectrumMatch, true, true, true);
                        peptideShakerJTablePeptideTooltip = displayFeaturesGenerator.getPeptideModificationTooltipAsHtml(spectrumMatch);
                    } else if (spectrumMatch.getBestTagAssumption() != null) {
                        sequence = spectrumMatch.getBestTagAssumption().getTag().getTaggedModifiedSequence(peptideShakerGUI.getSearchParameters().getModificationProfile(), true, true, true, false, false);
                        peptideShakerJTablePeptideTooltip = displayFeaturesGenerator.getTagModificationTooltipAsHtml(spectrumMatch.getBestTagAssumption().getTag());
                    } else {
                        throw new IllegalArgumentException("No best hit found for spectrum " + spectrumMatch.getKey());
                    }
                    ((DefaultTableModel) peptideShakerJTable.getModel()).addRow(new Object[]{
                        1,
                        isBestPsmEqualForAllIdSoftware(spectrumMatch, peptideShakerGUI.getSequenceMatchingPreferences()),
                        sequence,
                        proteins,
                        probabilities.getPsmConfidence(),
                        probabilities.getMatchValidationLevel().getIndex()
                    });

                    currentAssumptionsList = new ArrayList<SpectrumIdentificationAssumption>();

                    // add the search results
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

     * @param software the identification software as indexed in the Advocate
     * class
     */
    private void addIdResultsToTable(SpectrumIdentificationAssumption currentAssumption, PSParameter aProbabilities, Integer software) {

        PSParameter probabilities = (PSParameter) currentAssumption.getUrParam(aProbabilities);
        Double confidence = probabilities.getSearchEngineConfidence();
        int currentRowNumber = 0;
        boolean addRowAtBottom = true;

        // find the correct row to insert the match
        if (searchResultsTable.getRowCount() > 0) {
            for (int i = 0; i < searchResultsTable.getRowCount(); i++) {
                if (confidence > (Double) searchResultsTable.getValueAt(i, 5)) {
                    currentRowNumber = i;
                    addRowAtBottom = false;
                    break;
                }
            }
        }

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

        String sequence;
        if (currentAssumption instanceof PeptideAssumption) {
            SearchParameters searchParameters = peptideShakerGUI.getSearchParameters();
            ModificationProfile modificationProfile = searchParameters.getModificationProfile();
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

                            }
                        }
                        return null;
                    case 9:
                        if (identification.matchExists(spectrumKey)) {
                            PSParameter pSParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, new PSParameter());
                            if (pSParameter != null) {
                                return pSParameter.getPsmConfidence();
                            } else {
                                return null;
                            }
                        } else {
                            return null;
                        }
                    case 10:
                        if (identification.matchExists(spectrumKey)) {
                            PSParameter pSParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, new PSParameter());
                            if (pSParameter != null) {
                                return pSParameter.getMatchValidationLevel().getIndex();
                            } else {
                                return null;
                            }
                        } else {
                            return null;
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

                                try {
                                    progressDialog.setTitle("Importing GO (1/3). Please Wait...");
                                    geneFactory.initialize(geneMappingsFile, null);
                                    goFactory.initialize(goMappingsFile, progressDialog);

                                    PSParameter psParameter = new PSParameter();

                                    Identification identification = peptideShakerGUI.getIdentification();
                                    identification.loadProteinMatchParameters(psParameter, null);

                                    progressDialog.setTitle("Getting GO Mappings (2/3). Please Wait...");
                                    progressDialog.setPrimaryProgressCounterIndeterminate(false);
                                    progressDialog.setMaxPrimaryProgressCounter(identification.getProteinIdentification().size());
                                    progressDialog.setValue(0);
                                    int totalNumberOfGoMappedProteinsInProject = 0;

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

                                        psParameter = (PSParameter) peptideShakerGUI.getIdentification().getProteinMatchParameter(proteinKey, psParameter);

                                        if (psParameter.getMatchValidationLevel().isValidated() && !ProteinMatch.isDecoy(proteinKey) && !psParameter.isHidden()) {
                                            ArrayList<String> goTerms = goFactory.getProteinGoAccessions(proteinKey);
                                            if (!goTerms.isEmpty()) {
                                                totalNumberOfGoMappedProteinsInProject++;
                                                for (String goTerm : goTerms) {
                                                    Integer usage = datasetGoTermUsage.get(goTerm);
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

                                }
                            }
                        }

                        identification.loadProteinMatches(proteinKeys, null);
                        identification.loadProteinMatchParameters(proteinKeys, new PSParameter(), null);

                        // update the table
                        if (proteinTable.getModel() instanceof ProteinGoTableModel) {
                            ((ProteinGoTableModel) proteinTable.getModel()).updateDataModel(peptideShakerGUI, proteinKeys);
                        } else {
                            ProteinGoTableModel proteinTableModel = new ProteinGoTableModel(peptideShakerGUI, proteinKeys);
                            proteinTable.setModel(proteinTableModel);
                        }

                        setProteinGoTableProperties();
                        ((DefaultTableModel) proteinTable.getModel()).fireTableDataChanged();

                        if (proteinTable.getRowCount() > 0) {

                            // get the number of confident and doubtful matches
                            int nConfident = 0;
                            int nDoubtful = 0;
                            PSParameter psParameter = new PSParameter();

                            for (String proteinKey : proteinKeys) {
                                psParameter = (PSParameter) identification.getProteinMatchParameter(proteinKey, psParameter);
                                MatchValidationLevel level = psParameter.getMatchValidationLevel();

                                if (level == MatchValidationLevel.confident) {
                                    nConfident++;
                                } else if (level == MatchValidationLevel.doubtful) {
                                    nDoubtful++;
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

            spectrumChartJPanel.revalidate();
            spectrumChartJPanel.repaint();

            try {
                HashMap<Double, ArrayList<String>> scoreToPeptideMap = new HashMap<Double, ArrayList<String>>();
                PSParameter probabilities = new PSParameter();

                progressDialog.setPrimaryProgressCounterIndeterminate(false);
                progressDialog.setValue(0);
                progressDialog.setMaxPrimaryProgressCounter(peptideMap.get((String) ptmJTable.getValueAt(ptmJTable.getSelectedRow(), ptmJTable.getColumn("PTM").getModelIndex())).size());

                for (String peptideKey : peptideMap.get((String) ptmJTable.getValueAt(ptmJTable.getSelectedRow(), ptmJTable.getColumn("PTM").getModelIndex()))) {

                    progressDialog.increasePrimaryProgressCounter();

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

                    PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);

                    if (!peptideMatch.getTheoreticPeptide().isDecoy(peptideShakerGUI.getSequenceMatchingPreferences())) {

                        probabilities = (PSParameter) identification.getPeptideMatchParameter(peptideKey, probabilities);
                        double p = probabilities.getPeptideProbability();

                        if (!probabilities.isHidden()) {

                            if (!scoreToPeptideMap.containsKey(p)) {
                                scoreToPeptideMap.put(p, new ArrayList<String>());
                            }
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

    public void updateRelatedPeptidesTable(ProgressDialogX progressDialog) {

        HashMap<Double, ArrayList<String>> scoreToKeyMap = new HashMap<Double, ArrayList<String>>();
        String peptideKey = displayedPeptides.get((Integer) peptidesTable.getValueAt(peptidesTable.getSelectedRow(), 0) - 1);
        String currentSequence, referenceSequence = Peptide.getSequence(peptideKey);
        PSParameter probabilities = new PSParameter();

        progressDialog.setPrimaryProgressCounterIndeterminate(false);
        progressDialog.setValue(0);
        progressDialog.setMaxPrimaryProgressCounter(identification.getPeptideIdentification().size());

        for (String newKey : identification.getPeptideIdentification()) {

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

            progressDialog.increasePrimaryProgressCounter();

            currentSequence = Peptide.getSequence(newKey);

            if (currentSequence.contains(referenceSequence) || referenceSequence.contains(currentSequence)) {

                if (!newKey.equals(peptideKey)) {
                    try {
                        probabilities = (PSParameter) identification.getPeptideMatchParameter(newKey, probabilities);
                    } catch (Exception e) {
                        peptideShakerGUI.catchException(e);
                    }
                    double p = probabilities.getPeptideProbability();

                    if (!probabilities.isHidden()) {

                        if (!scoreToKeyMap.containsKey(p)) {
                            scoreToKeyMap.put(p, new ArrayList<String>());
                        }
View Full Code Here

Examples of eu.isas.peptideshaker.myparameters.PSParameter

        public Object getValueAt(int row, int column) {
            try {
                if (row >= displayedPeptides.size()) {
                    return "";
                }
                PSParameter probabilities;
                switch (column) {
                    case 0:
                        return row + 1;
                    case 1:
                        probabilities = new PSParameter();
                        probabilities = (PSParameter) identification.getPeptideMatchParameter(displayedPeptides.get(row), probabilities);
                        return probabilities.isStarred();
                    case 2:
                        probabilities = new PSParameter();
                        probabilities = (PSParameter) identification.getPeptideMatchParameter(displayedPeptides.get(row), probabilities);
                        return probabilities.getProteinInferenceClass();
                    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:
                        probabilities = new PSParameter();
                        probabilities = (PSParameter) identification.getPeptideMatchParameter(displayedPeptides.get(row), probabilities);
                        return probabilities.getPeptideConfidence();
                    case 6:
                        probabilities = new PSParameter();
                        probabilities = (PSParameter) identification.getPeptideMatchParameter(displayedPeptides.get(row), probabilities);
                        return probabilities.getMatchValidationLevel().getIndex();
                    default:
                        return "";
                }
            } catch (Exception e) {
                peptideShakerGUI.catchException(e);
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.