RestrictionEnzymeCatalog
in package
implements
RestrictionEnzymeCatalogInterface
Class RestrictionEnzymeCatalog - composes the three existing endonuclease adapters into a single, typed lookup of RestrictionEnzymeDefinition, without duplicating bioapi's data and without touching RestrictionEnzymeManager's private storage. Built once at construction, since the underlying sources are themselves immutable API snapshots.
Tags
Table of Contents
Interfaces
- RestrictionEnzymeCatalogInterface
- Interface RestrictionEnzymeCatalogInterface - gives typed, read-only access to restriction enzyme definitions merged from the Type II, Type IIb and Type IIs endonuclease sources, without exposing the private storage of any single one of them.
Properties
- $aCanonicalNameByAlias : array<string|int, string>
- $aDefinitionsByName : array<string|int, RestrictionEnzymeDefinition>
Methods
- __construct() : mixed
- RestrictionEnzymeCatalog constructor.
- findByFamily() : array<string|int, RestrictionEnzymeDefinition>
- Returns every enzyme belonging to the given family, sorted by canonical name.
- findByName() : RestrictionEnzymeDefinition|null
- Looks a restriction enzyme up by its canonical name or one of its aliases, case-insensitively.
- findByRecognitionSequence() : array<string|int, RestrictionEnzymeDefinition>
- Returns every enzyme whose recognition sequence, cleavage marks stripped, matches $sSequence case-insensitively : either alternative of a "SITE1 or SITE2" sequence, read on either strand (GAGCGG finds AccBSI, CCGCTC). Several enzymes (isoschizomers) may share the same recognition sequence.
- getByName() : RestrictionEnzymeDefinition
- Same as findByName(), but throws instead of returning null.
- mapDtoToDefinition() : RestrictionEnzymeDefinition
- Builds a RestrictionEnzymeDefinition from a Type II, IIb or IIs DTO. The three DTO classes share the same eight getters by construction; only their class name and family differ.
- registerDtoCollection() : void
- Maps every DTO of a collection to a RestrictionEnzymeDefinition and registers it, keeping the first-registered definition whenever the same canonical name is found in more than one source.
- sitesOf() : array<string|int, string>
- Lists the sites an enzyme binds, upper-cased : each alternative of a "SITE1 or SITE2" recognition sequence (AciI CCGC or GCGG), and the reverse complement of each, the same site read on the other strand (AccBSI CCGCTC, GAGCGG).
- sortedByName() : array<string|int, RestrictionEnzymeDefinition>
Properties
$aCanonicalNameByAlias
private
array<string|int, string>
$aCanonicalNameByAlias
= []
Uppercase name or alias => uppercase canonical name
$aDefinitionsByName
private
array<string|int, RestrictionEnzymeDefinition>
$aDefinitionsByName
= []
Keyed by uppercase canonical name
Methods
__construct()
RestrictionEnzymeCatalog constructor.
public
__construct(TypeIIEndonucleaseApiAdapter $typeIIApi, TypeIIbEndonucleaseApiAdapter $typeIIbApi, TypeIIsEndonucleaseApiAdapter $typeIIsApi) : mixed
Parameters
- $typeIIApi : TypeIIEndonucleaseApiAdapter
- $typeIIbApi : TypeIIbEndonucleaseApiAdapter
- $typeIIsApi : TypeIIsEndonucleaseApiAdapter
findByFamily()
Returns every enzyme belonging to the given family, sorted by canonical name.
public
findByFamily(string $sFamily) : array<string|int, RestrictionEnzymeDefinition>
Parameters
- $sFamily : string
-
One of RestrictionEnzymeDefinition::VALID_FAMILIES
Tags
Return values
array<string|int, RestrictionEnzymeDefinition> —Empty when the family is unknown or has no member
findByName()
Looks a restriction enzyme up by its canonical name or one of its aliases, case-insensitively.
public
findByName(string $sName) : RestrictionEnzymeDefinition|null
Parameters
- $sName : string
-
Canonical name or alias
Tags
Return values
RestrictionEnzymeDefinition|null —Null when no enzyme matches
findByRecognitionSequence()
Returns every enzyme whose recognition sequence, cleavage marks stripped, matches $sSequence case-insensitively : either alternative of a "SITE1 or SITE2" sequence, read on either strand (GAGCGG finds AccBSI, CCGCTC). Several enzymes (isoschizomers) may share the same recognition sequence.
public
findByRecognitionSequence(string $sSequence) : array<string|int, RestrictionEnzymeDefinition>
Parameters
- $sSequence : string
-
The recognition sequence to search for, without cleavage marks
Tags
Return values
array<string|int, RestrictionEnzymeDefinition> —Sorted by canonical name, empty when nothing matches
getByName()
Same as findByName(), but throws instead of returning null.
public
getByName(string $sName) : RestrictionEnzymeDefinition
Parameters
- $sName : string
-
Canonical name or alias
Tags
Return values
RestrictionEnzymeDefinitionmapDtoToDefinition()
Builds a RestrictionEnzymeDefinition from a Type II, IIb or IIs DTO. The three DTO classes share the same eight getters by construction; only their class name and family differ.
private
mapDtoToDefinition(object $oDto, string $sFamily) : RestrictionEnzymeDefinition
Parameters
- $oDto : object
-
TypeIIEndonucleaseDTO|TypeIIbEndonucleaseDTO|TypeIIsEndonucleaseDTO
- $sFamily : string
-
One of RestrictionEnzymeDefinition::VALID_FAMILIES
Return values
RestrictionEnzymeDefinitionregisterDtoCollection()
Maps every DTO of a collection to a RestrictionEnzymeDefinition and registers it, keeping the first-registered definition whenever the same canonical name is found in more than one source.
private
registerDtoCollection(array<string|int, mixed> $aDtos, string $sFamily) : void
An entry whose name ends with "@" (FokI@) is not an enzyme : it is the reverse orientation of the Type IIS site of the enzyme it follows, kept for pattern searches. A digest already finds that orientation by searching both strands, so it is not registered.
Parameters
- $aDtos : array<string|int, mixed>
-
TypeIIEndonucleaseDTO[]|TypeIIbEndonucleaseDTO[]|TypeIIsEndonucleaseDTO[]
- $sFamily : string
-
One of RestrictionEnzymeDefinition::VALID_FAMILIES
sitesOf()
Lists the sites an enzyme binds, upper-cased : each alternative of a "SITE1 or SITE2" recognition sequence (AciI CCGC or GCGG), and the reverse complement of each, the same site read on the other strand (AccBSI CCGCTC, GAGCGG).
private
sitesOf(RestrictionEnzymeDefinition $oDefinition) : array<string|int, string>
Parameters
- $oDefinition : RestrictionEnzymeDefinition
Return values
array<string|int, string>sortedByName()
private
sortedByName(array<string|int, RestrictionEnzymeDefinition> $aDefinitions) : array<string|int, RestrictionEnzymeDefinition>
Parameters
- $aDefinitions : array<string|int, RestrictionEnzymeDefinition>
Return values
array<string|int, RestrictionEnzymeDefinition> —Sorted by canonical name, ascending