Class Enzyme

java.lang.Object
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, MArc Vaudel
  • Field Summary

    Fields 
    Modifier and Type Field Description
    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 residues after which cleavage will occur.
    protected int iMiscleavages
    This variable holds the number of supported missed cleavages.
    protected int iPosition
    This integer holds the position marker for the cleavage direction for this Enzyme.
    protected char[] iRestrict
    This char[] holds the residues that will restrict cleavage when present after a cleavable residue.
    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

    Constructors 
    Constructor Description
    Enzyme()
    Empty default constructor
    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

    Modifier and Type Method Description
    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 residues 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 residues 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 residues.
    void setCleavage​(String aCleavage)
    This method allows the caller to specify the cleavable residues.
    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 residues that restrict cleavage.
    void setRestrict​(String aRestrict)
    This method allows the caller to specify the residues 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 Details

  • Constructor Details

    • Enzyme

      public Enzyme()
      Empty default constructor
    • 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 residues after which cleavage will occur.
      aRestrict - String composed of the residues which inhibit cleavage if present behind of cleavable residues.
      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 residues after which cleavage will occur (this String will be uppercased).
      aRestrict - String composed of the residues which inhibit cleavage if present behind of cleavable residues (this String will be uppercased).
      aPosition - String which should correspond to "Cterm" or "Nterm" for each position respectively.
      aMiscleavages - integer 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.
      Parameters:
      enzyme - The com.compomics.util.experiment.biology.Enzyme enzyme
      maxMissedCleavages - The maximum number of missed cleavages
  • Method Details

    • 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 residues of the Enzyme.
      Returns:
      char[] with the cleavable residues.
    • setCleavage

      public void setCleavage​(char[] aCleavage)
      This method allows the caller to specify the cleavable residues.
      Parameters:
      aCleavage - char[] with the cleavable residues (in UPPER CASE!).
    • setCleavage

      public void setCleavage​(String aCleavage)
      This method allows the caller to specify the cleavable residues. 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 residues. Note that the String is uppercased.
    • getRestrict

      public char[] getRestrict()
      Simple getter for the restricting residues of the Enzyme.
      Returns:
      char[] with the restricting residues.
    • setRestrict

      public void setRestrict​(char[] aRestrict)
      This method allows the caller to specify the residues that restrict cleavage.
      Parameters:
      aRestrict - char[] with the residues (in UPPER CASE!) which restrict cleavage.
    • setRestrict

      public void setRestrict​(String aRestrict)
      This method allows the caller to specify the residues 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 residues. 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.