com.compomics.util.protein
Class RegExEnzyme

java.lang.Object
  extended by com.compomics.util.protein.Enzyme
      extended by com.compomics.util.protein.RegExEnzyme
All Implemented Interfaces:
java.lang.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

Field Summary
 
Fields inherited from class com.compomics.util.protein.Enzyme
C_TERM_ENZYMATIC, CTERM, ENTIRELY_NOT_ENZYMATIC, FULLY_ENZYMATIC, iCleavables, iCleavage, iMiscleavages, iPosition, iRestrict, iRestrictors, iTitle, N_TERM_ENZYMATIC, NTERM
 
Constructor Summary
RegExEnzyme(java.lang.String aTitle, java.lang.String aCleavage, java.lang.String aRestrict, java.lang.String aPosition)
          Create a new RegExEnzyme.
RegExEnzyme(java.lang.String aTitle, java.lang.String aCleavage, java.lang.String aRestrict, java.lang.String aPosition, int aMiscleavages)
          Create a new RegExEnzyme.
 
Method Summary
 Protein[] cleave(Protein aProtein)
          This method is the focus of the Enzyme instance.
 java.lang.Object clone()
          This method returns a deep copy of the current Enzyme.
 char[] getCleavage()
          Simple getter for the cleavagable residus of the Enzyme.
 int isEnzymaticProduct(java.lang.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(java.lang.String aParentSequence, java.lang.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(java.lang.String aCleavage)
          This method can be used to set the cleavage pattern for this RegExEnzyme.
 java.lang.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.
 java.lang.String toString(java.lang.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 com.compomics.util.protein.Enzyme
cleave, getMiscleavages, getPosition, getRestrict, getTitle, setMiscleavages, setPosition, setRestrict, setRestrict, setTitle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegExEnzyme

public RegExEnzyme(java.lang.String aTitle,
                   java.lang.String aCleavage,
                   java.lang.String aRestrict,
                   java.lang.String aPosition)
Create a new RegExEnzyme.

Parameters:
aTitle -
aCleavage -
aRestrict -
aPosition -

RegExEnzyme

public RegExEnzyme(java.lang.String aTitle,
                   java.lang.String aCleavage,
                   java.lang.String aRestrict,
                   java.lang.String aPosition,
                   int aMiscleavages)
Create a new RegExEnzyme.

Parameters:
aTitle -
aCleavage -
aRestrict -
aPosition -
aMiscleavages -
Method Detail

setCleavage

public void setCleavage(java.lang.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:
java.util.regex.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 residus.

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

getCleavage

public char[] getCleavage()
Description copied from class: Enzyme
Simple getter for the cleavagable residus of the Enzyme.

Overrides:
getCleavage in class Enzyme
Returns:
char[] with the cleavable residus.

toString

public java.lang.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 java.lang.String toString(java.lang.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 java.lang.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(java.lang.String aParentSequence,
                              java.lang.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(java.lang.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.


Copyright © 2013. All Rights Reserved.