Package com.compomics.util.experiment.biology

Examples of com.compomics.util.experiment.biology.AminoAcidPattern


                                        // get the modifications for the tag
                                        ArrayList<ModificationMatch> modificationMatches = new ArrayList<ModificationMatch>();

                                        for (TagComponent tagComponent : tagAssumption.getTag().getContent()) {
                                            if (tagComponent instanceof AminoAcidPattern) {
                                                AminoAcidPattern aminoAcidPattern = (AminoAcidPattern) tagComponent;
                                                for (int site = 1; site <= aminoAcidPattern.length(); site++) {
                                                    for (ModificationMatch modificationMatch : aminoAcidPattern.getModificationsAt(site)) {
                                                        modificationMatches.add(modificationMatch);
                                                    }
                                                }
                                            } else if (tagComponent instanceof AminoAcidSequence) {
                                                AminoAcidSequence aminoAcidSequence = (AminoAcidSequence) tagComponent;
View Full Code Here


                                                peptideShakerGUI.getSequenceMatchingPreferences());
                                    }

                                    if (includePeptide && selectedRows.length == 1) {

                                        AminoAcidPattern aminoAcidPattern = new AminoAcidPattern(peptideSequence);
                                        for (int startIndex : aminoAcidPattern.getIndexes(currentProteinSequence, peptideShakerGUI.getSequenceMatchingPreferences())) {
                                            int peptideTempStart = startIndex -1;
                                            int peptideTempEnd = peptideTempStart + peptideSequence.length();
                                            for (int k = peptideTempStart; k < peptideTempEnd; k++) {
                                                coverage[i][k]++;
                                            }
View Full Code Here

                    validationLevelCoverage = new boolean[sequence.length() + 1];
                    coverage.put(validationLevel, validationLevelCoverage);
                    levelAminoAcids = new ArrayList<Integer>();
                    aminoAcids.put(validationLevel, levelAminoAcids);
                }
                AminoAcidPattern aminoAcidPattern = new AminoAcidPattern(peptideSequence);
                for (int index : aminoAcidPattern.getIndexes(sequence, sequenceMatchingPreferences)) {
                    int peptideTempStart = index - 1;
                    int peptideTempEnd = peptideTempStart + peptideSequence.length();
                    for (int j = peptideTempStart; j < peptideTempEnd; j++) {
                        boolean found = validationLevelCoverage[j];
                        if (!found) {
View Full Code Here

        // iterate the peptide table and highlight the covered areas
        for (int i = 0; i < peptideTable.getRowCount() && !progressDialog.isRunCanceled(); i++) {

            String peptideKey = peptideTableMap.get(getPeptideIndex(i));
            String peptideSequence = Peptide.getSequence(peptideKey);
            AminoAcidPattern aminoAcidPattern = new AminoAcidPattern(peptideSequence);

            for (int peptideTempStart : aminoAcidPattern.getIndexes(proteinSequence, peptideShakerGUI.getSequenceMatchingPreferences())) {

                int peptideTempEnd = peptideTempStart + peptideSequence.length() - 1;

                jmolPanel.getViewer().evalString(
                        "select resno >=" + (peptideTempStart - chains[selectedChainIndex - 1].getDifference())
                        + " and resno <=" + (peptideTempEnd - chains[selectedChainIndex - 1].getDifference())
                        + " and chain = " + currentChain + "; color green");

                if (!aminoAcidPattern.getIndexes(chainSequence, peptideShakerGUI.getSequenceMatchingPreferences()).isEmpty()) {
                    peptideTable.setValueAt(true, i, peptideTable.getColumn("PDB").getModelIndex());
                    peptidePdbArray.add(peptideKey);
                }

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

        // highlight the selected peptide
        String peptideKey = peptideTableMap.get(getPeptideIndex(peptideTable.getSelectedRow()));
        String peptideSequence = Peptide.getSequence(peptideKey);
        AminoAcidPattern aminoAcidPattern = new AminoAcidPattern(peptideSequence);

        for (int peptideTempStart : aminoAcidPattern.getIndexes(proteinSequence, peptideShakerGUI.getSequenceMatchingPreferences())) {

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

            int peptideTempEnd = peptideTempStart + peptideSequence.length() - 1;

            jmolPanel.getViewer().evalString(
                    "select resno >=" + (peptideTempStart - chains[selectedChainIndex - 1].getDifference())
                    + " and resno <=" + (peptideTempEnd - chains[selectedChainIndex - 1].getDifference())
                    + " and chain = " + currentChain + "; color blue");
        }

        // remove old labels
        jmolPanel.getViewer().evalString("select all; label off");

        DisplayPreferences displayPreferences = peptideShakerGUI.getDisplayPreferences();

        // annotate the modified covered residues
        for (int i = 0; i < peptideTable.getRowCount() && !progressDialog.isRunCanceled(); i++) {

            peptideKey = peptideTableMap.get(getPeptideIndex(i));
            peptideSequence = Peptide.getSequence(peptideKey);
            aminoAcidPattern = new AminoAcidPattern(peptideSequence);

            ArrayList<ModificationMatch> modifications = new ArrayList<ModificationMatch>();
            try {
                modifications = peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey).getTheoreticPeptide().getModificationMatches();
            } catch (Exception e) {
                peptideShakerGUI.catchException(e);
            }

            for (int peptideTempStart : aminoAcidPattern.getIndexes(proteinSequence, peptideShakerGUI.getSequenceMatchingPreferences())) {
                if (progressDialog.isRunCanceled()) {
                    break;
                }

                int peptideTempEnd = peptideTempStart + peptideSequence.length() - 1;
View Full Code Here

                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())) {
                    selectedPeptideStart.add(startIndex - 1);
                }
                selectionLength = peptideSequence.length();
            }
View Full Code Here

        // rename the variable modifications
        for (TagComponent tagComponent : tag.getContent()) {
            if (tagComponent instanceof AminoAcidPattern) {

                AminoAcidPattern aminoAcidPattern = (AminoAcidPattern) tagComponent;

                for (int aa : aminoAcidPattern.getModificationIndexes()) {
                    for (ModificationMatch modificationMatch : aminoAcidPattern.getModificationsAt(aa)) {
                        if (modificationMatch.isVariable()) {
                            if (advocateId == Advocate.pepnovo.getIndex()) {
                                String pepnovoPtmName = modificationMatch.getTheoreticPtm();
                                PepnovoParameters pepnovoParameters = (PepnovoParameters) searchParameters.getIdentificationAlgorithmParameter(advocateId);
                                String utilitiesPtmName = pepnovoParameters.getUtilitiesPtmName(pepnovoPtmName);
                                if (utilitiesPtmName == null) {
                                    throw new IllegalArgumentException("PepNovo+ PTM " + pepnovoPtmName + " not recognized.");
                                }
                                modificationMatch.setTheoreticPtm(utilitiesPtmName);
                            } else if (advocateId == Advocate.direcTag.getIndex()) {
                                Integer directagIndex = new Integer(modificationMatch.getTheoreticPtm());
                                String utilitiesPtmName = searchParameters.getModificationProfile().getVariableModifications().get(directagIndex);
                                if (utilitiesPtmName == null) {
                                    throw new IllegalArgumentException("DirecTag PTM " + directagIndex + " not recognized.");
                                }
                                modificationMatch.setTheoreticPtm(utilitiesPtmName);
                                PTM ptm = ptmFactory.getPTM(utilitiesPtmName);
                                ArrayList<Character> aaAtTarget = ptm.getPattern().getAminoAcidsAtTarget();
                                if (aaAtTarget.size() > 1) {
                                    throw new IllegalArgumentException("More than one amino acid can be targeted by the modification " + ptm + ", tag duplication required.");
                                }
                                int aaIndex = aa - 1;
                                aminoAcidPattern.setTargeted(aaIndex, aaAtTarget);
                            } else {
                                Advocate notImplemented = Advocate.getAdvocate(advocateId);
                                if (notImplemented == null) {
                                    throw new IllegalArgumentException("Advocate of id " + advocateId + " not recognized.");
                                }
View Full Code Here

        // @TODO: merge with getTagModificationTooltipAsHtml in DeNovoGUI and move to utilities
        String tooltip = "<html>";

        for (TagComponent tagComponent : tag.getContent()) {
            if (tagComponent instanceof AminoAcidPattern) {
                AminoAcidPattern aminoAcidPattern = (AminoAcidPattern) tagComponent;
                for (int site = 1; site <= aminoAcidPattern.length(); site++) {
                    for (ModificationMatch modificationMatch : aminoAcidPattern.getModificationsAt(site)) {
                        String affectedResidue = aminoAcidPattern.asSequence(site - 1);
                        String modName = modificationMatch.getTheoreticPtm();
                        Color ptmColor = modificationProfile.getColor(modName);
                        if (modificationMatch.isConfident()) {
                            tooltip += "<span style=\"color:#" + Util.color2Hex(Color.WHITE) + ";background:#" + Util.color2Hex(ptmColor) + "\">"
                                    + affectedResidue
View Full Code Here

                enzymaticPeptide = currentProtein.isEnzymaticPeptide(peptideSequence, searchParameters.getEnzyme(),
                        sequenceMatchingPreferences);
            }
            if (allPeptides || (enzymatic && enzymaticPeptide) || (!enzymatic && !enzymatic)) {
                String modifiedSequence = getTaggedPeptideSequence(peptideMatch, true, false, true);
                AminoAcidPattern aminoAcidPattern = new AminoAcidPattern(peptideSequence);
                ArrayList<Integer> startIndexes = aminoAcidPattern.getIndexes(sequence, sequenceMatchingPreferences);
                for (int index : startIndexes) {
                    int peptideTempStart = index;
                    int peptideTempEnd = peptideTempStart + peptideSequence.length();
                    ResidueAnnotation newAnnotation = new ResidueAnnotation(peptideTempStart + " - " + modifiedSequence + " - " + peptideTempEnd, peptideKey, true);
                    for (int j = peptideTempStart - 1; j < peptideTempEnd - 1; j++) {
View Full Code Here

TOP

Related Classes of com.compomics.util.experiment.biology.AminoAcidPattern

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.