public class AminoAcidSequence extends ExperimentObject implements TagComponent
NO_KEY
Constructor and Description |
---|
AminoAcidSequence()
Creates a blank sequence.
|
AminoAcidSequence(AminoAcidSequence sequence)
Creates a sequence from another sequence.
|
AminoAcidSequence(String sequence)
Constructor taking a sequence of amino acids as input.
|
AminoAcidSequence(String sequence,
ModificationMatch[] variableModifications)
Constructor taking a sequence of amino acids as input.
|
Modifier and Type | Method and Description |
---|---|
void |
addVariableModification(ModificationMatch modificationMatch)
Adds a modification to one of the amino acid sequence.
|
void |
appendCTerm(AminoAcidSequence otherSequence)
Appends another sequence at the end of this sequence.
|
void |
appendCTerm(String otherSequence)
Appends a series of unmodified amino acids to the sequence.
|
void |
appendNTerm(AminoAcidSequence otherSequence)
Appends another sequence at the beginning of this sequence keeping the
original order.
|
void |
appendNTerm(String otherSequence)
Appends a series of unmodified amino acids to the beginning sequence
keeping the original order.
|
String |
asSequence()
Returns the tag component as String like a peptide sequence.
|
char |
charAt(int aa)
Returns the amino acid at the given index on the sequence in its single
letter code.
|
void |
emptyInternalCaches()
the sequence is kept in different formats internally.
|
int |
firstIndex(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Returns the first index where the amino acid sequence is found in the
given sequence.
|
AminoAcid |
getAminoAcidAt(int aa)
Returns the amino acid at the given index on the sequence.
|
static ArrayList<StringBuilder> |
getCombinations(String sequence)
Returns a list of all combinations which can be created from a sequence
when expanding ambiguous amino acids like Xs.
|
String[] |
getFixedModifications(boolean nTerm,
boolean cTerm,
ModificationParameters modificationParameters,
SequenceMatchingParameters modificationsSequenceMatchingParameters)
Returns the fixed modifications for this sequence based on the given
modification parameters.
|
String[] |
getIndexedVariableModifications()
Returns the variable modifications indexed by site.
|
double |
getMass()
Returns the mass of the tag component.
|
static double |
getMinMass(char[] sequence)
Returns the minimal mass that an amino acid sequence can have taking into
account ambiguous amino acids.
|
String |
getSequence()
Returns the sequence as String.
|
ModificationMatch[] |
getVariableModifications()
Getter for the modifications carried by this sequence in a map: aa number
> modification matches.
|
static boolean |
hasCombination(char[] sequence)
Indicates whether the given sequence contains an amino acid which is in
fact a combination of amino acids.
|
static boolean |
hasCombination(java.util.stream.IntStream sequence)
Indicates whether the given sequence contains an amino acid which is in
fact a combination of amino acids.
|
static boolean |
hasCombination(String sequence)
Indicates whether the given sequence contains an amino acid which is in
fact a combination of amino acids.
|
void |
insert(int offset,
AminoAcidSequence otherSequence)
Inserts another sequence in this sequence.
|
void |
insert(int offset,
String otherSequence)
Inserts another sequence in this sequence.
|
boolean |
isSameAs(AminoAcidSequence anotherSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether another sequence has a matching sequence.
|
boolean |
isSameAs(TagComponent anotherCompontent,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether another component is the same as the component of
interest.
|
boolean |
isSameSequenceAndModificationStatusAs(AminoAcidSequence anotherSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether another sequence targets the same sequence without
accounting for PTM localization.
|
boolean |
isSameSequenceAndModificationStatusAs(TagComponent anotherCompontent,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether another component is the same as the component of
interest.
|
int |
length()
Returns the length of the sequence in amino acids.
|
boolean |
matches(AminoAcidSequence aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the sequence matches the given amino acid sequence in
size and according to the given matching preferences.
|
boolean |
matches(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the sequence matches the given amino acid sequence in
size and according to the given matching preferences.
|
boolean |
matchesIn(AminoAcidSequence aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the sequence is found in the given amino acid sequence.
|
boolean |
matchesIn(String aminoAcidSequence,
SequenceMatchingParameters sequenceMatchingPreferences)
Indicates whether the sequence is found in the given amino acid sequence.
|
AminoAcidSequence |
reverse()
Returns an amino acid sequence which is a reversed version of the current
pattern.
|
void |
setAaAtIndex(int index,
char aa)
replaces the amino acid at the given position by the given amino acid
represented by its single letter code.
|
void |
setSequence(String aminoAcidSequence)
Sets the sequence.
|
void |
setVariableModifications(ModificationMatch[] variableModifications)
Sets the variable modifications.
|
String |
toString() |
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
public AminoAcidSequence()
public AminoAcidSequence(String sequence)
sequence
- a sequence of amino acidspublic AminoAcidSequence(String sequence, ModificationMatch[] variableModifications)
sequence
- a sequence of amino acidsvariableModifications
- the variable modifications of this sequencepublic AminoAcidSequence(AminoAcidSequence sequence)
sequence
- the other sequencepublic String getSequence()
public char charAt(int aa)
aa
- the index on the sequencepublic AminoAcid getAminoAcidAt(int aa)
aa
- the index on the sequencepublic void setSequence(String aminoAcidSequence)
aminoAcidSequence
- the sequencepublic void setAaAtIndex(int index, char aa)
index
- the index where the amino acid should be set.aa
- the amino acid to be setpublic void emptyInternalCaches()
public boolean matchesIn(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matchesIn(AminoAcidSequence aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matches(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matches(AminoAcidSequence aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(String aminoAcidSequence, SequenceMatchingParameters sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencespublic int length()
public void appendCTerm(AminoAcidSequence otherSequence)
otherSequence
- the other sequence to append.public void appendCTerm(String otherSequence)
otherSequence
- a series of unmodified amino acids represented by
their single letter codepublic void insert(int offset, AminoAcidSequence otherSequence)
offset
- the index where this sequence should be inserted, 0 is the
first amino acid.otherSequence
- the other sequence to insert.public void insert(int offset, String otherSequence)
offset
- the index where this sequence should be inserted, 0 is the
first amino acid.otherSequence
- the other sequence to insert.public void appendNTerm(AminoAcidSequence otherSequence)
otherSequence
- the other sequence to append.public void appendNTerm(String otherSequence)
otherSequence
- a series of unmodified amino acids represented by
their single letter codepublic ModificationMatch[] getVariableModifications()
public String[] getIndexedVariableModifications()
public void addVariableModification(ModificationMatch modificationMatch)
modificationMatch
- the modification matchpublic void setVariableModifications(ModificationMatch[] variableModifications)
variableModifications
- the modificationspublic String[] getFixedModifications(boolean nTerm, boolean cTerm, ModificationParameters modificationParameters, SequenceMatchingParameters modificationsSequenceMatchingParameters)
nTerm
- boolean indicating whether the sequence is located at the
n-termcTerm
- boolean indicating whether the sequence is located at the
c-termmodificationParameters
- the modification parameters the
modification parametersmodificationsSequenceMatchingParameters
- the sequence matching
parameters to use for modificationspublic boolean isSameAs(AminoAcidSequence anotherSequence, SequenceMatchingParameters sequenceMatchingPreferences)
anotherSequence
- the other AminoAcidPatternsequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameSequenceAndModificationStatusAs(AminoAcidSequence anotherSequence, SequenceMatchingParameters sequenceMatchingPreferences)
anotherSequence
- the other sequencesequenceMatchingPreferences
- the sequence matching preferencespublic AminoAcidSequence reverse()
public static boolean hasCombination(String sequence)
sequence
- the sequence of interestpublic static boolean hasCombination(java.util.stream.IntStream sequence)
sequence
- the sequence of interestpublic static boolean hasCombination(char[] sequence)
sequence
- the sequence of interestpublic static double getMinMass(char[] sequence)
sequence
- a sequence of amino acids represented by their single
letter codepublic static ArrayList<StringBuilder> getCombinations(String sequence)
sequence
- the sequence of interestpublic String asSequence()
TagComponent
asSequence
in interface TagComponent
public double getMass()
TagComponent
getMass
in interface TagComponent
public boolean isSameAs(TagComponent anotherCompontent, SequenceMatchingParameters sequenceMatchingPreferences)
TagComponent
isSameAs
in interface TagComponent
anotherCompontent
- another componentsequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameSequenceAndModificationStatusAs(TagComponent anotherCompontent, SequenceMatchingParameters sequenceMatchingPreferences)
TagComponent
isSameSequenceAndModificationStatusAs
in interface TagComponent
anotherCompontent
- another componentsequenceMatchingPreferences
- the sequence matching preferencesCopyright © 2021. All rights reserved.