public class Protein extends ExperimentObject
Constructor and Description |
---|
Protein()
Constructor for a protein.
|
Protein(String accession,
boolean isDecoy)
Simplistic constructor for a protein (typically used when loading
identification files).
|
Protein(String accession,
Header.DatabaseType databaseType,
String sequence,
boolean isDecoy)
Constructor for a protein.
|
Protein(String accession,
String sequence,
boolean isDecoy)
Constructor for a protein.
|
Modifier and Type | Method and Description |
---|---|
double |
computeMolecularWeight()
Returns the protein's molecular weight.
|
String |
getAccession()
Getter for the protein accession.
|
Header.DatabaseType |
getDatabaseType()
Getter for the protein database type.
|
int |
getLength()
Returns the number of amino acids in the sequence.
|
int |
getNCleavageSites(ArrayList<Enzyme> enzymes)
Returns the number of cleavage sites.
|
int[] |
getObservableAminoAcids(ArrayList<Enzyme> enzymes,
double pepMaxLength)
Returns the observable amino acids in the sequence when using the given
enzymes with the given maximal peptide length.
|
int |
getObservableLength(ArrayList<Enzyme> enzymes,
double pepMaxLength)
Returns the number of observable amino acids in the sequence.
|
ArrayList<Integer> |
getPeptideStart(String peptideSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the list of indexes where a peptide can be found in the protein
sequence.
|
String |
getProteinKey()
Returns the key for protein indexing.
|
String |
getSequence()
Getter for the protein sequence.
|
HashMap<Integer,String[]> |
getSurroundingAA(String peptide,
int nAA,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the amino acids surrounding a peptide in the sequence of the
given protein in a map: peptide start index > (amino acids before,
amino acids after).
|
boolean |
isCTerm(String peptideSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns a boolean indicating whether the protein ends with the given
peptide.
|
boolean |
isDecoy()
Indicates if the protein is factice (from a decoy database for instance).
|
boolean |
isEnzymaticPeptide(String peptideSequence,
ArrayList<Enzyme> enzymes,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns true if the peptide is enzymatic, i.e., both termini can be
generated by one of the enzymes used.
|
boolean |
isEnzymaticPeptide(String peptideSequence,
Enzyme enzyme,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns true if the peptide is enzymatic, i.e., both termini can be
generated by the enzyme used.
|
boolean |
isNTerm(String peptideSequence,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns a boolean indicating whether the protein starts with the given
peptide.
|
boolean |
isSameAs(Protein anotherProtein)
A method to compare proteins.
|
addUrParam, clearParametersMap, getUrParam, removeUrParam
public Protein()
public Protein(String accession, boolean isDecoy)
accession
- The protein accessionisDecoy
- boolean indicating whether the protein is a decoypublic Protein(String accession, String sequence, boolean isDecoy)
accession
- The protein accessionsequence
- The protein sequenceisDecoy
- boolean indicating whether the protein is a decoypublic Protein(String accession, Header.DatabaseType databaseType, String sequence, boolean isDecoy)
accession
- The protein accessiondatabaseType
- The protein database the protein comes fromsequence
- The protein sequenceisDecoy
- boolean indicating whether the protein is a decoypublic boolean isDecoy()
public String getAccession()
public Header.DatabaseType getDatabaseType()
public String getSequence()
public boolean isSameAs(Protein anotherProtein)
anotherProtein
- an other proteinpublic String getProteinKey()
public int getLength()
public int[] getObservableAminoAcids(ArrayList<Enzyme> enzymes, double pepMaxLength)
enzymes
- the enzymes to usepepMaxLength
- the max peptide lengthpublic int getObservableLength(ArrayList<Enzyme> enzymes, double pepMaxLength)
enzymes
- the enzymes to usepepMaxLength
- the max peptide lengthpublic int getNCleavageSites(ArrayList<Enzyme> enzymes)
enzymes
- the enzymes to usepublic double computeMolecularWeight()
public ArrayList<Integer> getPeptideStart(String peptideSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
peptideSequence
- the sequence of the peptide of interestsequenceMatchingPreferences
- the sequence matching preferencespublic boolean isNTerm(String peptideSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
peptideSequence
- the peptide sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isCTerm(String peptideSequence, SequenceMatchingPreferences sequenceMatchingPreferences)
peptideSequence
- the peptide sequencesequenceMatchingPreferences
- the sequence matching preferencespublic boolean isEnzymaticPeptide(String peptideSequence, Enzyme enzyme, SequenceMatchingPreferences sequenceMatchingPreferences) throws IOException
peptideSequence
- the peptide sequence to checkenzyme
- the enzyme to usesequenceMatchingPreferences
- the sequence matching preferencesIOException
- if an IOException occurspublic boolean isEnzymaticPeptide(String peptideSequence, ArrayList<Enzyme> enzymes, SequenceMatchingPreferences sequenceMatchingPreferences) throws IOException
peptideSequence
- the peptide sequence to checkenzymes
- the enzymes to usesequenceMatchingPreferences
- the sequence matching preferencesIOException
- if an IOException occurspublic HashMap<Integer,String[]> getSurroundingAA(String peptide, int nAA, SequenceMatchingPreferences sequenceMatchingPreferences) throws IOException
peptide
- the sequence of the peptide of interestnAA
- the number of amino acids to includesequenceMatchingPreferences
- the sequence matching preferencesIOException
- Exception thrown whenever an error occurred while
parsing the protein sequenceCopyright © 2019. All rights reserved.