\Amelaye\BioPHP\Domain\Sequence\ValueObject MolecularSequenceFactory

The molecule type stored by the parsers is the raw one of the source file : "mRNA" or "ss-DNA" for GenBank and EMBL, "PRT;" for Swiss-Prot. This factory maps those to the matching value object instead of leaving the caller compare strings.

Class MolecularSequenceFactory

Summary

Methods
Properties
Constants
fromMolType
fromEntity
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Methods

fromMolType()

fromMolType(string  $sMolType, string  $sSequence) : \Amelaye\BioPHP\Domain\Sequence\ValueObject\AbstractMolecularSequence

Wraps a raw string according to a molecule type.

A record declared as RNA is not always written with uracil : GenBank and EMBL store their mRNA entries with thymine, following the cDNA convention. When the symbols contradict the declared type, the symbols win, so that a real record can always be wrapped.

Parameters

string $sMolType

A raw molecule type, e.g. "DNA", "mRNA", "ss-DNA", "PRT;"

string $sSequence

The raw sequence string

Throws

\Amelaye\BioPHP\Domain\Sequence\ValueObject\InvalidSequenceException

When the molecule type is unknown or a symbol is invalid

Returns

\Amelaye\BioPHP\Domain\Sequence\ValueObject\AbstractMolecularSequence —

fromEntity()

fromEntity(\Amelaye\BioPHP\Domain\Sequence\Entity\Sequence  $oSequence) : \Amelaye\BioPHP\Domain\Sequence\ValueObject\AbstractMolecularSequence

Wraps the sequence held by a parsed record, using its own molecule type.

Parameters

\Amelaye\BioPHP\Domain\Sequence\Entity\Sequence $oSequence

A record coming from one of the database parsers

Throws

\Amelaye\BioPHP\Domain\Sequence\ValueObject\InvalidSequenceException

When the molecule type is unknown or a symbol is invalid

Returns

\Amelaye\BioPHP\Domain\Sequence\ValueObject\AbstractMolecularSequence —