\Amelaye\BioPHP\Domain\Database\Service EntryReader

Class EntryReader

Summary

Methods
Properties
Constants
read
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
entry
No private properties found
No private constants found

Methods

read()

read(array  $aFileLines, string  $sDbFormat) : \Generator

A record is gathered before it is identified : a parser reads the identifier out of the lines it is handed, so handing it the whole file would identify every record of that file as its first one. Lines sitting before any record start - the header a data file may open with - belong to no record. A format closing no record leaves the previous one open.

Parameters

array $aFileLines

The lines of the data file

string $sDbFormat

Database format, e.g. "GENBANK"

Throws

\Exception

Returns

\Generator —

Yields, for each record : "id", "lines" and "line_no"

entry()

entry(array  $aEntryLines, string  $sStartLine, int  $iStartNo, string  $sDbFormat) : array

Parameters

array $aEntryLines
string $sStartLine
int $iStartNo
string $sDbFormat

Throws

\Exception

Returns

array —