public class AminoAcidSequence extends ExperimentObject implements TagComponent
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,
HashMap<Integer,ArrayList<ModificationMatch>> modifications)
Constructor taking a sequence of 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 sequence.
|
void |
addModificationMatches(int localization,
ArrayList<ModificationMatch> modificationMatches)
Adds a list of modifications to one of the amino acid sequence.
|
void |
append(AminoAcidSequence otherSequence)
Appends another sequence at the end of this sequence.
|
void |
append(String otherSequence)
Appends a series of unmodified amino acids to the sequence.
|
String |
asSequence()
Returns the tag component as String like a peptide sequence.
|
void |
changeModificationSite(ModificationMatch modificationMatch,
int oldLocalization,
int newLocalization)
Changes the localization of a modification match.
|
char |
charAt(int aa)
Returns the amino acid at the given index on the sequence in its single
letter code.
|
void |
clearModificationMatches()
Clears the list of imported modification matches.
|
void |
emptyInternalCaches()
the sequence is kept in different formats internally.
|
int |
firstIndex(String aminoAcidSequence,
SequenceMatchingPreferences 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.
|
AminoAcidPattern |
getAsAminoAcidPattern()
Returns this amino acid sequence as amino acid pattern.
|
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.
|
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.
|
String |
getSequence()
Returns the sequence as String.
|
String |
getTaggedModifiedSequence(ModificationProfile 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>.
|
static String |
getTaggedModifiedSequence(ModificationProfile modificationProfile,
String sequence,
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>.
|
static boolean |
hasCombination(String sequence)
Indicates whether the given sequence contains an amino acid which is in
fact a combination of amino acids.
|
boolean |
isSameAs(AminoAcidSequence anotherSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether another sequence has a matching sequence.
|
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 sequence
without accounting for PTM localization.
|
boolean |
isSameSequenceAndModificationStatusAs(AminoAcidSequence anotherSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether another sequence targets the same sequence without
accounting for PTM localization.
|
boolean |
isSameSequenceAndModificationStatusAs(TagComponent anotherCompontent,
SequenceMatchingPreferences 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,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the sequence is found in the given amino acid sequence.
|
boolean |
matches(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the sequence is found in the given amino acid sequence.
|
void |
removeModificationMatch(int localisation,
ModificationMatch modificationMatch)
Removes a modification match in the given 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.
|
String |
toString() |
addUrParam, getParameterKey, getUrParam
public AminoAcidSequence()
public AminoAcidSequence(String sequence)
sequence
- a sequence of amino acidspublic AminoAcidSequence(String sequence, HashMap<Integer,ArrayList<ModificationMatch>> modifications)
sequence
- a sequence of amino acidsmodifications
- the modifications of this sequence in a mappublic 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 AminoAcidPattern getAsAminoAcidPattern()
public void emptyInternalCaches()
public boolean matches(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matches(AminoAcidSequence aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic int firstIndex(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequence to look intosequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameSequenceAndModificationStatusAs(AminoAcidPattern anotherPattern, SequenceMatchingPreferences sequenceMatchingPreferences)
anotherPattern
- the other AminoAcidPatternsequenceMatchingPreferences
- the sequence matching preferencespublic int length()
public void append(AminoAcidSequence otherSequence)
otherSequence
- the other sequence to append.public void append(String otherSequence)
otherSequence
- a series of unmodified amino acids represented by
their single letter codepublic 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(ModificationProfile 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(ModificationProfile modificationProfile, String sequence, 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 searchsequence
- the amino acid sequence 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 boolean isSameAs(AminoAcidSequence anotherSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
anotherSequence
- the other AminoAcidPatternsequenceMatchingPreferences
- the sequence matching preferencespublic boolean isSameSequenceAndModificationStatusAs(AminoAcidSequence anotherSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
anotherSequence
- the other sequencesequenceMatchingPreferences
- the sequence matching preferencespublic AminoAcidSequence reverse()
public static boolean hasCombination(String sequence)
sequence
- the sequence of interestpublic 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, 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 © 2014. All rights reserved.