public abstract class AminoAcidSequence extends Object implements SymbolSequence<AminoAcid>
| Constructor and Description |
|---|
AminoAcidSequence(AminoAcid[] residues)
Constructs an AminoAcidSequence by copying the residues.
|
AminoAcidSequence(AminoAcid firstResidue,
AminoAcid... residues)
Construct an AminoAcidSequence by copying the residues
|
AminoAcidSequence(AminoAcidSequence src,
int fromInclusive,
int toExclusive)
Constructor that copies the residues and modifications from src.
|
AminoAcidSequence(AminoAcidSequence src,
Set<AminoAcid> oldAAs,
AminoAcid newAA)
Constructor that copies the source AminoAcidSequence and replaces any amino acids in oldAAs
with newAA.
|
AminoAcidSequence(List<AminoAcid> residues,
com.google.common.collect.Multimap<Integer,Modification> sideChainModMap,
com.google.common.collect.Multimap<ModAttachment,Modification> termModMap)
Constructs an AminoAcidSequence from the list of residues with the modifications contained in
side chain and term mod map.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
calculateMonomerMassDefect() |
protected double |
calculateMonomerMassSum()
Sums the mass of all the monomers
|
int |
countAminoAcidsIn(Set<AminoAcid> aminoAcidSet)
Counts sums the number of times each of the amino acid in
aminoAcidSet is contained in this Peptide. |
boolean |
equals(Object o) |
Set<AminoAcid> |
getAmbiguousAminoAcids()
Returns a set containing all the amino acids that are ambiguous.
|
int |
getModificationCount()
Return the number of modifications that this peptide has.
|
int |
getModificationCount(ModAttachment attachment)
Returns the number of modifications that are attached to the given attachment
|
int[] |
getModificationIndexes(Set<ModAttachment> modAttachments)
Returns a sorted Array containing the indexes of the modified amino acids
|
ModificationList |
getModifications(Set<ModAttachment> attachments)
Returns a ModificationList containing all the modifications for the given attachments.
|
ModificationList |
getModificationsAt(int index,
Set<ModAttachment> attachments)
Returns a ModificationList containing all the modifications for the given index and attachments.
|
int |
getModifiedResidueCount()
Returns the number of residues that have a modification
|
AminoAcid |
getSymbol(int index)
Returns the symbol at the specified position in this symbol sequence.
|
int[] |
getSymbolIndexes(AminoAcid symbol)
Returns an array containing the indexes of where
symbol is found in this
sequence. |
boolean |
hasAmbiguousAminoAcids()
Returns true if this AminoAcidSequence has amino acids that are ambiguous such as X or B.
|
int |
hashCode() |
boolean |
hasModificationAt(int index)
Returns true if the residue at
index has a modification. |
boolean |
hasModificationAt(int index,
Set<ModAttachment> modAttachments)
Returns true if the residue at
index has a modification attached by modAttachment. |
boolean |
hasModificationAt(ModAttachment modAttachment)
Returns true if there are modifications attached via the given
modAttachment |
boolean |
hasModificationAt(Set<ModAttachment> modAttachments)
Returns true if there are modifications attached via any of the ModAttachments in
modAttachments |
boolean |
hasModifications()
Returns true if this AminoAcidSequence has modifications.
|
boolean |
hasSameSequence(AminoAcidSequence sequence)
Returns true if this and
sequence have the same AA sequence even if
the two sequences have different modifications. |
boolean |
hasSameSequence(SymbolSequence<AminoAcid> sequence)
Returns true if this and
sequence have the same AA sequence. |
boolean |
isEmpty()
Returns true if this AminoAcidSequence contains no residues.
|
int |
size()
Returns the number of residues in this amino acid sequence.
|
String |
toString() |
String |
toSymbolString()
Returns a string containing the amino acids and ignores the modifications.
|
public AminoAcidSequence(AminoAcid firstResidue, AminoAcid... residues)
firstResidue - the first residueresidues - the rest of the residuespublic AminoAcidSequence(AminoAcid[] residues)
residues - the residues, the array cannot be emptypublic AminoAcidSequence(AminoAcidSequence src, int fromInclusive, int toExclusive)
fromInclusive
and extends to the residue at index toExclusive - 1.
Thus the length of the new AminoAcidSequence is toExclusive-fromInclusive.src - the AminoAcidSequence from which to copy the sequence and modificationsfromInclusive - the beginning index, inclusive.toExclusive - the ending index, exclusive.public AminoAcidSequence(AminoAcidSequence src, Set<AminoAcid> oldAAs, AminoAcid newAA)
src - the AminoAcidSequence from which to copy the sequence and modificationsoldAAs - set containing the old amino acidsnewAA - the new amino acidpublic AminoAcidSequence(List<AminoAcid> residues, com.google.common.collect.Multimap<Integer,Modification> sideChainModMap, com.google.common.collect.Multimap<ModAttachment,Modification> termModMap)
residues - the residues, this list must have at least one amino acidsideChainModMap - the side chain modifications, this map can be emptytermModMap - the terminal modifications, this map can be emptypublic boolean hasModifications()
public boolean hasSameSequence(AminoAcidSequence sequence)
sequence have the same AA sequence even if
the two sequences have different modifications.sequence - the sequence to check againstsequence have the same AA sequencepublic boolean hasSameSequence(SymbolSequence<AminoAcid> sequence)
sequence have the same AA sequence.sequence - the sequence to check againstsequence have the same AA sequencepublic int getModificationCount()
public int getModificationCount(ModAttachment attachment)
attachment - where the modification is attachedpublic Set<AminoAcid> getAmbiguousAminoAcids()
public boolean hasAmbiguousAminoAcids()
public String toSymbolString()
toSymbolString in interface SymbolSequence<AminoAcid>public int getModifiedResidueCount()
public ModificationList getModifications(Set<ModAttachment> attachments)
For example given the peptide (n-term)_PE(m1)PS(m2, m3)IDE_(c-term1, c-term2):
getModifications(EnumSet.of(ModAttachment.N_TERM) will return {n-term}
getModifications(EnumSet.of(ModAttachment.C_TERM) will return {c-term1, c-term2}
getModifications(EnumSet.of(ModAttachment.SIDE_CHAIN) will return {m1, m2, m3}
getModifications(EnumSet.of(ModAttachment.all) will return {n-term, m1, m2, m3, c-term1, c-term2}
attachments - the ModAttachments to includepublic ModificationList getModificationsAt(int index, Set<ModAttachment> attachments)
For example given the peptide (n-term)_PE(m1)PS(m2, m3)IDE_(c-term1, c-term2):
getModifications(0, EnumSet.of(ModAttachment.N_TERM) will return {n-term}
getModifications(6, EnumSet.of(ModAttachment.N_TERM) will return {}
getModifications(6, EnumSet.of(ModAttachment.C_TERM) will return {c-term1, c-term2}
getModifications(3, EnumSet.of(ModAttachment.SIDE_CHAIN) will return {m2, m3}
attachments - the ModAttachments to includepublic boolean hasModificationAt(int index)
index has a modification.index - the indexindex has a modificationpublic boolean hasModificationAt(int index,
Set<ModAttachment> modAttachments)
index has a modification attached by modAttachment.index - the indexmodAttachments - set of mod attachments to checkindex has a modificationpublic boolean hasModificationAt(ModAttachment modAttachment)
modAttachmentmodAttachment - the mod attachments to checkmodAttachmentpublic boolean hasModificationAt(Set<ModAttachment> modAttachments)
modAttachmentsmodAttachments - the mod attachments to checkmodAttachmentpublic int size()
size in interface SymbolSequence<AminoAcid>public int[] getModificationIndexes(Set<ModAttachment> modAttachments)
public int[] getSymbolIndexes(AminoAcid symbol)
symbol is found in this
sequence.
For example:
the indexes of S in PSPSK is {1, 3}symbol - the symbol for which the indexes are to be returnedsymbol is found in this
sequencepublic AminoAcid getSymbol(int index)
SymbolSequencegetSymbol in interface SymbolSequence<AminoAcid>index - index of the symbol to returnprotected double calculateMonomerMassSum()
protected double calculateMonomerMassDefect()
public int countAminoAcidsIn(Set<AminoAcid> aminoAcidSet)
aminoAcidSet is contained in this Peptide.
For example PEPSIDE.countAminoAcidsIn((P, I)) returns 3aminoAcidSet - the amino acids to checkaminoAcidSet is contained in this Peptidepublic boolean isEmpty()
Copyright © 2016. All Rights Reserved.