com.compomics.util.protein
Class Enzyme

java.lang.Object
  extended by com.compomics.util.protein.Enzyme
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DualEnzyme, RegExEnzyme

public class Enzyme
extends Object
implements Cloneable

This class implements the functionality for an Enzyme.

Author:
Lennart Martens, Harald Barsnes

Field Summary
static int C_TERM_ENZYMATIC
           
static int CTERM
           
static int ENTIRELY_NOT_ENZYMATIC
           
static int FULLY_ENZYMATIC
           
protected  HashMap iCleavables
          Lookup cache for the cleavable residues.
protected  char[] iCleavage
          This char[] holds the residus after which cleavage will occur.
protected  int iMiscleavages
          This variable holds the number of supported missed cleavages.
protected  int iPosition
          This int holds the position marker for the cleavage direction for this Enzyme.
protected  char[] iRestrict
          This char[] holds the residus that will restrict cleavage when present after a cleavable residu.
protected  HashMap iRestrictors
          Lookup cache for the restricting residues.
protected  String iTitle
          This String holds the title (or name) for the enzyme.
static int N_TERM_ENZYMATIC
           
static int NTERM
           
 
Constructor Summary
Enzyme(Enzyme enzyme, int maxMissedCleavages)
          Creates a new Enzyme from a com.compomics.util.experiment.biology.Enzyme enzyme and the maximum number of missed cleavages.
Enzyme(String aTitle, String aCleavage, String aRestrict, String aPosition)
          This constructor requires that you specify all the information for this enzyme.
Enzyme(String aTitle, String aCleavage, String aRestrict, String aPosition, int aMiscleavages)
          This constructor allows you to specify all the information for this enzyme plus the number of missed cleavages that this instance will allow.
 
Method Summary
 Protein[] cleave(Protein aProtein)
          This method is the focus of the Enzyme instance.
 Protein[] cleave(Protein aProtein, int minPeptideLength, int maxPeptideLength)
          This method is the focus of the Enzyme instance.
 Object clone()
          This method returns a deep copy of the current Enzyme.
 char[] getCleavage()
          Simple getter for the cleavagable residus of the Enzyme.
 int getMiscleavages()
          Simple getter for the number of allowed missed cleavages for the Enzyme.
 int getPosition()
          Simple getter for the cleavage position of the Enzyme.
 char[] getRestrict()
          Simple getter for the restricting residus of the Enzyme.
 String getTitle()
          Simple getter for the title (name) of the Enzyme.
 int isEnzymaticProduct(String aParentSequence, int aStart, int aEnd)
          This method reports on the possibility that the presented subsequence (represented by the start and end location in the parent) is the result of enzymatic activity.
 int isEnzymaticProduct(String aParentSequence, String aSubSequence)
          This method reports on the possibility that the presented subsequence is the result of enzymatic activity.
 void setCleavage(char[] aCleavage)
          This method allows the caller to specify the cleavable residus.
 void setCleavage(String aCleavage)
          This method allows the caller to specify the cleavable residus.
 void setMiscleavages(int aMiscleavages)
          This method allows the caller to specify the number of allowed missed cleavages for this enzyme.
 void setPosition(int aPosition)
          This method allows the caller to set the cleavage position for the Enzyme.
 void setRestrict(char[] aRestrict)
          This method allows the caller to specify the residus that restrict cleavage.
 void setRestrict(String aRestrict)
          This method allows the caller to specify the residus which restrict cleavage.
 void setTitle(String aTitle)
          This method allows the caller to change the title (name) of the Enzyme.
 String toString()
          This method generates a String representation of the Enzyme, which is useful for displaying as useful information for the user or during testing/debugging.
 String toString(String aPrepend)
          This method generates a String representation of the Enzyme, which is useful for displaying as useful information for the user or during testing/debugging.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CTERM

public static final int CTERM
See Also:
Constant Field Values

NTERM

public static final int NTERM
See Also:
Constant Field Values

FULLY_ENZYMATIC

public static final int FULLY_ENZYMATIC
See Also:
Constant Field Values

N_TERM_ENZYMATIC

public static final int N_TERM_ENZYMATIC
See Also:
Constant Field Values

C_TERM_ENZYMATIC

public static final int C_TERM_ENZYMATIC
See Also:
Constant Field Values

ENTIRELY_NOT_ENZYMATIC

public static final int ENTIRELY_NOT_ENZYMATIC
See Also:
Constant Field Values

iTitle

protected String iTitle
This String holds the title (or name) for the enzyme.


iCleavage

protected char[] iCleavage
This char[] holds the residus after which cleavage will occur.


iCleavables

protected HashMap iCleavables
Lookup cache for the cleavable residues.


iRestrict

protected char[] iRestrict
This char[] holds the residus that will restrict cleavage when present after a cleavable residu.


iRestrictors

protected HashMap iRestrictors
Lookup cache for the restricting residues.


iPosition

protected int iPosition
This int holds the position marker for the cleavage direction for this Enzyme. This variable can be matched against the constants defined on this class.


iMiscleavages

protected int iMiscleavages
This variable holds the number of supported missed cleavages.

Constructor Detail

Enzyme

public Enzyme(String aTitle,
              String aCleavage,
              String aRestrict,
              String aPosition)
This constructor requires that you specify all the information for this enzyme. Title and restrict can be 'null', and the number of miscleavages is defaulted to 1.

Parameters:
aTitle - String with the title (or name) for this enzyme.
aCleavage - String composed of the rersidus after which cleavage will occur.
aRestrict - String composed of the residus which inhibit cleavage if present behind of cleavable residus.
aPosition - String which should correspond to "Cterm" or "Nterm" for each position respectively.

Enzyme

public Enzyme(String aTitle,
              String aCleavage,
              String aRestrict,
              String aPosition,
              int aMiscleavages)
This constructor allows you to specify all the information for this enzyme plus the number of missed cleavages that this instance will allow. Title and restrict can be 'null'.

Parameters:
aTitle - String with the title (or name) for this enzyme.
aCleavage - String composed of the rersidus after which cleavage will occur (this String will be uppercased).
aRestrict - String composed of the residus which inhibit cleavage if present behind of cleavable residus (this String will be uppercased).
aPosition - String which should correspond to "Cterm" or "Nterm" for each position respectively.
aMiscleavages - int with the number of supported missed cleavages.

Enzyme

public Enzyme(Enzyme enzyme,
              int maxMissedCleavages)
Creates a new Enzyme from a com.compomics.util.experiment.biology.Enzyme enzyme and the maximum number of missed cleavages. We put a lot of efforts in standardizing all objects into the experiment package. We are now very happy to provide you the opportunity to mess up your code!

Parameters:
enzyme - The com.compomics.util.experiment.biology.Enzyme enzyme
maxMissedCleavages - The maximum number of missed cleavages
Method Detail

getTitle

public String getTitle()
Simple getter for the title (name) of the Enzyme.

Returns:
String with the title (name).

setTitle

public void setTitle(String aTitle)
This method allows the caller to change the title (name) of the Enzyme.

Parameters:
aTitle - String with the title (name) for the Enzyme.

getCleavage

public char[] getCleavage()
Simple getter for the cleavagable residus of the Enzyme.

Returns:
char[] with the cleavable residus.

setCleavage

public void setCleavage(char[] aCleavage)
This method allows the caller to specify the cleavable residus.

Parameters:
aCleavage - char[] with the cleavable residus (in UPPER CASE!).

setCleavage

public void setCleavage(String aCleavage)
This method allows the caller to specify the cleavable residus. They will be read from the String as a continuous summation of characters (i.e: 'RKGH').

Parameters:
aCleavage - String with the continuous characters corresponding to the cleavable residus. Note that the String is uppercased.

getRestrict

public char[] getRestrict()
Simple getter for the restricting residus of the Enzyme.

Returns:
char[] with the restricting residus.

setRestrict

public void setRestrict(char[] aRestrict)
This method allows the caller to specify the residus that restrict cleavage.

Parameters:
aRestrict - char[] with the residus (in UPPER CASE!) which restrict cleavage.

setRestrict

public void setRestrict(String aRestrict)
This method allows the caller to specify the residus which restrict cleavage. They will be read from the String as a continuous summation of characters (i.e: 'PGHK').

Parameters:
aRestrict - String with the continuous characters corresponding to the restricting residus. Note that the String is uppercased.

getPosition

public int getPosition()
Simple getter for the cleavage position of the Enzyme.

Returns:
int with the coded cleavage position (to be compared with the constants on this class).

setPosition

public void setPosition(int aPosition)
This method allows the caller to set the cleavage position for the Enzyme. Please use the constants defined on this class as parameters.

Parameters:
aPosition - int with the coded position, according to the constants on this class.

getMiscleavages

public int getMiscleavages()
Simple getter for the number of allowed missed cleavages for the Enzyme.

Returns:
int with the number of allowed missed cleavages.

setMiscleavages

public void setMiscleavages(int aMiscleavages)
This method allows the caller to specify the number of allowed missed cleavages for this enzyme.

Parameters:
aMiscleavages - int with the number of allowed missed cleavages.

toString

public String toString()
This method generates a String representation of the Enzyme, which is useful for displaying as useful information for the user or during testing/debugging.

Overrides:
toString in class Object
Returns:
String with a textual description of this Enzyme.

toString

public String toString(String aPrepend)
This method generates a String representation of the Enzyme, which is useful for displaying as useful information for the user or during testing/debugging. It takes a parameter String that is prepended to each line.

Parameters:
aPrepend - String to prepend to each outputted line.
Returns:
String with a textual description of this Enzyme.

cleave

public Protein[] cleave(Protein aProtein)
This method is the focus of the Enzyme instance. It can perform an in-silico digest of a Protein sequence according to the specifications detailed in the construction or via the setters. Using this methods returns all possible peptides, regardless of length. To only return peptides within certain lengths use the other cleave method.

Parameters:
aProtein - Protein instance to cleave.
Returns:
Protein[] with the resultant peptides.

cleave

public Protein[] cleave(Protein aProtein,
                        int minPeptideLength,
                        int maxPeptideLength)
This method is the focus of the Enzyme instance. It can perform an in-silico digest of a Protein sequence according to the specifications detailed in the construction or via the setters. Only returns peptides between the minimum and maximum peptide lengths.

Parameters:
aProtein - Protein instance to cleave.
minPeptideLength - The minimum peptide length to consider
maxPeptideLength - The maximum peptide length to consider
Returns:
Protein[] with the resultant peptides.

clone

public Object clone()
This method returns a deep copy of the current Enzyme.

Overrides:
clone in class Object
Returns:
Object Enzyme instance that is a deep copy of the current Enzyme.

isEnzymaticProduct

public int isEnzymaticProduct(String aParentSequence,
                              String aSubSequence)
This method reports on the possibility that the presented subsequence is the result of enzymatic activity. Note that using a substring, only the FIRST (starting from the N-terminus) occurrence of the subsequence in the parent String will be considered! If multiple occurrences are possible, use the overloaded method that takes indices. Returning int values can be checked against public static final vars on this class.

Parameters:
aParentSequence - String with the parent sequence
aSubSequence - String with the subsequence
Returns:
int with the coded possibility (1 = Full enzymatic product, 2 = N-terminal half enzymatic product, 3 = C-terminal half enzymatic product and 4 = Entirely not an enzymatic product.

isEnzymaticProduct

public int isEnzymaticProduct(String aParentSequence,
                              int aStart,
                              int aEnd)
This method reports on the possibility that the presented subsequence (represented by the start and end location in the parent) is the result of enzymatic activity. Returning int values can be checked against public static final vars on this class.

Parameters:
aParentSequence - String with the parent sequence
aStart - int with the start of the subsequence relative to the parent (first residue is '1').
aEnd - int with the end of the subsequence relative to the parent
Returns:
int with the coded possibility (1 = Full enzymatic product, 2 = N-terminal half enzymatic product, 3 = C-terminal half enzymatic product and 4 = Entirely not an enzymatic product.


Copyright © 2012. All Rights Reserved.