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 |
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.
|
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(PtmSettings 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(PtmSettings modificationProfile,
String sequence,
HashMap<Integer,ArrayList<String>> confidentModificationSites,
HashMap<Integer,ArrayList<String>> representativeAmbiguousModificationSites,
HashMap<Integer,ArrayList<String>> secondaryAmbiguousModificationSites,
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 String |
getTaggedResidue(char residue,
String ptmName,
PtmSettings modificationProfile,
int localizationConfidenceLevel,
boolean useHtmlColorCoding,
boolean useShortName)
Returns the single residue as a tagged string (HTML color or PTM tag).
|
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,
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 matches the given amino acid sequence in
size and according to the given matching preferences.
|
boolean |
matches(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the sequence matches the given amino acid sequence in
size and according to the given matching preferences.
|
boolean |
matchesIn(AminoAcidSequence aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the sequence is found in the given amino acid sequence.
|
boolean |
matchesIn(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Indicates whether the sequence is found in the given amino acid sequence.
|
int |
nMutations(String aminoAcidSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the number of mutations used when matching the given reference
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 matchesIn(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean matchesIn(AminoAcidSequence aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the amino acid sequencesequenceMatchingPreferences
- the sequence matching preferencespublic 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 nMutations(String aminoAcidSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
aminoAcidSequence
- the sequence to compare tosequenceMatchingPreferences
- 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 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 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(PtmSettings 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(PtmSettings modificationProfile, String sequence, HashMap<Integer,ArrayList<String>> confidentModificationSites, HashMap<Integer,ArrayList<String>> representativeAmbiguousModificationSites, HashMap<Integer,ArrayList<String>> secondaryAmbiguousModificationSites, HashMap<Integer,ArrayList<String>> fixedModificationSites, boolean useHtmlColorCoding, boolean useShortName)
modificationProfile
- the modification profile of the searchsequence
- the amino acid sequence to annotateconfidentModificationSites
- the confidently localized variable
modification sites in a map: aa number > list of modifications (1 is
the first AA) (can be null)representativeAmbiguousModificationSites
- the representative site
of the ambiguously localized variable modifications in a map: aa number
> list of modifications (1 is the first AA) (can be null)secondaryAmbiguousModificationSites
- the secondary sites of the
ambiguously localized variable modifications 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 static String getTaggedResidue(char residue, String ptmName, PtmSettings modificationProfile, int localizationConfidenceLevel, boolean useHtmlColorCoding, boolean useShortName)
residue
- the residue to tagptmName
- the name of the PTMmodificationProfile
- the modification profilelocalizationConfidenceLevel
- the localization confidence leveluseHtmlColorCoding
- 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 © 2016. All rights reserved.