Examples of SelfUpdatingTableModel


Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

            ArrayList<Integer> selectedPeptideStart = new ArrayList<Integer>();
            int selectionLength = 0;

            if (peptideTable.getSelectedRow() != -1) {

                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
                int peptideIndex = tableModel.getViewIndex(peptideTable.getSelectedRow());
                String peptideKey = peptideKeys.get(peptideIndex);
                String peptideSequence = Peptide.getSequence(peptideKey);

                AminoAcidPattern aminoAcidPattern = new AminoAcidPattern(peptideSequence);
                for (int startIndex : aminoAcidPattern.getIndexes(currentProteinSequence, peptideShakerGUI.getSequenceMatchingPreferences())) {
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

     */
    private void updateProteinSequenceCoveragePanelTitle(String proteinAccession) throws IOException, IllegalArgumentException, InterruptedException, FileNotFoundException, ClassNotFoundException, SQLException {

        Protein currentProtein = sequenceFactory.getProtein(proteinAccession);
        currentProteinSequence = currentProtein.getSequence();
        SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();

        if (proteinTable.getSelectedRow() != -1) {

            String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));

            String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Protein Sequence Coverage (";
            try {
                HashMap<Integer, Double> sequenceCoverage;
                try {
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

    private void updatePtmCoveragePlot(String proteinAccession) {

        if (proteinTable.getSelectedRow() != -1) {

            try {
                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
                String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));

                // get the ptms
                ArrayList<JSparklinesDataSeries> sparkLineDataSeriesPtm = new ArrayList<JSparklinesDataSeries>();
                HashMap<Integer, ArrayList<ResidueAnnotation>> proteinTooltips = new HashMap<Integer, ArrayList<ResidueAnnotation>>();
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

        if (row != -1) {

            this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));

            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
            int psmIndex = tableModel.getViewIndex(row);
            String spectrumKey = psmKeys.get(psmIndex);

            if (displaySpectrum) {

                try {
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

            this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));

            try {
                Identification identification = peptideShakerGUI.getIdentification();
                IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();
                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
                int peptideIndex = tableModel.getViewIndex(row);
                String peptideKey = peptideKeys.get(peptideIndex);
                try {
                    psmKeys = identificationFeaturesGenerator.getSortedPsmKeys(peptideKey);
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                    try {
                        // ok let's try without order
                        PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
                        psmKeys = peptideMatch.getSpectrumMatches();
                    } catch (Exception e1) {
                        // just hope the GUI holds...
                        peptideShakerGUI.catchException(e1);
                        psmKeys = new ArrayList<String>();
                    }
                }

                // clear the selection in case more than one row was selected for the last peptide
                psmTable.clearSelection();

                // update the table model
                if (psmTable.getModel() instanceof PsmTableModel) {
                    ((PsmTableModel) psmTable.getModel()).updateDataModel(peptideShakerGUI, psmKeys);
                    ((PsmTableModel) psmTable.getModel()).setSelfUpdating(true);
                    ((PsmTableModel) psmTable.getModel()).resetSorting(new ProgressDialogX(peptideShakerGUI,
                            Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")),
                            Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")),
                            true));
                } else {
                    PsmTableModel psmTableModel = new PsmTableModel(peptideShakerGUI, psmKeys);
                    psmTable.setModel(psmTableModel);
                }

                setPsmTableProperties();
                showSparkLines(peptideShakerGUI.showSparklines());

                int nValidatedPsms = identificationFeaturesGenerator.getNValidatedSpectraForPeptide(peptideKey);
                int nConfidentPsms = identificationFeaturesGenerator.getNConfidentSpectraForPeptide(peptideKey);
                int nPsms = psmTable.getRowCount();
                String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Peptide-Spectrum Matches (";
                if (nConfidentPsms > 0) {
                    title += nValidatedPsms + "/" + nPsms + " - " + nConfidentPsms + " confident, " + (nValidatedPsms - nConfidentPsms) + " doubtful";
                } else {
                    title += nValidatedPsms + "/" + nPsms;
                }
                title += ")" + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING;
                ((TitledBorder) psmsPanel.getBorder()).setTitle(title);
                psmsPanel.repaint();

                updateSelection(true);
                newItemSelection();

                // update the sequence coverage map
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        try {
                            int proteinIndex, selectedProteinRow = proteinTable.getSelectedRow();
                            if (selectedProteinRow != -1) {
                                SelfUpdatingTableModel proteinTableModel = (SelfUpdatingTableModel) proteinTable.getModel();
                                proteinIndex = proteinTableModel.getViewIndex(selectedProteinRow);
                            } else {
                                // Let's assume it is the first
                                proteinIndex = 0;
                            }
                            String proteinKey = proteinKeys.get(proteinIndex);
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

        AnnotationPreferences annotationPreferences = peptideShakerGUI.getAnnotationPreferences();

        try {
            for (int row : selectedRows) {

                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
                int psmIndex = tableModel.getViewIndex(row);
                String spectrumKey = psmKeys.get(psmIndex);
                MSnSpectrum currentSpectrum = peptideShakerGUI.getSpectrum(spectrumKey);

                if (currentSpectrum != null && peptideTable.getSelectedRow() != -1) {
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

        ArrayList<MSnSpectrum> allSpectra = new ArrayList<MSnSpectrum>();

        int[] selectedRows = psmTable.getSelectedRows();
        MSnSpectrum tempSpectrum;

        SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
        for (int row : selectedRows) {
            int psmIndex = tableModel.getViewIndex(row);
            String spectrumKey = psmKeys.get(psmIndex);
            tempSpectrum = peptideShakerGUI.getSpectrum(spectrumKey);
            if (tempSpectrum != null) {
                allSpectra.add(tempSpectrum);
            }
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

        if (selectedRows.length > 0) {

            StringBuilder spectraAsMgf = new StringBuilder();

            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
            for (int row : selectedRows) {
                int psmIndex = tableModel.getViewIndex(row);
                String spectrumKey = psmKeys.get(psmIndex);
                MSnSpectrum currentSpectrum = peptideShakerGUI.getSpectrum(spectrumKey);
                spectraAsMgf.append(currentSpectrum.asMgf());
            }
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

            // update the peptide table
            ((DefaultTableModel) psmTable.getModel()).fireTableDataChanged();

            // update the sequence coverage map
            if (proteinTable.getSelectedRow() != -1) {
                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
                String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));
                ProteinMatch proteinMatch = peptideShakerGUI.getIdentification().getProteinMatch(proteinKey);
                updateSequenceCoverage(proteinKey, proteinMatch.getMainMatch(), true);
            }

            // reset the row selections
View Full Code Here

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

    private void updateSpectrumPanelBorderTitle(MSnSpectrum currentSpectrum) throws IOException {
        if (peptideTable.getSelectedRow() != -1
                && proteinTable.getSelectedRow() != -1
                && psmTable.getSelectedRow() != -1) {
            try {
                SelfUpdatingTableModel peptideTableModel = (SelfUpdatingTableModel) peptideTable.getModel();
                int peptideIndex = peptideTableModel.getViewIndex(peptideTable.getSelectedRow());
                String peptideKey = peptideKeys.get(peptideIndex);
                SelfUpdatingTableModel proteinTableModel = (SelfUpdatingTableModel) proteinTable.getModel();
                String proteinKey = proteinKeys.get(proteinTableModel.getViewIndex(proteinTable.getSelectedRow()));
                ProteinMatch proteinMatch = peptideShakerGUI.getIdentification().getProteinMatch(proteinKey);
                Protein currentProtein = sequenceFactory.getProtein(proteinMatch.getMainMatch());
                HashMap<Integer, String[]> aaSurrounding = currentProtein.getSurroundingAA(Peptide.getSequence(peptideKey),
                        peptideShakerGUI.getDisplayPreferences().getnAASurroundingPeptides(), peptideShakerGUI.getSequenceMatchingPreferences());

                String before = "";
                String after = "";

                if (aaSurrounding.size() == 1) {
                    for (int index : aaSurrounding.keySet()) {
                        before = aaSurrounding.get(index)[0];
                        after = aaSurrounding.get(index)[1];
                    }
                } else {
                    boolean first = true;
                    ArrayList<Integer> indexes = new ArrayList<Integer>(aaSurrounding.keySet());
                    Collections.sort(indexes);
                    for (int index : indexes) {
                        if (first) {
                            first = false;
                        } else {
                            before += "|";
                            after += "|";
                        }
                        before += aaSurrounding.get(index)[0];
                        after += aaSurrounding.get(index)[1];
                    }
                }

                SelfUpdatingTableModel psmTableModel = (SelfUpdatingTableModel) psmTable.getModel();
                int psmIndex = psmTableModel.getViewIndex(psmTable.getSelectedRow());
                String spectrumKey = psmKeys.get(psmIndex);

                try {
                    SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(spectrumKey);
                    PeptideAssumption peptideAssumption = spectrumMatch.getBestPeptideAssumption();
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.