\Amelaye\BioPHP\Domain\Parser\Service ParseTransfacAbstractManager

Class ParseTransfacAbstractManager TRANSFAC ships one flat file per kind of record - matrix.dat, gene.dat, class.dat, cell.dat, factor.dat, site.dat - which all share the same grammar : a two-letter label in the first columns, its data from the fifth, "XX" lines spacing the fields apart and "//" closing the record. That grammar, the AC/ID/DT fields every record carries and the way a field spanning several lines is joined, live here; each subclass adds the fields of its own record.

The date reads by tokens rather than at the fixed offset Legacy/transfac.inc.php used for five of its six record types : that offset assumed a two-digit year ("20.06.90") and misses the marker as soon as the file writes the year in full, which TRANSFAC has long been doing.

Summary

Methods
Properties
Constants
__construct
isEntryStart
isEntryEnd
getEntryId
getAccession
getId
getDateCreated
getDateUpdated
No public properties found
No public constants found
readLabel
readData
parseCommonField
parseDate
append
splitList
accession
id
dateCreated
dateUpdated
No protected constants found
No private methods found
No private properties found
No private constants found

Properties

$accession

$accession : string

Type

string —

$id

$id : string

Type

string —

$dateCreated

$dateCreated : string

Type

string —

$dateUpdated

$dateUpdated : string

Type

string —

Methods

__construct()

__construct() : mixed

Constructor.

Returns

mixed —

isEntryStart()

isEntryStart(string  $sLine) : bool

Tells whether a line opens a new TRANSFAC record, which the accession number does.

Parameters

string $sLine

The line to analyze

Returns

bool —

isEntryEnd()

isEntryEnd(string  $sLine) : bool

Tells whether a line closes a TRANSFAC record.

Parameters

string $sLine

The line to analyze

Returns

bool —

getEntryId()

getEntryId(array  $aFlines, string  $sLine) : string

Extracts the identifier uniquely naming a TRANSFAC record, its accession number.

Parameters

array $aFlines

The whole file, buffered

string $sLine

The line opening the entry

Returns

string —

getAccession()

getAccession() : string

Returns

string —

getId()

getId() : string

Returns

string —

getDateCreated()

getDateCreated() : string

Returns

string —

getDateUpdated()

getDateUpdated() : string

Returns

string —

readLabel()

readLabel(string  $sLine) : string

Reads the two-letter label a line carries.

Parameters

string $sLine

The line to analyze

Returns

string —

readData()

readData(string  $sLine) : string

Reads the data a line carries, which starts at its fifth column.

Parameters

string $sLine

The line to analyze

Returns

string —

parseCommonField()

parseCommonField(string  $sLabel, string  $sData) : bool

Reads the fields every TRANSFAC record carries, and says whether it did : a subclass calls this first and only looks at the labels of its own record when it did not.

Parameters

string $sLabel
string $sData

Returns

bool —

parseDate()

parseDate(string  $sData) : mixed

Parses one DT line, which dates either the creation or the last update of the record and may carry a time of day.

Format : DT 20.06.90 11:00:03 (created); ewi.

Parameters

string $sData

Returns

mixed —

append()

append(string  $sBuffer, string  $sData) : string

Appends the data of a line to a field written over several of them.

Parameters

string $sBuffer
string $sData

Returns

string —

splitList()

splitList(string  $sText, string  $sSeparator = ";") : array

Splits a field listing its values, semicolon separated and possibly closed by a period, into its items.

Parameters

string $sText
string $sSeparator

Returns

array —