Class Tag
java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.identification.amino_acid_tags.Tag
- All Implemented Interfaces:
Serializable
This class represents a sequence mass tag.
- Author:
- Marc Vaudel
- See Also:
-
Field Summary
Fields inherited from class com.compomics.util.experiment.personalization.ExperimentObject
NO_KEY -
Constructor Summary
ConstructorsConstructorDescriptionTag()Constructor for an empty tag.Tag(double nTermGap, AminoAcidSequence sequenceTag, double cTermGap) Constructor for a tag consisting of a sequence tag between two mass tags.Creates a new tag instance based on the given one. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAminoAcidSequence(AminoAcidSequence aminoAcidSequence) Adds a sequence of amino acids to the tag.voidaddMassGap(double massGap) Adds a mass gap to the tag.Returns the tag as intelligible sequence of tag components.booleanIndicates whether the tag can be reversed (ie if termini are mass gaps with mass ≥ water).Returns the content of this tag as a list.getCTerminal(boolean includeTerminalGaps, ModificationParameters modificationParameters, SequenceMatchingParameters modificationsSequenceMatchingParameters) Returns the C-terminal tag of this tag as a string for sequence display.doubleReturns the C-terminal gap of the tag.intReturns the amino acid length of the tag when mass gaps are considered like one amino acidReturns the longest amino acid sequence contained in this tag.doublegetMass()Returns the mass of the tag.doublegetMass(boolean includeCTermGap, boolean includeNTermGap) Returns the theoretic mass of the tag, eventually without terminal gaps.getNTerminal(boolean includeTerminalGaps, ModificationParameters modificationParameters, SequenceMatchingParameters modificationsSequenceMatchingParameters) Returns the N-terminal tag of this tag as a string for sequence display.doubleReturns the N-terminal gap of the tag.getPotentialModificationSites(Modification modification, SequenceMatchingParameters modificationSequenceMatchingPreferences) Returns the potential modification sites as an ordered list of string.getTaggedModifiedSequence(ModificationParameters modificationProfile, boolean useHtmlColorCoding, boolean includeHtmlStartEndTags, boolean useShortName, boolean includeTerminalGaps, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashSet<String> displayedModifications) Returns the modified sequence as an tagged string with potential modification sites color coded or with modification tags, e.g, <mox>.static StringgetTaggedModifiedSequence(ModificationParameters modificationParameters, Tag tag, boolean useHtmlColorCoding, boolean includeHtmlStartEndTags, boolean useShortName, boolean includeTerminalGaps, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashSet<String> displayedModifications) Returns the modified sequence as an tagged string with potential modification sites color coded or with modification tags, e.g, <mox>.static StringReturns the tag modifications as a string.booleanisSameAs(Tag anotherTag, SequenceMatchingParameters sequenceMatchingPreferences) Indicates whether this tag is the same as another tag.booleanisSameSequenceAndModificationStatusAs(Tag anotherTag, SequenceMatchingParameters sequenceMatchingPreferences) Indicates whether this tag is the same as another tag without accounting for modification localization.reverse(boolean yIon) Returns a new tag instance which is a reversed version of the current tag.voidsetContent(ArrayList<TagComponent> content) Sets the content for the given tag.toString()Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
Constructor Details
-
Tag
public Tag()Constructor for an empty tag. -
Tag
Creates a new tag instance based on the given one.- Parameters:
tag- the reference tag
-
Tag
Constructor for a tag consisting of a sequence tag between two mass tags.- Parameters:
nTermGap- the N-term mass gapsequenceTag- the sequence tag with modificationscTermGap- the C-term mass gap
-
-
Method Details
-
getContent
Returns the content of this tag as a list.- Returns:
- the content of this tag as a list
-
setContent
Sets the content for the given tag.- Parameters:
content- an array of tag components
-
addMassGap
public void addMassGap(double massGap) Adds a mass gap to the tag.- Parameters:
massGap- the value of the mass gap
-
addAminoAcidSequence
Adds a sequence of amino acids to the tag.- Parameters:
aminoAcidSequence- the amino acid sequence with modifications
-
asSequence
Returns the tag as intelligible sequence of tag components. For example amino acid tags and mass gaps: <115.2>TAG<110.5>.- Returns:
- The tag as intelligible sequence for display.
-
getLongestAminoAcidSequence
Returns the longest amino acid sequence contained in this tag.- Returns:
- the longest amino acid sequence contained in this tag
-
getMass
public double getMass()Returns the mass of the tag.- Returns:
- the mass of the tag
-
getMass
public double getMass(boolean includeCTermGap, boolean includeNTermGap) Returns the theoretic mass of the tag, eventually without terminal gaps.- Parameters:
includeCTermGap- if true the C-terminal gap will be added if presentincludeNTermGap- if true the N-terminal gap will be added if present- Returns:
- the theoretic mass of the tag
-
getNTerminalGap
public double getNTerminalGap()Returns the N-terminal gap of the tag.- Returns:
- the N-terminal gap of the tag
-
getCTerminalGap
public double getCTerminalGap()Returns the C-terminal gap of the tag.- Returns:
- the C-terminal gap of the tag
-
getTaggedModifiedSequence
public String getTaggedModifiedSequence(ModificationParameters modificationProfile, boolean useHtmlColorCoding, boolean includeHtmlStartEndTags, boolean useShortName, boolean includeTerminalGaps, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashSet<String> displayedModifications) Returns the modified sequence as an tagged string with potential modification sites color coded or with modification tags, e.g, <mox>. /!\ this method will work only if the modifications found in the tag components are in the factory. /!\ This method uses the modifications as set in the modification matches of this peptide and displays all of them.- Parameters:
modificationProfile- the modification profile of the searchuseHtmlColorCoding- if true, color coded HTML is used, otherwise modification tags, e.g, <mox>, are usedincludeHtmlStartEndTags- if true, start and end HTML tags are addeduseShortName- if true, the short names are used in the tagsincludeTerminalGaps- if true, the terminal gaps will be displayed on the sequencemodificationsSequenceMatchingParameters- the sequence matching parameters to use for modificationsdisplayedModifications- the modifications to display- Returns:
- the modified sequence as a tagged string
-
getTaggedModifiedSequence
public static String getTaggedModifiedSequence(ModificationParameters modificationParameters, Tag tag, boolean useHtmlColorCoding, boolean includeHtmlStartEndTags, boolean useShortName, boolean includeTerminalGaps, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashSet<String> displayedModifications) Returns the modified sequence as an tagged string with potential modification sites color coded or with modification tags, e.g, <mox>. /!\ This method will work only if the modification found in the peptide are in the factory. /!\ This method uses the modifications as set in the modification matches of this peptide and displays all of them.- Parameters:
modificationParameters- the modification profile of the searchtag- the taguseHtmlColorCoding- if true, color coded HTML is used, otherwise modification tags, e.g, <mox>, are usedincludeHtmlStartEndTags- if true, start and end HTML tags are addeduseShortName- if true, the short names are used in the tagsincludeTerminalGaps- if true, the terminal gaps will be displayed on the sequencemodificationsSequenceMatchingParameters- the sequence matching parameters to use for modificationsdisplayedModifications- the modifications to display- Returns:
- the tagged modified sequence as a string
-
getNTerminal
public String getNTerminal(boolean includeTerminalGaps, ModificationParameters modificationParameters, SequenceMatchingParameters modificationsSequenceMatchingParameters) Returns the N-terminal tag of this tag as a string for sequence display.- Parameters:
includeTerminalGaps- indicates whether mass gaps shall be includedmodificationParameters- the modification profile of the searchmodificationsSequenceMatchingParameters- the sequence matching parameters to use for modifications- Returns:
- the N-terminal tag of this tag
-
getCTerminal
public String getCTerminal(boolean includeTerminalGaps, ModificationParameters modificationParameters, SequenceMatchingParameters modificationsSequenceMatchingParameters) Returns the C-terminal tag of this tag as a string for sequence display.- Parameters:
includeTerminalGaps- indicates whether mass gaps shall be includedmodificationParameters- the modification profile of the searchmodificationsSequenceMatchingParameters- the sequence matching parameters to use for modifications- Returns:
- the C-terminal tag of this tag
-
getLengthInAminoAcid
public int getLengthInAminoAcid()Returns the amino acid length of the tag when mass gaps are considered like one amino acid- Returns:
- the amino acid length of the tag
-
getPotentialModificationSites
public ArrayList<Integer> getPotentialModificationSites(Modification modification, SequenceMatchingParameters modificationSequenceMatchingPreferences) Returns the potential modification sites as an ordered list of string. 1 is the first amino acid. An empty list is returned if no possibility was found. This method does not account for protein terminal modifications.- Parameters:
modification- the modification consideredmodificationSequenceMatchingPreferences- the sequence matching preferences for the modification to amino acid sequence mapping- Returns:
- a list of potential modification sites
-
isSameAs
Indicates whether this tag is the same as another tag. Note: this method accounts for modification localization.- Parameters:
anotherTag- another tagsequenceMatchingPreferences- the sequence matching preferences- Returns:
- a boolean indicating whether the tag is the same as another
-
isSameSequenceAndModificationStatusAs
public boolean isSameSequenceAndModificationStatusAs(Tag anotherTag, SequenceMatchingParameters sequenceMatchingPreferences) Indicates whether this tag is the same as another tag without accounting for modification localization.- Parameters:
anotherTag- another tagsequenceMatchingPreferences- the sequence matching preferences- Returns:
- a boolean indicating whether the tag is the same as another
-
getTagModificationsAsString
Returns the tag modifications as a string.- Parameters:
tag- the tag- Returns:
- the peptide modifications as a string
-
reverse
Returns a new tag instance which is a reversed version of the current tag.- Parameters:
yIon- indicates whether the tag is based on y ions- Returns:
- a new tag instance which is a reversed version of the current tag
-
canReverse
public boolean canReverse()Indicates whether the tag can be reversed (ie if termini are mass gaps with mass ≥ water).- Returns:
- whether the tag can be reversed
-
toString
-