public class AminoAcidPattern extends ExperimentObject implements TagComponent
Constructor and Description |
---|
AminoAcidPattern()
Creates a blank pattern.
|
AminoAcidPattern(AminoAcidPattern aminoAcidPattern)
Creates a pattern from another pattern.
|
AminoAcidPattern(AminoAcidSequence aminoAcidSequence)
Creates an amino acid pattern based on the given amino acid sequence.
|
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.
|
StringBuilder |
asStringBuilder()
Returns the sequence represented by this amino acid pattern in a new
string builder.
|
void |
changeModificationSite(ModificationMatch modificationMatch,
int oldLocalization,
int newLocalization)
Changes the localization of a modification match.
|
void |
clearModificationMatches()
Clears the list of imported modification matches.
|
boolean |
contains(AminoAcidPattern aminoAcidPattern,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the pattern contains a subsequence of amino acids.
|
boolean |
contains(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the pattern contains a subsequence of amino acids.
|
int |
firstIndex(AminoAcidPattern aminoAcidPattern,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(AminoAcidPattern aminoAcidPattern,
SequenceMatchingPreferences sequenceMatchingPreferences,
int startIndex)
Returns the first index where the amino acid pattern is found in the
given pattern.
|
int |
firstIndex(AminoAcidSequence aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences,
int startIndex)
Returns the first index where the amino acid pattern is found.
|
HashMap<Integer,ArrayList<Character>> |
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<Character> |
getAminoAcidsAtTarget()
Returns the targeted amino acids at position "target".
|
Pattern |
getAsStringPattern(SequenceMatchingPreferences sequenceMatchingPreferences,
boolean includeMutations)
Returns the amino acid pattern as case insensitive pattern for String
matching.
|
ArrayList<Integer> |
getIndexes(AminoAcidPattern input,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the indexes where the amino acid pattern was found in the input.
|
ArrayList<Integer> |
getIndexes(String input,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the indexes where the amino acid pattern was found in the input.
|
Double |
getMass()
Returns the mass of the tag component.
|
ArrayList<Integer> |
getModificationIndexes()
Returns a list of the indexes of the amino acids carrying a modification.
|
HashMap<Integer,ArrayList<ModificationMatch>> |
getModificationMatches()
Getter for the modifications carried by this sequence in a map: aa number
> modification matches.
|
ArrayList<ModificationMatch> |
getModificationsAt(int localization)
Returns the modifications found at a given localization.
|
int |
getNTargetedAA(int index)
Returns the number of targeted amino acids at the given index.
|
String |
getPrositeFormat()
Returns the pattern in the PROSITE format.
|
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(PtmSettings 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(PtmSettings 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<Character> |
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,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isEnding(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isMutationTarget(Character aa,
int index,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the given amino acid at the given index of the pattern
is targeted when accounting for mutations.
|
boolean |
isSameAs(AminoAcidPattern anotherPattern,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether another AminoAcidPattern targets the same pattern.
|
boolean |
isSameAs(TagComponent anotherCompontent,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether another component is the same as the component of
interest.
|
boolean |
isSameSequenceAndModificationStatusAs(AminoAcidPattern anotherPattern,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether another AminoAcidPattern targets the same pattern
without accounting for PTM localization.
|
boolean |
isSameSequenceAndModificationStatusAs(TagComponent anotherCompontent,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether another component is the same as the component of
interest.
|
boolean |
isStarting(AminoAcidPattern aminoAcidPattern,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the given amino acid sequence starts with the pattern.
|
boolean |
isStarting(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the given amino acid sequence starts with the pattern.
|
boolean |
isTargeted(Character aa,
int index,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the given amino acid at the given index of the pattern
is targeted without accounting for mutations.
|
int |
length()
Returns the length of the pattern in amino acids.
|
boolean |
matches(AminoAcidPattern aminoAcidPattern,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the pattern is found in the given amino acid sequence.
|
boolean |
matches(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the pattern is matches the given amino acid sequence in
.
|
boolean |
matchesIn(AminoAcidPattern aminoAcidPattern,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the pattern is found in the given amino acid sequence.
|
boolean |
matchesIn(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
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).
|
int |
nMutations(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the number of mutations used to match an amino acid sequence.
|
void |
removeAA(int index)
Removes an amino acid index from the pattern.
|
void |
removeModificationMatch(int localisation,
ModificationMatch modificationMatch)
Removes a modification match in the given pattern.
|
AminoAcidPattern |
reverse()
Returns an amino acid pattern which is a reversed version of the current
pattern.
|
void |
setExcluded(int index,
ArrayList<Character> exceptions)
Excludes the given amino acids from the targeted amino acids at the given
index.
|
void |
setTarget(Integer target)
Sets the index of the amino acid of interest in the pattern.
|
void |
setTargeted(int index,
ArrayList<Character> 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(AminoAcidSequence aminoAcidSequence)
aminoAcidSequence
- the original amino acid sequencepublic 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<Character>> getAaTargeted()
public void swapRows(int fromRow, int toRow) throws IllegalArgumentException
fromRow
- from rowtoRow
- to rowIllegalArgumentException
- if an IllegalArgumentException occurspublic Integer getTarget()
public void setTarget(Integer target)
target
- the index of the amino acid of interest in the pattern.public ArrayList<Character> getAminoAcidsAtTarget()
public void setTargeted(int index, ArrayList<Character> targets)
index
- the index in the patterntargets
- the amino acids targetedpublic void setExcluded(int index, ArrayList<Character> exceptions)
index
- the index of the excluded amino acidexceptions
- the amino acids to excludepublic ArrayList<Character> getTargetedAA(int index)
index
- the index in the patternpublic int getNTargetedAA(int index)
index
- the index of interestpublic void removeAA(int index)
index
- the index of the amino acid to removepublic Pattern getAsStringPattern(SequenceMatchingPreferences sequenceMatchingPreferences, boolean includeMutations)
sequenceMatchingPreferences
- the sequence matching preferencesincludeMutations
- if true mutated amino acids will be includedpublic String getPrositeFormat()
public ArrayList<Integer> getIndexes(String input, SequenceMatchingPreferences sequenceMatchingPreferences)
input
- the amino acid input sequence as stringsequenceMatchingPreferences
- the sequence matching preferencespublic ArrayList<Integer> getIndexes(AminoAcidPattern input, SequenceMatchingPreferences sequenceMatchingPreferences)
input
- the amino acid input sequence as AminoAcidPatternsequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(AminoAcidSequence aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(AminoAcidPattern aminoAcidPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencespublic boolean contains(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequence to look forsequenceMatchingPreferences
- the sequence matching preferencespublic boolean contains(AminoAcidPattern aminoAcidPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequence to look forsequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences, int startIndex)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencesstartIndex
- the start index where to start looking forpublic int firstIndex(AminoAcidPattern aminoAcidPattern, SequenceMatchingPreferences sequenceMatchingPreferences, int startIndex)
aminoAcidPattern
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencesstartIndex
- the start index where to start looking forpublic boolean isTargeted(Character aa, int index, SequenceMatchingPreferences sequenceMatchingPreferences)
aa
- the amino acid as characterindex
- the index in the patternsequenceMatchingPreferences
- the sequence matching preferencespublic boolean isMutationTarget(Character aa, int index, SequenceMatchingPreferences sequenceMatchingPreferences)
aa
- the amino acid as characterindex
- the index in the patternsequenceMatchingPreferences
- the sequence matching preferencespublic boolean matchesIn(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matchesIn(AminoAcidPattern aminoAcidPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matches(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic int nMutations(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- another amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matches(AminoAcidPattern aminoAcidPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isStarting(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isStarting(AminoAcidPattern aminoAcidPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isEnding(AminoAcidPattern aminoAcidPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isEnding(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameAs(AminoAcidPattern anotherPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
anotherPattern
- the other AminoAcidPatternsequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameSequenceAndModificationStatusAs(AminoAcidPattern anotherPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
anotherPattern
- the other AminoAcidPatternsequenceMatchingPreferences
- the sequence matching preferencespublic 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 StringBuilder asStringBuilder()
public 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<Integer> getModificationIndexes()
public ArrayList<ModificationMatch> getModificationsAt(int localization)
localization
- the localization as amino acid number. 1 is the first
amino acid.public void removeModificationMatch(int localisation, ModificationMatch modificationMatch)
localisation
- the localization of the modificationmodificationMatch
- the modification match to removepublic 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(PtmSettings 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(PtmSettings 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 AminoAcidPattern reverse()
public boolean isSameAs(TagComponent anotherCompontent, SequenceMatchingPreferences sequenceMatchingPreferences)
TagComponent
isSameAs
in interface TagComponent
anotherCompontent
- another componentsequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameSequenceAndModificationStatusAs(TagComponent anotherCompontent, SequenceMatchingPreferences sequenceMatchingPreferences)
TagComponent
isSameSequenceAndModificationStatusAs
in interface TagComponent
anotherCompontent
- another componentsequenceMatchingPreferences
- the sequence matching preferencesCopyright © 2016. All rights reserved.