public class AminoAcidPattern extends ExperimentObject
NO_KEY
Constructor and Description |
---|
AminoAcidPattern()
Creates a blank pattern.
|
AminoAcidPattern(AminoAcidPattern aminoAcidPattern)
Creates a pattern from another pattern.
|
AminoAcidPattern(ArrayList<String> targetResidues)
Convenience constructor giving a list of targeted residues as input.
|
Modifier and Type | Method and Description |
---|---|
void |
addModificationSite(int localization,
ArrayList<Character> ModificationSite)
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(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.
|
boolean |
contains(AminoAcidPattern aminoAcidPattern,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the pattern contains a subsequence of amino acids.
|
boolean |
contains(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the pattern contains a subsequence of amino acids.
|
int |
firstIndex(AminoAcidPattern aminoAcidPattern,
SequenceMatchingParameters sequenceMatchingParameters)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(AminoAcidPattern aminoAcidPattern,
SequenceMatchingParameters sequenceMatchingParameters,
int startIndex)
Returns the first index where the amino acid pattern is found in the
given pattern.
|
int |
firstIndex(AminoAcidSequence aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters,
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.
|
static AminoAcidPattern |
getAminoAcidPatternFromString(String aminoAcidPatternAsString)
Parses the amino acid pattern from the given string as created by the
toString() method.
|
static AminoAcidPattern |
getAminoAcidPatternFromString(String aminoAcidPatternAsString,
int startIndex)
Parses the amino acid pattern from the given string as created by the
toString() method.
|
ArrayList<Character> |
getAminoAcidsAtTarget()
Returns the targeted amino acids at position "target".
|
HashSet<Character> |
getAminoAcidsAtTargetSet()
Returns a set containing the amino acids at target.
|
Pattern |
getAsStringPattern(SequenceMatchingParameters sequenceMatchingParameters,
boolean includeMutations)
Returns the amino acid pattern as case insensitive pattern for String
matching.
|
ArrayList<Integer> |
getIndexes(AminoAcidPattern input,
SequenceMatchingParameters sequenceMatchingParameters)
Returns the indexes where the amino acid pattern was found in the input.
|
int[] |
getIndexes(String input,
SequenceMatchingParameters sequenceMatchingParameters)
Returns the indexes where the amino acid pattern was found in the input.
|
int |
getMaxIndex()
Returns the maximal index where amino acids are found.
|
int |
getMinIndex()
Returns the minimal index where amino acids are found.
|
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.
|
int |
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,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isEnding(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isSameAs(AminoAcidPattern anotherPattern,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether another AminoAcidPattern targets the same pattern.
|
boolean |
isStarting(AminoAcidPattern aminoAcidPattern,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the given amino acid sequence starts with the pattern.
|
boolean |
isStarting(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the given amino acid sequence starts with the pattern.
|
boolean |
isTargeted(Character aa,
int index,
SequenceMatchingParameters sequenceMatchingParameters)
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,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the pattern matches the given amino acid sequence
|
boolean |
matches(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the pattern matches the given amino acid sequence.
|
boolean |
matchesAt(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters,
int index)
Indicates whether the pattern is found in the given amino acid sequence
at the given index, where 0 is the first amino acid.
|
boolean |
matchesIn(AminoAcidPattern aminoAcidPattern,
SequenceMatchingParameters sequenceMatchingParameters)
Indicates whether the pattern is found in the given amino acid sequence.
|
boolean |
matchesIn(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingParameters)
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.
|
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, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
public AminoAcidPattern()
public AminoAcidPattern(AminoAcidPattern aminoAcidPattern)
aminoAcidPattern
- the other patternpublic static AminoAcidPattern getAminoAcidPatternFromString(String aminoAcidPatternAsString)
aminoAcidPatternAsString
- the amino acid pattern as created by the
toString() methodpublic static AminoAcidPattern getAminoAcidPatternFromString(String aminoAcidPatternAsString, int startIndex)
aminoAcidPatternAsString
- the amino acid pattern as created by the
toString() methodstartIndex
- the start index of the patternpublic HashMap<Integer,ArrayList<Character>> getAaTargeted()
public void swapRows(int fromRow, int toRow)
fromRow
- from rowtoRow
- to rowpublic int getTarget()
public int getMinIndex()
public int getMaxIndex()
public void setTarget(Integer target)
target
- the index of the amino acid of interest in the pattern.public ArrayList<Character> getAminoAcidsAtTarget()
public HashSet<Character> getAminoAcidsAtTargetSet()
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(SequenceMatchingParameters sequenceMatchingParameters, boolean includeMutations)
sequenceMatchingParameters
- the sequence matching preferencesincludeMutations
- if true mutated amino acids will be includedpublic String getPrositeFormat()
public int[] getIndexes(String input, SequenceMatchingParameters sequenceMatchingParameters)
input
- the amino acid input sequence as stringsequenceMatchingParameters
- the sequence matching preferencespublic ArrayList<Integer> getIndexes(AminoAcidPattern input, SequenceMatchingParameters sequenceMatchingParameters)
input
- the amino acid input sequence as AminoAcidPatternsequenceMatchingParameters
- the sequence matching preferencespublic int firstIndex(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingParameters
- the sequence matching preferencespublic int firstIndex(AminoAcidSequence aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingParameters
- the sequence matching preferencespublic int firstIndex(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidPattern
- the amino acid sequence to look intosequenceMatchingParameters
- the sequence matching preferencespublic boolean contains(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidSequence
- the amino acid sequence to look forsequenceMatchingParameters
- the sequence matching preferencespublic boolean contains(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidPattern
- the amino acid sequence to look forsequenceMatchingParameters
- the sequence matching preferencespublic int firstIndex(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters, int startIndex)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingParameters
- the sequence matching preferencesstartIndex
- the start index where to start looking forpublic int firstIndex(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingParameters, int startIndex)
aminoAcidPattern
- the amino acid sequence to look intosequenceMatchingParameters
- the sequence matching preferencesstartIndex
- the start index where to start looking forpublic boolean isTargeted(Character aa, int index, SequenceMatchingParameters sequenceMatchingParameters)
aa
- the amino acid as characterindex
- the index in the patternsequenceMatchingParameters
- the sequence matching preferencespublic boolean matchesIn(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidSequence
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencespublic boolean matchesIn(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidPattern
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencespublic boolean matchesAt(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters, int index)
aminoAcidSequence
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencesindex
- the index at which the matching should be donepublic boolean matches(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidSequence
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencespublic boolean matches(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidPattern
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencespublic boolean isStarting(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidSequence
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencespublic boolean isStarting(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidPattern
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencespublic boolean isEnding(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidPattern
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencespublic boolean isEnding(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingParameters)
aminoAcidSequence
- the amino acid sequencesequenceMatchingParameters
- the sequence matching preferencespublic boolean isSameAs(AminoAcidPattern anotherPattern, SequenceMatchingParameters sequenceMatchingParameters)
anotherPattern
- the other AminoAcidPatternsequenceMatchingParameters
- 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(int index)
index
- the index in the pattern. 0 is the first amino acidpublic void addModificationSite(int localization, ArrayList<Character> ModificationSite)
localization
- the index of the amino acid residue siteModificationSite
- valid amino acids for this sitepublic ArrayList<String> getAllPossibleSequences()
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()
Copyright © 2021. All rights reserved.