\Amelaye\BioPHP\Domain\Sequence\ValueObject AminoAcidSequence

Accepts the twenty amino acids in single-letter format, plus the two symbols already handled by SequenceManager::charge() and SequenceManager::chemicalGroup() : X for an unknown residue and the asterisk for a stop codon.

Class AminoAcidSequence

Summary

Methods
Properties
Constants
hasStop
truncateAtStop
hasUnknownResidue
__construct
getValue
__toString
getMolType
getAlphabet
getLength
isEmpty
equals
subSequence
reverse
countSymbol
isValid
No public properties found
STOP
No protected methods found
No protected properties found
ALPHABET
MOL_TYPE
No private methods found
No private properties found
No private constants found

Constant

STOP

STOP = "*"

The symbol marking the end of the translation.

ALPHABET

ALPHABET = ""

Symbols accepted by the value object, overridden by each concrete class.

MOL_TYPE

MOL_TYPE = ""

Molecule type of the value object, overridden by each concrete class.

Methods

hasStop()

hasStop() : bool

Tells whether the chain holds a stop codon.

Returns

bool —

truncateAtStop()

truncateAtStop() : \Amelaye\BioPHP\Domain\Sequence\ValueObject\AminoAcidSequence

Returns the residues preceding the first stop codon, the whole chain when there is none.

Throws

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

Returns

\Amelaye\BioPHP\Domain\Sequence\ValueObject\AminoAcidSequence —

hasUnknownResidue()

hasUnknownResidue() : bool

Tells whether the chain holds an unknown residue.

Returns

bool —

__construct()

__construct(string  $sSequence) : mixed

AbstractMolecularSequence constructor.

Whitespace is stripped and the remaining symbols are upper-cased before validation, so raw lines coming from a GenBank, EMBL or FASTA file can be wrapped as they are read.

Parameters

string $sSequence

The raw sequence string

Throws

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

When a symbol does not belong to the alphabet

Returns

mixed —

getValue()

getValue() : string

The wrapped sequence, normalized.

Returns

string —

__toString()

__toString() : string

Allows the value object to be used wherever the library still expects a raw string.

Returns

string —

getMolType()

getMolType() : string

The molecule type, as used by SequenceManager (DNA, RNA, PROTEIN).

Returns

string —

getAlphabet()

getAlphabet() : string

The symbols accepted by this kind of sequence.

Returns

string —

getLength()

getLength() : int

Number of symbols held by the sequence.

Returns

int —

isEmpty()

isEmpty() : bool

Returns

bool —

equals()

equals(\Amelaye\BioPHP\Domain\Sequence\ValueObject\AbstractMolecularSequence  $oOther) : bool

Two value objects are equal when they are of the same kind and hold the same symbols.

Parameters

\Amelaye\BioPHP\Domain\Sequence\ValueObject\AbstractMolecularSequence $oOther

Returns

bool —

subSequence()

subSequence(int  $iStart, int|null  $iLength = null) : static

Extracts a portion of the sequence, keeping the same kind of value object.

Parameters

int $iStart

Zero-based position of the first symbol

int|null $iLength

Number of symbols, until the end when omitted

Throws

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

Returns

static —

reverse()

reverse() : static

Returns the sequence read from the last symbol to the first one.

Throws

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

Returns

static —

countSymbol()

countSymbol(string  $sSymbol) : int

Counts how many times a symbol occurs in the sequence.

Parameters

string $sSymbol

A single symbol, case insensitive

Returns

int —

isValid()

isValid(string  $sSequence) : bool

Tells whether every symbol of a string belongs to the alphabet of the value object, without building an instance.

Parameters

string $sSequence

Returns

bool —