Documentation

AbstractNucleicSequence extends AbstractMolecularSequence

AbstractYes

Holds what DNA and RNA have in common : a complement table covering the IUPAC degenerated symbols, and the GC content.

Class AbstractNucleicSequence

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Constants

ALPHABET  : mixed = ""
Symbols accepted by the value object, overridden by each concrete class.
COMPLEMENTS  : mixed = []
Complement of each symbol of the alphabet, overridden by each concrete class.
MOL_TYPE  : mixed = ""
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.
complement()  : static
Returns the genetic complement of the sequence, degenerated symbols included.
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.
gcFraction()  : float
Proportion of strong bases (G, C, and S standing for either) among the bases known to be strong or weak (A, T, U, W and those) : an N, or any other ambiguity code mixing both, tells nothing about it and is left out of the count, as Biopython's gc_fraction does by default.
getAlphabet()  : string
The symbols accepted by this kind of sequence.
getGcContent()  : float
Proportion of guanine and cytosine in the sequence, expressed as a percentage : see gcFraction().
getGcFraction()  : float
getGcPercent()  : float
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.
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.
reverseComplement()  : static
Returns the complement of the sequence read backwards, which is the strand facing it.
subSequence()  : static
Extracts a portion of the sequence, keeping the same kind of value object - except for a circular molecule, whose piece is a linear DnaSequence (see CircularDnaSequence) : the declared type is therefore this class, the object returned being a DnaSequence for a DNA, an RnaSequence for an RNA and an AminoAcidSequence for a protein, as before.

Constants

ALPHABET

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

protected mixed ALPHABET = ""

COMPLEMENTS

Complement of each symbol of the alphabet, overridden by each concrete class.

protected mixed COMPLEMENTS = []

MOL_TYPE

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

protected mixed MOL_TYPE = ""

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

gcFraction()

Proportion of strong bases (G, C, and S standing for either) among the bases known to be strong or weak (A, T, U, W and those) : an N, or any other ambiguity code mixing both, tells nothing about it and is left out of the count, as Biopython's gc_fraction does by default.

public static gcFraction(string $sSequence) : float

"GCNN" gives 1, "GCSW" 0.75. The one definition every GC content of this library uses.

Parameters
$sSequence : string

Either case

Return values
float —

Between 0 and 1 ; 0 when no base tells G/C from A/T

getAlphabet()

The symbols accepted by this kind of sequence.

public getAlphabet() : string
Return values
string

getGcContent()

Proportion of guanine and cytosine in the sequence, expressed as a percentage : see gcFraction().

public getGcContent() : float

Beware that SkewResult::getGcContent() and CpGIsland::getGcContent() give a fraction (0 to 1) : getGcPercent() and getGcFraction() say which scale they use, on all of these classes.

Return values
float —

0 when the sequence holds no base telling G/C from A/T

getGcFraction()

public getGcFraction() : float
Return values
float —

The G+C content as a fraction, 0 to 1

getGcPercent()

public getGcPercent() : float
Return values
float —

The G+C content as a percentage, 0 to 100

getMolType()

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

public getMolType() : string
Return values
string

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 - except for a circular molecule, whose piece is a linear DnaSequence (see CircularDnaSequence) : the declared type is therefore this class, the object returned being a DnaSequence for a DNA, an RnaSequence for an RNA and an AminoAcidSequence for a protein, as before.

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