CircularRestrictionDigestManager
in package
implements
RestrictionDigestInterface
The upper/lower cleavage position convention is locked by RestrictionEnzymeCatalog's fixtures and verified against known biology : cleavagePositionUpper is the offset, from the start of a match, of the upper-strand cut ; cleavagePositionLower is that same offset for the lower strand, expressed relative to the upper one (RestrictionEnzymeDTO's own wording). A positive relative offset produces a 5' overhang, a negative one a 3' overhang, zero a blunt end - checked here against EcoRI (5', offset +4, overhang "AATT"), AatII (3', offset -4, overhang "ACGT") and AatI (blunt, offset 0).
Sites are searched using RestrictionEnzymeDefinition::getComputingPattern(), the IUPAC-to-regex conversion bioapi already provides ; no ambiguous symbol is ever injected into a regular expression by this class. An origin-crossing site is found by searching a sequence extended with its own prefix, keeping only matches that start before the true sequence length.
A restriction enzyme binds double-stranded DNA, so a non-palindromic recognition sequence must be searched for on BOTH strands : findSites() therefore also searches the reference strand's reverse complement for the same pattern. A match found this way represents a site whose recognition sequence, in the enzyme's own 5'->3' frame, actually lies on the plasmid's complementary strand ; its own "upper" (recognition-sequence-bearing strand) and "lower" (complementary strand) cuts are therefore the reference strand's LOWER and UPPER cuts respectively, not the other way around, and both are re-derived from the axis coordinate of the recognition sequence's own start rather than reused verbatim from the forward-search arithmetic. For a palindromic pattern (every enzyme this class was first tested against) this reverse search finds exactly the same physical cuts the forward search already found, just from the other side, so the resulting cuts are deduplicated by their final (upper, lower) coordinates before being reported. Class CircularRestrictionDigestManager
Tags
Table of Contents
Interfaces
- RestrictionDigestInterface
- Interface RestrictionDigestInterface - computes where a set of restriction enzymes cut a circular Plasmid, and the fragments that digestion produces.
Methods
- digest() : RestrictionDigestResult
- buildCut() : RestrictionCut
- buildEnd() : RestrictionEnd
- buildFragments() : array<string|int, RestrictionFragment>
- Builds the linear fragments a digest actually produces : one per distinct upper cut position, none when there is no cut at all, exactly one spanning the whole plasmid when there is a single one. Several cuts sharing the same upper cut position collapse into one boundary. When they leave the same end (isoschizomers), that end is kept ; when they nick the lower strand at different places (neoschizomers such as SmaI/XmaI, or two unrelated enzymes), the lower strand is cut twice : a short piece between the two nicks may or may not stay paired, so the end is UNKNOWN, and a warning says so. It used to be the first enzyme's end, the second one's being misreported.
- findSites() : array<string|int, array{position: int, reverse: bool}>
- Finds every occurrence of $oEnzyme's recognition pattern on EITHER strand, including one that crosses the origin, without ever finding the same circular occurrence twice on a given strand.
- hasAmbiguousSiteBases() : bool
- Tells whether the bases an enzyme actually reads are ambiguous (AvaII GGWCC). The N a Type IIS site is padded with up to its cut (BsaI GGTCTCN'NNNN_) are no recognized bases : they would flag every BsaI or BsmBI digest as matched by expansion.
- searchPattern() : array<string|int, int>
- Finds every zero-based position $oEnzyme's recognition pattern starts at within $sValue itself, including one that crosses the origin or overlaps another one, without ever finding the same circular occurrence twice.
Methods
digest()
public
digest(Plasmid $oPlasmid, array<string|int, RestrictionEnzymeDefinition> $aEnzymes) : RestrictionDigestResult
Parameters
- $oPlasmid : Plasmid
- $aEnzymes : array<string|int, RestrictionEnzymeDefinition>
Return values
RestrictionDigestResultbuildCut()
private
buildCut(CircularDnaSequence $oSequence, RestrictionEnzymeDefinition $oEnzyme, int $iPosition, bool $bReverseStrand) : RestrictionCut
Parameters
- $oSequence : CircularDnaSequence
- $oEnzyme : RestrictionEnzymeDefinition
- $iPosition : int
-
Zero-based axis coordinate of the recognition sequence's own 5' start
- $bReverseStrand : bool
-
True when the recognition sequence was only found on the complementary strand
Return values
RestrictionCutbuildEnd()
private
buildEnd(CircularDnaSequence $oSequence, int $iUpper, int $iLower, int $iCleavagePositionLower) : RestrictionEnd
Parameters
- $oSequence : CircularDnaSequence
- $iUpper : int
-
Zero-based upper cut position
- $iLower : int
-
Zero-based lower cut position
- $iCleavagePositionLower : int
-
The signed distance between the two, whose sign decides the overhang type
Return values
RestrictionEndbuildFragments()
Builds the linear fragments a digest actually produces : one per distinct upper cut position, none when there is no cut at all, exactly one spanning the whole plasmid when there is a single one. Several cuts sharing the same upper cut position collapse into one boundary. When they leave the same end (isoschizomers), that end is kept ; when they nick the lower strand at different places (neoschizomers such as SmaI/XmaI, or two unrelated enzymes), the lower strand is cut twice : a short piece between the two nicks may or may not stay paired, so the end is UNKNOWN, and a warning says so. It used to be the first enzyme's end, the second one's being misreported.
private
buildFragments(Plasmid $oPlasmid, array<string|int, RestrictionCut> $aCuts, array<string|int, string> &$aWarnings) : array<string|int, RestrictionFragment>
Parameters
- $oPlasmid : Plasmid
- $aCuts : array<string|int, RestrictionCut>
-
Already sorted by recognition position
- $aWarnings : array<string|int, string>
-
Added to
Return values
array<string|int, RestrictionFragment>findSites()
Finds every occurrence of $oEnzyme's recognition pattern on EITHER strand, including one that crosses the origin, without ever finding the same circular occurrence twice on a given strand.
private
findSites(string $sValue, int $iLength, RestrictionEnzymeDefinition $oEnzyme) : array<string|int, array{position: int, reverse: bool}>
Parameters
- $sValue : string
-
The plasmid's normalized (reference strand) sequence
- $iLength : int
-
The plasmid's length
- $oEnzyme : RestrictionEnzymeDefinition
Return values
array<string|int, array{position: int, reverse: bool}> —Zero-based axis coordinate of the recognition sequence's own 5' start, and whether it was only found on the complementary strand
hasAmbiguousSiteBases()
Tells whether the bases an enzyme actually reads are ambiguous (AvaII GGWCC). The N a Type IIS site is padded with up to its cut (BsaI GGTCTCN'NNNN_) are no recognized bases : they would flag every BsaI or BsmBI digest as matched by expansion.
private
hasAmbiguousSiteBases(RestrictionEnzymeDefinition $oEnzyme) : bool
Parameters
- $oEnzyme : RestrictionEnzymeDefinition
Return values
boolsearchPattern()
Finds every zero-based position $oEnzyme's recognition pattern starts at within $sValue itself, including one that crosses the origin or overlaps another one, without ever finding the same circular occurrence twice.
private
searchPattern(string $sValue, int $iLength, RestrictionEnzymeDefinition $oEnzyme) : array<string|int, int>
Parameters
- $sValue : string
-
The strand to search, read left to right
- $iLength : int
-
The plasmid's length
- $oEnzyme : RestrictionEnzymeDefinition
Return values
array<string|int, int> —Ascending, deduplicated, zero-based positions