public class AminoAcidPattern extends ExperimentObject implements TagComponent
Modifier and Type | Class and Description |
---|---|
static class |
AminoAcidPattern.MatchingType
The different types of amino acid matching.
|
Constructor and Description |
---|
AminoAcidPattern()
Creates a blank pattern.
|
AminoAcidPattern(AminoAcidPattern aminoAcidPattern)
Creates a pattern from another pattern.
|
AminoAcidPattern(ArrayList<String> targetTesidues)
Convenience constructor giving a list of targeted residues as input.
|
AminoAcidPattern(String sequence)
Constructor taking a sequence of targeted amino acids as input.
|
Modifier and Type | Method and Description |
---|---|
void |
addModificationMatch(int localization,
ModificationMatch modificationMatch)
Adds a modification to one of the amino acid pattern.
|
void |
addModificationMatches(int localization,
ArrayList<ModificationMatch> modificationMatches)
Adds a list of modifications to one of the amino acid pattern.
|
void |
append(AminoAcidPattern otherPattern)
Appends another pattern at the end of this pattern.
|
String |
asSequence()
Returns the tag component as String like a peptide sequence.
|
String |
asSequence(int index)
Returns the component of the amino acid pattern at the given index.
|
void |
changeModificationSite(ModificationMatch modificationMatch,
int oldLocalization,
int newLocalization)
Changes the localization of a modification match.
|
void |
clearModificationMatches()
Clears the list of imported modification matches.
|
int |
firstIndex(AminoAcidPattern aminoAcidPattern,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(AminoAcidPattern aminoAcidPattern,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance,
int startIndex)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance,
int startIndex)
Returns the first index where the amino acid pattern is found.
|
HashMap<Integer,ArrayList<AminoAcid>> |
getAaExcluded()
Returns the map of excluded amino acids.
|
HashMap<Integer,ArrayList<AminoAcid>> |
getAaTargeted()
Returns the map of targeted amino acids.
|
ArrayList<String> |
getAllPossibleSequences()
Returns all possible sequences which can be obtained from the targeted
amino acids.
|
ArrayList<AminoAcid> |
getAminoAcidsAtTarget()
Returns the targeted amino acids at position "target".
|
Pattern |
getAsStringPattern()
Returns the amino acid pattern as case insensitive pattern for String
matching using default single letter code of amino acids.
|
Pattern |
getAsStringPattern(AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Returns the amino acid pattern as case insensitive pattern for String
matching.
|
ArrayList<AminoAcid> |
getExcludedAA(int index)
Returns the excluded amino acids at a given index in the pattern.
|
ArrayList<Integer> |
getIndexes(AminoAcidPattern input)
Returns the indexes where the amino acid pattern was found in the input
using default single letter code of amino acids.
|
ArrayList<Integer> |
getIndexes(AminoAcidPattern input,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Returns the indexes where the amino acid pattern was found in the input.
|
ArrayList<Integer> |
getIndexes(String input)
Returns the indexes where the amino acid pattern was found in the input
using default single letter code of amino acids.
|
ArrayList<Integer> |
getIndexes(String input,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Returns the indexes where the amino acid pattern was found in the input.
|
Double |
getMass()
Returns the mass of the tag component.
|
HashMap<Integer,ArrayList<ModificationMatch>> |
getModificationMatches()
Getter for the modifications carried by this sequence.
|
ArrayList<ModificationMatch> |
getModificationsAt(int localization)
Returns the modifications found at a given localization.
|
int |
getNExcludedAA(int index)
Returns the number of excluded amino acids at the given index.
|
int |
getNTargetedAA(int index)
Returns the number of targeted amino acids at the given index.
|
AminoAcidPattern |
getStandardSearchPattern()
Computes a pattern which can be searched by standard search engines,
i.e., a pattern targeting a single amino acid and not a complex pattern.
|
AminoAcidPattern |
getSubPattern(int startIndex,
boolean updateTarget)
Returns a sub pattern of the pattern.
|
AminoAcidPattern |
getSubPattern(int startIndex,
int endIndex,
boolean updateTarget)
Returns a sub pattern of the pattern.
|
static String |
getTaggedModifiedSequence(ModificationProfile modificationProfile,
AminoAcidPattern aminoAcidPattern,
HashMap<Integer,ArrayList<String>> mainModificationSites,
HashMap<Integer,ArrayList<String>> secondaryModificationSites,
HashMap<Integer,ArrayList<String>> fixedModificationSites,
boolean useHtmlColorCoding,
boolean useShortName)
Returns the modified sequence as an tagged string with potential
modification sites color coded or with PTM tags, e.g, <mox>.
|
String |
getTaggedModifiedSequence(ModificationProfile modificationProfile,
boolean useHtmlColorCoding,
boolean useShortName,
boolean excludeAllFixedPtms)
Returns the modified sequence as an tagged string with potential
modification sites color coded or with PTM tags, e.g, <mox>.
|
Integer |
getTarget()
Returns the index of the amino acid of interest in the pattern.
|
ArrayList<AminoAcid> |
getTargetedAA(int index)
Returns the targeted amino acids at a given index in the pattern.
|
static AminoAcidPattern |
getTrypsinExample()
Returns the trypsin example as amino acid pattern.
|
boolean |
isEnding(AminoAcidPattern aminoAcidPattern)
Indicates whether the given amino acid sequence ends with the pattern
using default single letter code of amino acids.
|
boolean |
isEnding(AminoAcidPattern aminoAcidPattern,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isEnding(String aminoAcidSequence)
Indicates whether the given amino acid sequence ends with the pattern
using default single letter code of amino acids.
|
boolean |
isEnding(String aminoAcidSequence,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isExcluded(char aa,
int index,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Indicates whether the given amino acid at the given index of the pattern
shall be excluded.
|
boolean |
isSameAs(AminoAcidPattern anotherPattern)
Indicates whether another AminoAcidPattern targets the same pattern.
|
boolean |
isSameAs(TagComponent anotherCompontent)
Indicates whether another component is the same as the component of
interest
|
boolean |
isStarting(AminoAcidPattern aminoAcidPattern)
Indicates whether the given amino acid sequence starts with the pattern
using default single letter code of amino acids.
|
boolean |
isStarting(AminoAcidPattern aminoAcidPattern,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Indicates whether the given amino acid sequence starts with the pattern.
|
boolean |
isStarting(String aminoAcidSequence)
Indicates whether the given amino acid sequence starts with the pattern
using default single letter code of amino acids.
|
boolean |
isStarting(String aminoAcidSequence,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Indicates whether the given amino acid sequence starts with the pattern.
|
boolean |
isTargeted(char aa,
int index,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Indicates whether the given amino acid at the given index of the pattern
is targeted.
|
int |
length()
Returns the length of the pattern in amino acids.
|
boolean |
matches(AminoAcidPattern aminoAcidPattern,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Indicates whether the pattern is found in the given amino acid sequence.
|
boolean |
matches(String aminoAcidSequence)
Indicates whether the pattern is found in the given amino acid sequence
using default single letter code of amino acids.
|
boolean |
matches(String aminoAcidSequence,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Indicates whether the pattern is found in the given amino acid sequence.
|
void |
merge(AminoAcidPattern otherPattern)
Simple merger for two patterns.
|
static AminoAcidPattern |
merge(AminoAcidPattern pattern1,
AminoAcidPattern pattern2)
Convenience method merging two different patterns (see public void
merge(AminoAcidPattern otherPattern) for detailed information of the
merging procedure).
|
void |
removeAA(int index)
Removes an amino acid index from the pattern.
|
void |
setExcluded(int index,
ArrayList<AminoAcid> exclusions)
Sets the amino acids excluded at a given index.
|
void |
setTarget(Integer target)
Sets the index of the amino acid of interest in the pattern.
|
void |
setTargeted(int index,
ArrayList<AminoAcid> targets)
Sets the amino acids targeted at a given index.
|
void |
swapRows(int fromRow,
int toRow)
Swap two rows in the pattern.
|
String |
toString() |
addUrParam, getParameterKey, getUrParam
public AminoAcidPattern()
public AminoAcidPattern(String sequence)
sequence
- a sequence of targeted amino acidspublic AminoAcidPattern(AminoAcidPattern aminoAcidPattern)
aminoAcidPattern
- the other patternpublic AminoAcidPattern(ArrayList<String> targetTesidues) throws IllegalArgumentException
targetTesidues
- a list of targeted residuesIllegalArgumentException
- exception thrown whenever a letter is
not recognized as amino acidpublic HashMap<Integer,ArrayList<AminoAcid>> getAaTargeted()
public HashMap<Integer,ArrayList<AminoAcid>> getAaExcluded()
public void swapRows(int fromRow, int toRow) throws IllegalArgumentException
fromRow
- toRow
- IllegalArgumentException
public Integer getTarget()
public void setTarget(Integer target)
target
- the index of the amino acid of interest in the pattern.public ArrayList<AminoAcid> getAminoAcidsAtTarget()
public void setTargeted(int index, ArrayList<AminoAcid> targets)
index
- the index in the patterntargets
- the amino acids targetedpublic ArrayList<AminoAcid> getTargetedAA(int index)
index
- the index in the patternpublic ArrayList<AminoAcid> getExcludedAA(int index)
index
- the index in the patternpublic int getNTargetedAA(int index)
index
- the index of interestpublic int getNExcludedAA(int index)
index
- the index of interestpublic void setExcluded(int index, ArrayList<AminoAcid> exclusions)
index
- the index in the patternexclusions
- the amino acids excludedpublic void removeAA(int index)
index
- the index of the amino acid to removepublic Pattern getAsStringPattern()
public Pattern getAsStringPattern(AminoAcidPattern.MatchingType matchingType, Double massTolerance)
matchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching type
'indistiguishibleAminoAcids'. Can be null otherwisepublic ArrayList<Integer> getIndexes(String input)
input
- the amino acid input sequence as stringpublic ArrayList<Integer> getIndexes(AminoAcidPattern input)
input
- the amino acid input sequence as AminoAcidPatternpublic ArrayList<Integer> getIndexes(String input, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
input
- the amino acid input sequence as stringmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic ArrayList<Integer> getIndexes(AminoAcidPattern input, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
input
- the amino acid input sequence as AminoAcidPatternmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean matches(String aminoAcidSequence)
aminoAcidSequence
- the amino acid sequencepublic int firstIndex(String aminoAcidSequence, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aminoAcidSequence
- the amino acid sequence to look intomatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic int firstIndex(AminoAcidPattern aminoAcidPattern, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aminoAcidPattern
- the amino acid sequence to look intomatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic int firstIndex(String aminoAcidSequence, AminoAcidPattern.MatchingType matchingType, Double massTolerance, int startIndex)
aminoAcidSequence
- the amino acid sequence to look intomatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typestartIndex
- the start index where to start looking forpublic int firstIndex(AminoAcidPattern aminoAcidPattern, AminoAcidPattern.MatchingType matchingType, Double massTolerance, int startIndex)
aminoAcidPattern
- the amino acid sequence to look intomatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typestartIndex
- the start index where to start looking forpublic boolean isTargeted(char aa, int index, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aa
- the amino acid as characterindex
- the index in the patternmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean isExcluded(char aa, int index, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aa
- the amino acid as characterindex
- the index in the patternmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean matches(String aminoAcidSequence, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aminoAcidSequence
- the amino acid sequencematchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean matches(AminoAcidPattern aminoAcidPattern, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aminoAcidPattern
- the amino acid sequencematchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean isStarting(String aminoAcidSequence)
aminoAcidSequence
- the amino acid sequencepublic boolean isStarting(AminoAcidPattern aminoAcidPattern)
aminoAcidPattern
- the amino acid sequencepublic boolean isStarting(String aminoAcidSequence, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aminoAcidSequence
- the amino acid sequencematchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean isStarting(AminoAcidPattern aminoAcidPattern, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aminoAcidPattern
- the amino acid sequencematchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean isEnding(String aminoAcidSequence)
aminoAcidSequence
- the amino acid sequencepublic boolean isEnding(AminoAcidPattern aminoAcidPattern)
aminoAcidPattern
- the amino acid sequencepublic boolean isEnding(AminoAcidPattern aminoAcidPattern, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aminoAcidPattern
- the amino acid sequencematchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean isEnding(String aminoAcidSequence, AminoAcidPattern.MatchingType matchingType, Double massTolerance)
aminoAcidSequence
- the amino acid sequencematchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean isSameAs(AminoAcidPattern anotherPattern)
anotherPattern
- the other AminoAcidPatternpublic int length()
public AminoAcidPattern getStandardSearchPattern()
public static AminoAcidPattern getTrypsinExample()
public void merge(AminoAcidPattern otherPattern)
otherPattern
- another pattern to be merged with thispublic void append(AminoAcidPattern otherPattern)
otherPattern
- the other pattern to append.public static AminoAcidPattern merge(AminoAcidPattern pattern1, AminoAcidPattern pattern2)
pattern1
- the first patternpattern2
- the second patternpublic String asSequence()
TagComponent
asSequence
in interface TagComponent
public String asSequence(int index)
index
- the index in the pattern. 0 is the first amino acidpublic HashMap<Integer,ArrayList<ModificationMatch>> getModificationMatches()
public ArrayList<ModificationMatch> getModificationsAt(int localization)
localization
- the localization as amino acid number. 1 is the first
amino acid.public void clearModificationMatches()
public void addModificationMatch(int localization, ModificationMatch modificationMatch)
localization
- the index of the amino acid retained as target of the
modification. 1 is the first amino acid.modificationMatch
- the modification matchpublic void addModificationMatches(int localization, ArrayList<ModificationMatch> modificationMatches)
localization
- the index of the amino acid retained as target of the
modification. 1 is the first amino acid.modificationMatches
- the modification matchespublic void changeModificationSite(ModificationMatch modificationMatch, int oldLocalization, int newLocalization)
modificationMatch
- the modification match of interestoldLocalization
- the old localizationnewLocalization
- the new localizationpublic String getTaggedModifiedSequence(ModificationProfile modificationProfile, boolean useHtmlColorCoding, boolean useShortName, boolean excludeAllFixedPtms)
modificationProfile
- the modification profile of the searchuseHtmlColorCoding
- if true, color coded HTML is used, otherwise
PTM tags, e.g, <mox>, are useduseShortName
- if true the short names are used in the tagsexcludeAllFixedPtms
- if true, all fixed PTMs are excludedpublic static String getTaggedModifiedSequence(ModificationProfile modificationProfile, AminoAcidPattern aminoAcidPattern, HashMap<Integer,ArrayList<String>> mainModificationSites, HashMap<Integer,ArrayList<String>> secondaryModificationSites, HashMap<Integer,ArrayList<String>> fixedModificationSites, boolean useHtmlColorCoding, boolean useShortName)
modificationProfile
- the modification profile of the searchaminoAcidPattern
- the amino acid pattern to annotatemainModificationSites
- the main variable modification sites in a
map: aa number -> list of modifications (1 is the first AA) (can be null)secondaryModificationSites
- the secondary variable modification
sites in a map: aa number -> list of modifications (1 is the first AA)
(can be null)fixedModificationSites
- the fixed modification sites in a map: aa
number -> list of modifications (1 is the first AA) (can be null)useHtmlColorCoding
- if true, color coded HTML is used, otherwise
PTM tags, e.g, <mox>, are useduseShortName
- if true the short names are used in the tagspublic ArrayList<String> getAllPossibleSequences()
public Double getMass()
TagComponent
getMass
in interface TagComponent
public AminoAcidPattern getSubPattern(int startIndex, int endIndex, boolean updateTarget)
startIndex
- the start index, inclusive (0 is the first amino acid)endIndex
- the end index, inclusiveupdateTarget
- boolean indicating whether the target of the pattern
shall be updated. If yes it will be shifted by startIndex, simply copied
otherwise.public AminoAcidPattern getSubPattern(int startIndex, boolean updateTarget)
startIndex
- the start index, inclusive (0 is the first amino acid)updateTarget
- boolean indicating whether the target of the pattern
shall be updated. If yes it will be shifted by startIndex, simply copied
otherwise.public boolean isSameAs(TagComponent anotherCompontent)
TagComponent
isSameAs
in interface TagComponent
anotherCompontent
- another componentCopyright © 2014. All Rights Reserved.