com.compomics.util.experiment.biology
Class Protein

java.lang.Object
  extended by com.compomics.util.experiment.personalization.ExperimentObject
      extended by com.compomics.util.experiment.biology.Protein
All Implemented Interfaces:
Serializable, Cloneable

public class Protein
extends ExperimentObject

This class models a protein.

Author:
Marc Vaudel, Harald Barsnes
See Also:
Serialized Form

Constructor Summary
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.
 
Method Summary
 double computeMolecularWeight()
          Returns the proteins 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 getNPossiblePeptides(Enzyme enzyme)
          Returns the number of possible peptides (not accounting PTMs nor missed cleavages) with the selected enzyme.
 int getObservableLength(Enzyme enzyme, int pepMaxLength)
          Returns the number of observable amino acids of the sequence.
 ArrayList<Integer> getPeptideStart(String peptide)
          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)
          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) The number of amino acids is taken from the display preferences
 boolean isDecoy()
          Indicates if the protein is factice (from a decoy database for instance).
 boolean isSameAs(Protein anotherProtein)
          A method to compare proteins.
 
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, getParameterKey, getUrParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Protein

public Protein()
Constructor for a protein


Protein

public Protein(String accession,
               boolean isDecoy)
Simplistic constructor for a protein (typically used when loading identification files).

Parameters:
accession - The protein accession
isDecoy - boolean indicating whether the protein is a decoy

Protein

public Protein(String accession,
               String sequence,
               boolean isDecoy)
Constructor for a protein.

Parameters:
accession - The protein accession
sequence - The protein sequence
isDecoy - boolean indicating whether the protein is a decoy

Protein

public Protein(String accession,
               Header.DatabaseType databaseType,
               String sequence,
               boolean isDecoy)
Constructor for a protein.

Parameters:
accession - The protein accession
databaseType - The protein database the protein comes from
sequence - The protein sequence
isDecoy - boolean indicating whether the protein is a decoy
Method Detail

isDecoy

public boolean isDecoy()
Indicates if the protein is factice (from a decoy database for instance).

Returns:
a boolean indicating if the protein is factice

getAccession

public String getAccession()
Getter for the protein accession.

Returns:
the protein accession

getDatabaseType

public Header.DatabaseType getDatabaseType()
Getter for the protein database type.

Returns:
the protein database type

getSequence

public String getSequence()
Getter for the protein sequence.

Returns:
the protein sequence

isSameAs

public boolean isSameAs(Protein anotherProtein)
A method to compare proteins. For now accession based.

Parameters:
anotherProtein - an other protein
Returns:
a boolean indicating if the proteins are identical

getProteinKey

public String getProteinKey()
Returns the key for protein indexing. For now the protein accession.

Returns:
the key for protein indexing.

getLength

public int getLength()
Returns the number of amino acids in the sequence.

Returns:
the number of amino acids in the sequence

getObservableLength

public int getObservableLength(Enzyme enzyme,
                               int pepMaxLength)
Returns the number of observable amino acids of the sequence.

Parameters:
enzyme - the enzyme to use
pepMaxLength - the max peptide length
Returns:
the number of observable amino acids of the sequence

getNPossiblePeptides

public int getNPossiblePeptides(Enzyme enzyme)
Returns the number of possible peptides (not accounting PTMs nor missed cleavages) with the selected enzyme.

Parameters:
enzyme - The selected enzyme
Returns:
the number of possible peptides

computeMolecularWeight

public double computeMolecularWeight()
Returns the proteins molecular weight.

Returns:
the proteins molecular weight

getPeptideStart

public ArrayList<Integer> getPeptideStart(String peptide)
Returns the list of indexes where a peptide can be found in the protein sequence

Parameters:
peptide - the sequence of the peptide of interest
Returns:
the list of indexes where a peptide can be found in a protein sequence

getSurroundingAA

public HashMap<Integer,String[]> getSurroundingAA(String peptide,
                                                  int nAA)
                                           throws IOException
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) The number of amino acids is taken from the display preferences

Parameters:
peptide - the sequence of the peptide of interest
nAA - the number of amino acids to include
Returns:
the amino acids surrounding a peptide in the protein sequence
Throws:
IOException - Exception thrown whenever an error occurred while parsing the protein sequence


Copyright © 2012. All Rights Reserved.