public class AminoAcidPattern extends ExperimentObject
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> targetResidues)
Convenience constructor giving a list of targeted residues 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 |
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.
|
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,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the pattern contains a subsequence of amino acids.
|
boolean |
contains(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the pattern contains a subsequence of amino acids.
|
int |
firstIndex(AminoAcidPattern aminoAcidPattern,
SequenceMatchingParameters sequenceMatchingPreferences)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(AminoAcidPattern aminoAcidPattern,
SequenceMatchingParameters sequenceMatchingPreferences,
int startIndex)
Returns the first index where the amino acid pattern is found in the
given pattern.
|
int |
firstIndex(AminoAcidSequence aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
SequenceMatchingParameters 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.
|
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 sequenceMatchingPreferences,
boolean includeMutations)
Returns the amino acid pattern as case insensitive pattern for String
matching.
|
ArrayList<Integer> |
getIndexes(AminoAcidPattern input,
SequenceMatchingParameters sequenceMatchingPreferences)
Returns the indexes where the amino acid pattern was found in the input.
|
ArrayList<Integer> |
getIndexes(String input,
SequenceMatchingParameters sequenceMatchingPreferences)
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.
|
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(ModificationParameters 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 Modification tags, e.g, <mox>.
|
String |
getTaggedModifiedSequence(ModificationParameters modificationProfile,
boolean useHtmlColorCoding,
boolean useShortName,
boolean excludeAllFixedPtms)
Returns the modified sequence as an tagged string with potential
modification sites color coded or with Modification tags, e.g, <mox>.
|
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 sequenceMatchingPreferences)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isEnding(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isSameAs(AminoAcidPattern anotherPattern,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether another AminoAcidPattern targets the same pattern.
|
boolean |
isSameSequenceAndModificationStatusAs(AminoAcidPattern anotherPattern,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether another AminoAcidPattern targets the same pattern
without accounting for Modification localization.
|
boolean |
isStarting(AminoAcidPattern aminoAcidPattern,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the given amino acid sequence starts with the pattern.
|
boolean |
isStarting(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the given amino acid sequence starts with the pattern.
|
boolean |
isTargeted(Character aa,
int index,
SequenceMatchingParameters 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,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the pattern is found in the given amino acid sequence.
|
boolean |
matches(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the pattern matches the given amino acid sequence.
|
boolean |
matchesAt(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences,
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 sequenceMatchingPreferences)
Indicates whether the pattern is found in the given amino acid sequence.
|
boolean |
matchesIn(String aminoAcidSequence,
SequenceMatchingParameters 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).
|
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, asLong, clearParametersMap, getUrParam, getUrParams, removeUrParam, setUrParams
getFirstLevel, getId, setFirstLevel, setId
jdoZooEvict, jdoZooGetBackup, jdoZooGetClassDef, jdoZooGetContext, jdoZooGetNode, jdoZooGetOid, jdoZooGetTimestamp, jdoZooHasState, jdoZooInit, jdoZooIsDeleted, jdoZooIsDetached, jdoZooIsDirty, jdoZooIsNew, jdoZooIsPersistent, jdoZooIsStateHollow, jdoZooIsTransactional, jdoZooMarkClean, jdoZooMarkDeleted, jdoZooMarkDetached, jdoZooMarkDirty, jdoZooMarkHollow, jdoZooMarkTransient, jdoZooSetOid, jdoZooSetTimestamp, zooActivateRead, zooActivateWrite, zooActivateWrite
public AminoAcidPattern()
public AminoAcidPattern(AminoAcidSequence aminoAcidSequence)
aminoAcidSequence
- the original amino acid sequencepublic AminoAcidPattern(AminoAcidPattern aminoAcidPattern)
aminoAcidPattern
- the other patternpublic AminoAcidPattern(ArrayList<String> targetResidues) throws IllegalArgumentException
targetResidues
- a list of targeted residuesIllegalArgumentException
- exception thrown whenever a letter is
not recognized as amino acidpublic 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 sequenceMatchingPreferences, boolean includeMutations)
sequenceMatchingPreferences
- the sequence matching preferencesincludeMutations
- if true mutated amino acids will be includedpublic String getPrositeFormat()
public ArrayList<Integer> getIndexes(String input, SequenceMatchingParameters sequenceMatchingPreferences)
input
- the amino acid input sequence as stringsequenceMatchingPreferences
- the sequence matching preferencespublic ArrayList<Integer> getIndexes(AminoAcidPattern input, SequenceMatchingParameters sequenceMatchingPreferences)
input
- the amino acid input sequence as AminoAcidPatternsequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(AminoAcidSequence aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencespublic boolean contains(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequence to look forsequenceMatchingPreferences
- the sequence matching preferencespublic boolean contains(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequence to look forsequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(String aminoAcidSequence, SequenceMatchingParameters 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, SequenceMatchingParameters 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, SequenceMatchingParameters sequenceMatchingPreferences)
aa
- the amino acid as characterindex
- the index in the patternsequenceMatchingPreferences
- the sequence matching preferencespublic boolean matchesIn(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matchesIn(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matchesAt(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences, int index)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencesindex
- the index at which the matching should be donepublic boolean matches(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matches(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isStarting(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isStarting(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isEnding(AminoAcidPattern aminoAcidPattern, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidPattern
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isEnding(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameAs(AminoAcidPattern anotherPattern, SequenceMatchingParameters sequenceMatchingPreferences)
anotherPattern
- the other AminoAcidPatternsequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameSequenceAndModificationStatusAs(AminoAcidPattern anotherPattern, SequenceMatchingParameters 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 String toString()
toString
in class org.zoodb.api.impl.ZooPC
public StringBuilder asStringBuilder()
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 addModificationSite(int localization, ArrayList<Character> ModificationSite)
localization
- the index of the amino acid residue siteModificationSite
- valid amino acids for this sitepublic void changeModificationSite(ModificationMatch modificationMatch, int oldLocalization, int newLocalization)
modificationMatch
- the modification match of interestoldLocalization
- the old localizationnewLocalization
- the new localizationpublic String getTaggedModifiedSequence(ModificationParameters modificationProfile, boolean useHtmlColorCoding, boolean useShortName, boolean excludeAllFixedPtms)
modificationProfile
- the modification profile of the searchuseHtmlColorCoding
- if true, color coded HTML is used, otherwise
Modification tags, e.g, <mox>, are useduseShortName
- if true the short names are used in the tagsexcludeAllFixedPtms
- if true, all fixed Modifications are excludedpublic static String getTaggedModifiedSequence(ModificationParameters 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
Modification tags, e.g, <mox>, are useduseShortName
- if true the short names are used in the tagspublic 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 © 2018. All rights reserved.