Package eu.isas.peptideshaker.myparameters

Examples of eu.isas.peptideshaker.myparameters.PSParameter


        PeptideMatch peptideMatch = peptideShakerGUI.getIdentification().getPeptideMatch(peptideMatchKey);

        initComponents();

        PSParameter psParameter = new PSParameter();
        psParameter = (PSParameter) peptideShakerGUI.getIdentification().getPeptideMatchParameter(peptideMatchKey, psParameter);
        protInferenceTypeCmb.setSelectedIndex(psParameter.getProteinInferenceClass());

        protInferenceTypeCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));

        // make sure that the scroll panes are see-through
        proteinsJScrollPane.getViewport().setOpaque(false);
View Full Code Here


     * Update the peptide level protein inference type and close the dialog.
     *
     * @param evt
     */
    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
        PSParameter psParameter = new PSParameter();
        try {
            psParameter = (PSParameter) peptideShakerGUI.getIdentification().getPeptideMatchParameter(peptideMatchKey, psParameter);
            if (psParameter.getProteinInferenceClass() != protInferenceTypeCmb.getSelectedIndex()) {
                psParameter.setProteinInferenceClass(protInferenceTypeCmb.getSelectedIndex());
                peptideShakerGUI.getIdentification().updatePeptideMatchParameter(peptideMatchKey, psParameter);
                peptideShakerGUI.setDataSaved(false);
                peptideShakerGUI.setUpdated(PeptideShakerGUI.OVER_VIEW_TAB_INDEX, false);
                peptideShakerGUI.setUpdated(PeptideShakerGUI.MODIFICATIONS_TAB_INDEX, false);
                peptideShakerGUI.updateTabbedPanes();
View Full Code Here

        uniqueHitsJScrollPane.getViewport().setOpaque(false);
        relatedHitsJScrollPane.getViewport().setOpaque(false);

        groupClassJComboBox.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));

        PSParameter psParameter = new PSParameter();
        try {
            psParameter = (PSParameter) identification.getProteinMatchParameter(inspectedMatch, psParameter);
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
        }
        matchInfoLbl.setText("[Score: " + Util.roundDouble(psParameter.getProteinScore(), 2)
                + ", Confidence: " + Util.roundDouble(psParameter.getProteinConfidence(), 2) + "]");

        // set up the table column properties
        setColumnProperies();

        // update the panel border with the nubmer of rows in the table
        ((TitledBorder) proteinMatchJPanel.getBorder()).setTitle("Candidate Proteins (" + accessions.size() + ")");
        ((TitledBorder) uniqueHitsJPanel.getBorder()).setTitle("Unique Hits (" + uniqueMatches.size() + ")");
        ((TitledBorder) relatedHitsJPanel.getBorder()).setTitle("Related Hits (" + associatedMatches.size() + ")");

        // The index should be set in the design according to the PSParameter class static fields!
        groupClassJComboBox.setSelectedIndex(psParameter.getProteinInferenceClass());

        setLocationRelativeTo(peptideShakerGUI);
        setVisible(true);
    }
View Full Code Here

     *
     * @param evt
     */
    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed

        PSParameter psParameter = new PSParameter();

        try {
            psParameter = (PSParameter) identification.getProteinMatchParameter(inspectedMatch.getKey(), psParameter);
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
            this.dispose();
            return;
        }
        if (!inspectedMatch.getMainMatch().equals(previousMainMatch)
                || groupClassJComboBox.getSelectedIndex() != psParameter.getProteinInferenceClass()) {
            try {
                psParameter.setProteinInferenceClass(groupClassJComboBox.getSelectedIndex());
                identification.updateProteinMatchParameter(inspectedMatch.getKey(), psParameter);
                peptideShakerGUI.updateMainMatch(inspectedMatch.getMainMatch(), groupClassJComboBox.getSelectedIndex());
            } catch (Exception e) {
                peptideShakerGUI.catchException(e);
            }
View Full Code Here

        }

        @Override
        public Object getValueAt(int row, int column) {

            PSParameter pSParameter = new PSParameter();
            try {
                pSParameter = (PSParameter) identification.getProteinMatchParameter(uniqueMatches.get(row), pSParameter);
            } catch (Exception e) {
                peptideShakerGUI.catchException(e);
            }

            switch (column) {
                case 0:
                    return (row + 1);
                case 1:
                    return peptideShakerGUI.getDisplayFeaturesGenerator().addDatabaseLinks(new ArrayList<String>(Arrays.asList(ProteinMatch.getAccessions(uniqueMatches.get(row)))));
                case 2:
                    return pSParameter.getProteinScore();
                case 3:
                    return pSParameter.getProteinConfidence();
                case 4:
                    return pSParameter.getMatchValidationLevel().getIndex();
                default:
                    return "";
            }
        }
View Full Code Here

        }

        @Override
        public Object getValueAt(int row, int column) {

            PSParameter pSParameter = new PSParameter();
            try {
                pSParameter = (PSParameter) identification.getProteinMatchParameter(associatedMatches.get(row), pSParameter);
            } catch (Exception e) {
                peptideShakerGUI.catchException(e);
            }
            switch (column) {
                case 0:
                    return (row + 1);
                case 1:
                    return peptideShakerGUI.getDisplayFeaturesGenerator().addDatabaseLinks(new ArrayList<String>(Arrays.asList(ProteinMatch.getAccessions(associatedMatches.get(row)))));
                case 2:
                    return pSParameter.getProteinScore();
                case 3:
                    return pSParameter.getProteinConfidence();
                case 4:
                    return pSParameter.getMatchValidationLevel().getIndex();
                default:
                    return "";
            }
        }
View Full Code Here

                    peptideShakerGUI.catchException(e);
                }
                return description;
            } else if (column > 2 && column - 3 < fileNames.size()) {
                String fraction = fileNames.get(column - 3);
                PSParameter psParameter = new PSParameter();
                String proteinKey = proteinKeys.get(row);
                psParameter = (PSParameter) identification.getProteinMatchParameter(proteinKey, psParameter);
                if (psParameter.getFractions() != null && psParameter.getFractions().contains(fraction)) {
                    return psParameter.getFractionConfidence(fraction);
                } else {
                    return 0.0;
                }
            } else if (column == fileNames.size() + 3) {
                ProteinMatch proteinMatch = identification.getProteinMatch(proteinKeys.get(row));
                String mainMatch = proteinMatch.getMainMatch();
                Protein currentProtein = sequenceFactory.getProtein(mainMatch);
                if (currentProtein != null) {
                    return sequenceFactory.computeMolecularWeight(mainMatch);
                } else {
                    return null;
                }
            } else if (column == fileNames.size() + 4) {
                String proteinKey = proteinKeys.get(row);
                PSParameter pSParameter = new PSParameter();
                pSParameter = (PSParameter) identification.getProteinMatchParameter(proteinKey, pSParameter);
                return pSParameter.getProteinConfidence();
            } else if (column == fileNames.size() + 5) {
                String proteinKey = proteinKeys.get(row);
                PSParameter pSParameter = new PSParameter();
                pSParameter = (PSParameter) identification.getProteinMatchParameter(proteinKey, pSParameter);
                return pSParameter.getMatchValidationLevel().getIndex();
            } else {
                return "";
            }
        } catch (Exception e) {
            peptideShakerGUI.catchException(e);
View Full Code Here

            switch (column) {
                case 0:
                    return viewIndex + 1;
                case 1:
                    PSParameter psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, new PSParameter(), useDB && !isScrolling);
                    if (psParameter == null) {
                        if (isScrolling()) {
                            return null;
                        } else if (!useDB) {
                            dataMissingAtRow(row);
                            return DisplayPreferences.LOADING_MESSAGE;
                        }
                    }
                    return psParameter.isStarred();
                case 2:
                    psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, new PSParameter(), useDB && !isScrolling);
                    if (psParameter == null) {
                        if (isScrolling()) {
                            return null;
                        } else if (!useDB) {
                            dataMissingAtRow(row);
                            return DisplayPreferences.LOADING_MESSAGE;
                        }
                    }
                    return psParameter.getProteinInferenceClass();
                case 3:
                    PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey, useDB && !isScrolling);
                    if (peptideMatch == null) {
                        if (isScrolling()) {
                            return null;
                        } else if (!useDB) {
                            dataMissingAtRow(row);
                            return Peptide.getSequence(peptideKey);
                        }
                    }
                    return peptideShakerGUI.getDisplayFeaturesGenerator().getTaggedPeptideSequence(peptideMatch, true, true, true);
                case 4:
                    if (isScrolling) {
                        return null;
                    }
                    ArrayList<Integer> indexes;
                    if (sequenceFactory == null) {
                        return null;
                    }
                    try {
                        Protein currentProtein = sequenceFactory.getProtein(proteinAccession);
                        String peptideSequence = Peptide.getSequence(peptideKey);
                        indexes = currentProtein.getPeptideStart(peptideSequence,
                                peptideShakerGUI.getSequenceMatchingPreferences());
                    } catch (IOException e) {
                        peptideShakerGUI.catchException(e);
                        return "IO Exception";
                    }
                    Collections.sort(indexes);
                    return new StartIndexes(indexes); // note: have to be "packed" like this in order to be able to resetSorting on the first index if multiple indexes
                case 5:
                    if (isScrolling) {
                        return null;
                    }
                    peptideMatch = identification.getPeptideMatch(peptideKey, useDB);
                    if (!useDB
                            && (peptideMatch == null || !peptideShakerGUI.getIdentificationFeaturesGenerator().nValidatedSpectraForPeptideInCache(peptideKey))
                            && (peptideMatch == null || !identification.peptideDetailsInCache(peptideKey))) {
                        dataMissingAtRow(row);
                        return DisplayPreferences.LOADING_MESSAGE;
                    }

                    double nConfidentSpectra = peptideShakerGUI.getIdentificationFeaturesGenerator().getNConfidentSpectraForPeptide(peptideKey);
                    double nDoubtfulSpectra = peptideShakerGUI.getIdentificationFeaturesGenerator().getNValidatedSpectraForPeptide(peptideKey) - nConfidentSpectra;
                    int nSpectra = peptideMatch.getSpectrumMatches().size();

                    ArrayList<Double> doubleValues = new ArrayList<Double>();
                    doubleValues.add(nConfidentSpectra);
                    doubleValues.add(nDoubtfulSpectra);
                    doubleValues.add(nSpectra - nConfidentSpectra - nDoubtfulSpectra);
                    ArrrayListDataPoints arrrayListDataPoints = new ArrrayListDataPoints(doubleValues, JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType.sumOfNumbers);
                    return arrrayListDataPoints;
                case 6:
                    psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, new PSParameter(), useDB && !isScrolling);
                    if (psParameter == null) {
                        if (isScrolling) {
                            return null;
                        } else if (!useDB) {
                            dataMissingAtRow(row);
                            return DisplayPreferences.LOADING_MESSAGE;
                        }
                    }
                    if (psParameter != null) {
                        if (peptideShakerGUI.getDisplayPreferences().showScores()) {
                            return psParameter.getPeptideScore();
                        } else {
                            return psParameter.getPeptideConfidence();
                        }
                    } else {
                        return null;
                    }
                case 7:
                    psParameter = (PSParameter) identification.getPeptideMatchParameter(peptideKey, new PSParameter(), useDB && !isScrolling);
                    if (psParameter == null) {
                        if (isScrolling) {
                            return null;
                        } else if (!useDB) {
                            dataMissingAtRow(row);
                            return DisplayPreferences.LOADING_MESSAGE;
                        }
                    }
                    if (psParameter != null) {
                        return psParameter.getMatchValidationLevel().getIndex();
                    } else {
                        return null;
                    }
                default:
                    return null;
View Full Code Here

     * @throws IOException
     * @throws ClassNotFoundException
     */
    private void loadPeptideObjects(ArrayList<String> keys) throws SQLException, SQLException, IOException, ClassNotFoundException, InterruptedException {
        identification.loadPeptideMatches(keys, null);
        identification.loadPeptideMatchParameters(keys, new PSParameter(), null);
    }
View Full Code Here

        try {
            if (column == 1
                    || column == 2
                    || column == 6
                    || column == 7) {
                identification.loadPeptideMatchParameters(peptideKeys, new PSParameter(), null);
            } else if (column == 3
                    || column == 4
                    || column == 5) {
                identification.loadPeptideMatches(peptideKeys, null);
            }
View Full Code Here

TOP

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

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.