Package com.compomics.util.protein
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
-
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
Constructors Constructor Description RegExEnzyme()
Empty default constructorRegExEnzyme(String aTitle, String aCleavage, String aRestrict, String aPosition)
Create a new RegExEnzyme.RegExEnzyme(String aTitle, String aCleavage, String aRestrict, String aPosition, int aMiscleavages)
Create a new RegExEnzyme. -
Method Summary
Modifier and Type Method Description Protein[]
cleave(Protein aProtein)
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
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 can be used to set the cleavage pattern for this RegExEnzyme.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 com.compomics.util.protein.Enzyme
cleave, getMiscleavages, getPosition, getRestrict, getTitle, setMiscleavages, setPosition, setRestrict, setRestrict, setTitle
-
Constructor Details
-
RegExEnzyme
public RegExEnzyme()Empty default constructor -
RegExEnzyme
Create a new RegExEnzyme.- Parameters:
aTitle
- the titleaCleavage
- the cleavage siteaRestrict
- the restricting amino acidsaPosition
- the position
-
RegExEnzyme
public RegExEnzyme(String aTitle, String aCleavage, String aRestrict, String aPosition, int aMiscleavages)Create a new RegExEnzyme.- Parameters:
aTitle
- the titleaCleavage
- the cleavage siteaRestrict
- the restricting amino acidsaPosition
- the positionaMiscleavages
- max number of miscleavages
-
-
Method Details
-
setCleavage
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 classEnzyme
- 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 classEnzyme
- 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 classEnzyme
- Returns:
- char[] with the cleavable residues.
-
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. -
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. It takes a parameter String that is prepended to each line. -
clone
Description copied from class:Enzyme
This method returns a deep copy of the current Enzyme. -
isEnzymaticProduct
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 classEnzyme
- Parameters:
aParentSequence
- String with the parent sequenceaSubSequence
- 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
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 classEnzyme
- Parameters:
aParentSequence
- String with the parent sequenceaStart
- 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
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.
-