Documentation

AminoAcidSequence extends AbstractMolecularSequence

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

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Constants

STOP  : mixed = "*"
The symbol marking the end of the translation.
ALPHABET  : mixed = "ACDEFGHIKLMNPQRSTVWYX*"
Symbols accepted by the value object, overridden by each concrete class.
MOL_TYPE  : mixed = "PROTEIN"
Molecule type of the value object, overridden by each concrete class.

Methods

__construct()  : mixed
AbstractMolecularSequence constructor.
__toString()  : string
Allows the value object to be used wherever the library still expects a raw string.
countSymbol()  : int
Counts how many times a symbol occurs in the sequence.
equals()  : bool
Two value objects are equal when they are of the same kind and hold the same symbols.
getAlphabet()  : string
The symbols accepted by this kind of sequence.
getLength()  : int
Number of symbols held by the sequence.
getMolType()  : string
The molecule type, as used by SequenceManager (DNA, RNA, PROTEIN).
getValue()  : string
The wrapped sequence, normalized.
hasStop()  : bool
Tells whether the chain holds a stop codon.
hasUnknownResidue()  : bool
Tells whether the chain holds an unknown residue.
isEmpty()  : bool
isValid()  : bool
Tells whether every symbol of a string belongs to the alphabet of the value object, without building an instance.
reverse()  : static
Returns the sequence read from the last symbol to the first one.
subSequence()  : static
Extracts a portion of the sequence, keeping the same kind of value object.
truncateAtStop()  : AminoAcidSequence
Returns the residues preceding the first stop codon, the whole chain when there is none.

Constants

ALPHABET

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

protected mixed ALPHABET = "ACDEFGHIKLMNPQRSTVWYX*"
Tags
inheritDoc

MOL_TYPE

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

protected mixed MOL_TYPE = "PROTEIN"
Tags
inheritDoc

Methods

__construct()

AbstractMolecularSequence constructor.

public __construct(string $sSequence) : mixed

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
$sSequence : string

The raw sequence string

Tags
throws
InvalidSequenceException

When a symbol does not belong to the alphabet

__toString()

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

public __toString() : string
Return values
string

countSymbol()

Counts how many times a symbol occurs in the sequence.

public countSymbol(string $sSymbol) : int
Parameters
$sSymbol : string

A single symbol, case insensitive

Return values
int

getAlphabet()

The symbols accepted by this kind of sequence.

public getAlphabet() : string
Return values
string

getMolType()

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

public getMolType() : string
Return values
string

hasStop()

Tells whether the chain holds a stop codon.

public hasStop() : bool
Return values
bool

hasUnknownResidue()

Tells whether the chain holds an unknown residue.

public hasUnknownResidue() : bool
Return values
bool

isValid()

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

public static isValid(string $sSequence) : bool
Parameters
$sSequence : string
Return values
bool

subSequence()

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

public subSequence(int $iStart[, int|null $iLength = null ]) : static
Parameters
$iStart : int

Zero-based position of the first symbol

$iLength : int|null = null

Number of symbols, until the end when omitted

Tags
throws
InvalidSequenceException
Return values
static
On this page

Search results