public class AminoAcidPattern extends Object implements Serializable
Constructor and Description |
---|
AminoAcidPattern()
Creates an empty 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 |
---|---|
int |
firstIndex(String aminoAcidSequence,
int patternLength,
ProteinMatch.MatchingType matchingType,
Double massTolerance)
Returns the first index where the amino acid pattern is found.
|
int |
firstIndex(String aminoAcidSequence,
int patternLength,
ProteinMatch.MatchingType matchingType,
Double massTolerance,
int startIndex)
Returns the first index where the amino acid pattern is found.
|
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(ProteinMatch.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(String input,
int patternLength)
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,
int patternLength,
ProteinMatch.MatchingType matchingType,
Double massTolerance)
Returns the indexes where the amino acid pattern was found in the input.
|
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.
|
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(String aminoAcidSequence,
int patternLength)
Indicates whether the given amino acid sequence ends with the pattern
using default single letter code of amino acids.
|
boolean |
isEnding(String aminoAcidSequence,
int patternLength,
ProteinMatch.MatchingType matchingType,
Double massTolerance)
Indicates whether the given amino acid sequence ends with the pattern.
|
boolean |
isSameAs(AminoAcidPattern anotherPattern)
Indicates whether another AminoAcidPattern targets the same pattern.
|
boolean |
isStarting(String aminoAcidSequence,
int patternLength)
Indicates whether the given amino acid sequence starts with the pattern
using default single letter code of amino acids.
|
boolean |
isStarting(String aminoAcidSequence,
int patternLength,
ProteinMatch.MatchingType matchingType,
Double massTolerance)
Indicates whether the given amino acid sequence starts with the pattern.
|
int |
length()
Returns the length of the pattern in amino acids.
|
boolean |
matches(String aminoAcidSequence,
int patternLength)
Indicates whether the pattern is found in the given amino-acid sequence
using default single letter code of amino acids.
|
boolean |
matches(String aminoAcidSequence,
int patternLength,
ProteinMatch.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() |
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 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 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(ProteinMatch.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, int patternLength)
input
- the amino acid input sequence as stringpatternLength
- the pattern lengthpublic ArrayList<Integer> getIndexes(String input, int patternLength, ProteinMatch.MatchingType matchingType, Double massTolerance)
input
- the amino acid input sequence as stringmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepatternLength
- the pattern lengthpublic boolean matches(String aminoAcidSequence, int patternLength)
aminoAcidSequence
- the amino-acid sequencepatternLength
- the pattern lengthpublic int firstIndex(String aminoAcidSequence, int patternLength, ProteinMatch.MatchingType matchingType, Double massTolerance)
aminoAcidSequence
- the amino-acid sequence to look intopatternLength
- the pattern lengthmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic int firstIndex(String aminoAcidSequence, int patternLength, ProteinMatch.MatchingType matchingType, Double massTolerance, int startIndex)
aminoAcidSequence
- the amino-acid sequence to look intopatternLength
- the pattern lengthmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typestartIndex
- the start index where to start looking forpublic boolean matches(String aminoAcidSequence, int patternLength, ProteinMatch.MatchingType matchingType, Double massTolerance)
aminoAcidSequence
- the amino-acid sequencepatternLength
- the pattern lengthmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean isStarting(String aminoAcidSequence, int patternLength)
aminoAcidSequence
- the amino acid sequencepatternLength
- the pattern lengthpublic boolean isStarting(String aminoAcidSequence, int patternLength, ProteinMatch.MatchingType matchingType, Double massTolerance)
aminoAcidSequence
- the amino acid sequencepatternLength
- the pattern lengthmatchingType
- the type of sequence matchingmassTolerance
- the mass tolerance for matching typepublic boolean isEnding(String aminoAcidSequence, int patternLength)
aminoAcidSequence
- the amino acid sequencepatternLength
- the pattern lengthpublic boolean isEnding(String aminoAcidSequence, int patternLength, ProteinMatch.MatchingType matchingType, Double massTolerance)
aminoAcidSequence
- the amino acid sequencepatternLength
- the pattern lengthmatchingType
- 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 static AminoAcidPattern merge(AminoAcidPattern pattern1, AminoAcidPattern pattern2)
pattern1
- the first patternpattern2
- the second patternCopyright © 2013. All Rights Reserved.