Package com.compomics.util.experiment.identification

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


                                    PeptideAssumption peptideAssumption = (PeptideAssumption) assumption;
                                    feature = getPeptideAssumptionFeature(identification, identificationFeaturesGenerator,
                                            searchParameters, annotationPreferences, sequenceMatchingPreferences, keys, linePrefix,
                                            peptideAssumption, spectrumKey, psParameter, identificationAlgorithmMatchesFeature, waitingHandler);
                                } else if (assumption instanceof TagAssumption) {
                                    TagAssumption tagAssumption = (TagAssumption) assumption;
                                    feature = getTagAssumptionFeature(identification, identificationFeaturesGenerator, searchParameters,
                                            annotationPreferences, keys, linePrefix, tagAssumption, spectrumKey, psParameter,
                                            identificationAlgorithmMatchesFeature, waitingHandler);
                                } else {
                                    throw new IllegalArgumentException("Spectrum identification assumption of type " + assumption.getClass() + " not supported.");
View Full Code Here


                        SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);
                        if (spectrumMatch.getBestPeptideAssumption() != null) {
                            String tooltip = displayFeaturesGenerator.getPeptideModificationTooltipAsHtml(spectrumMatch);
                            spectrumTable.setToolTipText(tooltip);
                        } else if (spectrumMatch.getBestTagAssumption() != null) {
                            TagAssumption tagAssumption = spectrumMatch.getBestTagAssumption();
                            spectrumTable.setToolTipText(peptideShakerGUI.getDisplayFeaturesGenerator().getTagModificationTooltipAsHtml(tagAssumption.getTag()));
                        } else {
                            throw new IllegalArgumentException("No best match found for spectrum " + spectrumMatch.getKey() + ".");
                        }
                    } catch (Exception e) {
                        peptideShakerGUI.catchException(e);
View Full Code Here

                                                + "Spectrum & Fragment Ions (" + modifiedSequence
                                                + "   " + currentPeptideAssumption.getIdentificationCharge().toString() + "   "
                                                + Util.roundDouble(currentSpectrum.getPrecursor().getMz(), 2) + " m/z)"
                                                + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
                                    } else if (currentAssumption instanceof TagAssumption) {
                                        TagAssumption tagAssumption = (TagAssumption) currentAssumption;

                                        // add the annotations
                                        annotationPreferences.setCurrentSettings(tagAssumption, !currentSpectrumKey.equalsIgnoreCase(spectrumMatch.getKey()),
                                                peptideShakerGUI.getSequenceMatchingPreferences());

                                        TagSpectrumAnnotator spectrumAnnotator = new TagSpectrumAnnotator();

                                        ArrayList<IonMatch> annotations = spectrumAnnotator.getSpectrumAnnotation(annotationPreferences.getIonTypes(),
                                                annotationPreferences.getNeutralLosses(),
                                                annotationPreferences.getValidatedCharges(),
                                                tagAssumption.getIdentificationCharge().value,
                                                currentSpectrum, tagAssumption.getTag(),
                                                currentSpectrum.getIntensityLimit(annotationPreferences.getAnnotationIntensityLimit()),
                                                annotationPreferences.getFragmentIonAccuracy(),
                                                false, annotationPreferences.isHighResolutionAnnotation());

                                        // add the spectrum annotations
                                        tempSpectrumPanel.setAnnotations(SpectrumAnnotator.getSpectrumAnnotation(annotations));
                                        tempSpectrumPanel.showAnnotatedPeaksOnly(!annotationPreferences.showAllPeaks());
                                        tempSpectrumPanel.setYAxisZoomExcludesBackgroundPeaks(annotationPreferences.yAxisZoomExcludesBackgroundPeaks());

                                        // add de novo sequencing
                                        tempSpectrumPanel.addAutomaticDeNovoSequencing(tagAssumption.getTag(), annotations,
                                                forwardIon, rewindIon, annotationPreferences.getDeNovoCharge(),
                                                annotationPreferences.showForwardIonDeNovoTags(),
                                                annotationPreferences.showRewindIonDeNovoTags());

                                        // 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;
                                                for (int site = 1; site <= aminoAcidSequence.length(); site++) {
                                                    for (ModificationMatch modificationMatch : aminoAcidSequence.getModificationsAt(site)) {
                                                        modificationMatches.add(modificationMatch);
                                                    }
                                                }
                                            } else if (tagComponent instanceof MassGap) {
                                                // Nothing to do here
                                            } else {
                                                throw new UnsupportedOperationException("Annotation not supported for the tag component " + tagComponent.getClass() + ".");
                                            }
                                        }

                                        peptideShakerGUI.updateAnnotationMenus(tagAssumption.getIdentificationCharge().value, modificationMatches);

                                        // update the spectrum title
                                        String modifiedSequence = tagAssumption.getTag().getTaggedModifiedSequence(peptideShakerGUI.getSearchParameters().getModificationProfile(), false, false, true, false);
                                        ((TitledBorder) spectrumPanel.getBorder()).setTitle(
                                                PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING
                                                + "Spectrum & Fragment Ions (" + modifiedSequence
                                                + "   " + tagAssumption.getIdentificationCharge().toString() + "   "
                                                + Util.roundDouble(currentSpectrum.getPrecursor().getMz(), 2) + " m/z)"
                                                + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
                                    }

                                    spectrumPanel.repaint();
View Full Code Here

                searchResultsTablePeptideTooltips.add(peptideShakerGUI.getDisplayFeaturesGenerator().getPeptideModificationTooltipAsHtml(peptide));
            } else {
                searchResultsTablePeptideTooltips.add(currentRowNumber, peptideShakerGUI.getDisplayFeaturesGenerator().getPeptideModificationTooltipAsHtml(peptide));
            }
        } else if (currentAssumption instanceof TagAssumption) {
            TagAssumption tagAssumption = (TagAssumption) currentAssumption;
            sequence = tagAssumption.getTag().getTaggedModifiedSequence(peptideShakerGUI.getSearchParameters().getModificationProfile(), true, true, true, false, false);
            if (addRowAtBottom) {
                searchResultsTablePeptideTooltips.add(peptideShakerGUI.getDisplayFeaturesGenerator().getTagModificationTooltipAsHtml(tagAssumption.getTag()));
            } else {
                searchResultsTablePeptideTooltips.add(currentRowNumber, peptideShakerGUI.getDisplayFeaturesGenerator().getTagModificationTooltipAsHtml(tagAssumption.getTag()));
            }
        } else {
            throw new UnsupportedOperationException("Sequence display not implemented for assumption " + currentAssumption.getClass() + ".");
        }
        if (addRowAtBottom) {
View Full Code Here

                            String feature;
                            if (peptideAssumption != null) {
                                peptideAssumption = spectrumMatch.getBestPeptideAssumption();
                                feature = PsIdentificationAlgorithmMatchesSection.getPeptideAssumptionFeature(identification, identificationFeaturesGenerator, searchParameters, annotationPreferences, sequenceMatchingPreferences, keys, linePrefix, peptideAssumption, spectrumMatch.getKey(), psParameter, identificationAlgorithmMatchesFeature, waitingHandler);
                            } else if (spectrumMatch.getBestTagAssumption() != null) {
                                TagAssumption tagAssumption = spectrumMatch.getBestTagAssumption();
                                feature = PsIdentificationAlgorithmMatchesSection.getTagAssumptionFeature(identification, identificationFeaturesGenerator, searchParameters, annotationPreferences, keys, linePrefix, tagAssumption, spectrumMatch.getKey(), psParameter, identificationAlgorithmMatchesFeature, waitingHandler);
                            } else {
                                throw new IllegalArgumentException("No best match found for spectrum " + spectrumMatch.getKey() + ".");
                            }
                            writer.write(feature);
View Full Code Here

                            break;
                        }
                    }
                    if (firstPeptideHit == null) {
                        // Try to find the best tag hit
                        TagAssumption firstTagHit = null;
                        for (Double eValue : eValues) {
                            for (SpectrumIdentificationAssumption assumption : spectrumMatch.getAllAssumptions(advocateId).get(eValue)) {
                                if (assumption instanceof TagAssumption) {
                                    TagAssumption tagAssumption = (TagAssumption) assumption;
                                    firstTagHit = tagAssumption;
                                    spectrumMatch.setFirstHit(advocateId, assumption);
                                    checkTagMassErrorsAndCharge(spectrumKey, tagAssumption);
                                    identification.addSpectrumMatch(spectrumMatch, false); //@TODO: adapt to the different scores
                                    nRetained++;
View Full Code Here

                            for (SpectrumIdentificationAssumption spectrumIdAssumption : assumptions.get(eValue)) {
                                if (spectrumIdAssumption instanceof PeptideAssumption) {
                                    PeptideAssumption peptideAssumption = (PeptideAssumption) spectrumIdAssumption;
                                    updatePeptideAssumptionValidationLevel(identificationFeaturesGenerator, searchParameters, annotationPreferences, inputMap, spectrumKey, peptideAssumption, peptideSpectrumAnnotator);
                                } else if (spectrumIdAssumption instanceof TagAssumption) {
                                    TagAssumption tagAssumption = (TagAssumption) spectrumIdAssumption;
                                    updateTagAssumptionValidationLevel(identificationFeaturesGenerator, searchParameters, annotationPreferences, inputMap, spectrumKey, tagAssumption);
                                }
                            }
                        }
                    }
View Full Code Here

TOP

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

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.