Class RegExEnzyme

java.lang.Object
com.compomics.util.protein.Enzyme
com.compomics.util.protein.RegExEnzyme
All Implemented Interfaces:
Cloneable

public class RegExEnzyme
extends Enzyme
This class implements the functionality of an Enzyme by simulating digestion based on a regular expression.
Since:
2.9
Author:
Florian Reisinger
  • Constructor Details

    • RegExEnzyme

      public RegExEnzyme()
      Empty default constructor
    • RegExEnzyme

      public RegExEnzyme​(String aTitle, String aCleavage, String aRestrict, String aPosition)
      Create a new RegExEnzyme.
      Parameters:
      aTitle - the title
      aCleavage - the cleavage site
      aRestrict - the restricting amino acids
      aPosition - the position
    • RegExEnzyme

      public RegExEnzyme​(String aTitle, String aCleavage, String aRestrict, String aPosition, int aMiscleavages)
      Create a new RegExEnzyme.
      Parameters:
      aTitle - the title
      aCleavage - the cleavage site
      aRestrict - the restricting amino acids
      aPosition - the position
      aMiscleavages - max number of miscleavages
  • Method Details

    • setCleavage

      public void setCleavage​(String aCleavage)
      This method can be used to set the cleavage pattern for this RegExEnzyme. The pattern is used by the enzyme to find the cleavage sits, where the last residue matched by the pattern defines the cleavage site. (e.g. in case of C-terminal cleavage, the enzyme cuts right after the match of the pattern, and in case of N-terminal cleavage, the enzyme cuts just before the last residue matching the pattern)
      Overrides:
      setCleavage in class Enzyme
      Parameters:
      aCleavage - a String representing the pattern for the cleavage site.
      Throws:
      PatternSyntaxException - if the provided string could not be compiled as regular expression.
    • setCleavage

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

      public char[] getCleavage()
      Description copied from class: Enzyme
      Simple getter for the cleavagable residues of the Enzyme.
      Overrides:
      getCleavage in class Enzyme
      Returns:
      char[] with the cleavable residues.
    • toString

      public String toString()
      Description copied from class: Enzyme
      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 Enzyme
      Returns:
      String with a textual description of this Enzyme.
    • toString

      public String toString​(String aPrepend)
      Description copied from class: Enzyme
      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.
      Overrides:
      toString in class Enzyme
      Parameters:
      aPrepend - String to prepend to each outputted line.
      Returns:
      String with a textual description of this Enzyme.
    • clone

      public Object clone()
      Description copied from class: Enzyme
      This method returns a deep copy of the current Enzyme.
      Overrides:
      clone in class Enzyme
      Returns:
      Object Enzyme instance that is a deep copy of the current Enzyme.
    • isEnzymaticProduct

      public int isEnzymaticProduct​(String aParentSequence, String aSubSequence)
      Description copied from class: Enzyme
      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.
      Overrides:
      isEnzymaticProduct in class Enzyme
      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)
      Description copied from class: Enzyme
      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.
      Overrides:
      isEnzymaticProduct in class Enzyme
      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.
    • cleave

      public Protein[] cleave​(Protein aProtein)
      Description copied from class: Enzyme
      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.
      Overrides:
      cleave in class Enzyme
      Parameters:
      aProtein - Protein instance to cleave.
      Returns:
      Protein[] with the resultant peptides.