\Amelaye\BioPHP\Domain\Parser\Service ParseEntrezManager

Class ParseEntrezManager An Entrez genome record describes a whole genome the way GenBank describes an entry : same LOCUS columns, same 12-character label column. It carries neither a FEATURES table nor an ORIGIN sequence though, so it holds annotation only and this class exposes plain scalars and EntrezReferenceInterface objects rather than the Sequence/Feature entities of ParseDbAbstractManager.

Two deliberate departures from Legacy/entrez.inc.php, which called three helpers (is_notmt(), monthno(), topo_code()) that exist nowhere in the original source and could therefore never run : the strand count reads SINGLE/DOUBLE/MIXED and the date is kept as the file writes it, both as ParseGenbankManager already does for the very same LOCUS columns, rather than being normalised to "SS"/"DS" and to an ISO date.

Summary

Methods
Properties
Constants
__construct
getFormat
isEntryStart
isEntryEnd
getEntryId
parseDataFile
getEntryName
getMolType
getLength
getEntryDate
getDivision
getTopology
getStrands
getDefinition
getPrimAcc
getAccession
getVersion
getNcbiGiId
getKeywords
getSource
getOrganism
getTaxonomy
getReferences
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
readLabel
accumulate
splitList
parseLocus
parseVersion
startReference
fillReference
splitAuthors
entryName
molType
length
entryDate
division
topology
strands
definition
primAcc
accession
version
ncbiGiId
keywords
source
organism
taxonomy
references
REFERENCE_SUBKEYS

Constant

REFERENCE_SUBKEYS

REFERENCE_SUBKEYS = ["AUTHORS", "TITLE", "JOURNAL", "MEDLINE", "PUBMED", "REMARK"]

Subkeys of a REFERENCE block, indented under it.

Properties

$entryName

$entryName : string

Type

string —

$molType

$molType : string

Type

string —

$length

$length : int

Type

int —

$entryDate

$entryDate : string

Type

string —

$division

$division : string

Type

string —

$topology

$topology : string

Type

string —

$strands

$strands : string

Type

string —

$definition

$definition : string

Type

string —

$primAcc

$primAcc : string

Type

string —

$accession

$accession : array

Type

array<string|int, mixed> —

$version

$version : string

Type

string —

$ncbiGiId

$ncbiGiId : string

Type

string —

$keywords

$keywords : array

Type

array<string|int, mixed> —

$source

$source : string

Type

string —

$organism

$organism : string

Type

string —

$taxonomy

$taxonomy : array

Type

array<string|int, mixed> —

$references

$references : \Amelaye\BioPHP\Domain\Parser\Interfaces\EntrezReferenceInterface[]

Type

array<string|int, EntrezReferenceInterface> —

Methods

__construct()

__construct() : mixed

Constructor.

Returns

mixed —

getFormat()

getFormat() : string

The name this format is known by in the collection records and in DatabaseParserFactory.

Returns

string —

isEntryStart()

isEntryStart(string  $sLine) : bool

Tells whether a line opens a new Entrez genome record.

Parameters

string $sLine

The line to analyze

Returns

bool —

isEntryEnd()

isEntryEnd(string  $sLine) : bool

Tells whether a line closes an Entrez genome record.

Parameters

string $sLine

The line to analyze

Returns

bool —

getEntryId()

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

Extracts the identifier uniquely naming an Entrez genome record, which is its first accession number. A record short of an ACCESSION line falls back on its LOCUS name.

Parameters

array $aFlines

The whole file, buffered

string $sLine

The line opening the entry

Returns

string —

parseDataFile()

parseDataFile(array  $aFlines) : \Amelaye\BioPHP\Domain\Sequence\Entity\Sequence

Parses an Entrez genome data file and populates this manager's fields.

Parameters

array $aFlines

The lines the script has to parse

Throws

\Exception

Returns

\Amelaye\BioPHP\Domain\Sequence\Entity\Sequence —

$oSequence

getEntryName()

getEntryName() : string

Returns

string —

getMolType()

getMolType() : string

Returns

string —

getLength()

getLength() : int

Returns

int —

getEntryDate()

getEntryDate() : string

Returns

string —

getDivision()

getDivision() : string

Returns

string —

getTopology()

getTopology() : string

Returns

string —

getStrands()

getStrands() : string

Returns

string —

getDefinition()

getDefinition() : string

Returns

string —

getPrimAcc()

getPrimAcc() : string

Returns

string —

getAccession()

getAccession() : array

Returns

array —

getVersion()

getVersion() : string

Returns

string —

getNcbiGiId()

getNcbiGiId() : string

Returns

string —

getKeywords()

getKeywords() : array

Returns

array —

getSource()

getSource() : string

Returns

string —

getOrganism()

getOrganism() : string

Returns

string —

getTaxonomy()

getTaxonomy() : array

Returns

array —

getReferences()

getReferences() : \Amelaye\BioPHP\Domain\Parser\Interfaces\EntrezReferenceInterface[]

Returns

\Amelaye\BioPHP\Domain\Parser\Interfaces\EntrezReferenceInterface[] —

readLabel()

readLabel(string  $sLine) : string

Reads the label a line carries in its first 12 characters. A continuation line leaves that column blank, which is how a field tells it goes on.

Parameters

string $sLine

The line to analyze

Returns

string —

accumulate()

accumulate(\ArrayIterator  $aLines, array  $aFlines, bool  $bSkipFirstLine = false) : string

Accumulates a field written over several lines : the data of the current line, plus every continuation line below it, joined by a space. Advances $aLines past what it reads.

Parameters

\ArrayIterator $aLines
array $aFlines
bool $bSkipFirstLine

Reads the continuation lines only

Returns

string —

splitList()

splitList(string  $sText) : array

Splits a field listing its values, semicolon separated and closed by a period, into its items. A field holding just the period holds nothing.

Parameters

string $sText

Returns

array —

parseLocus()

parseLocus(string  $sLine) : mixed

Parses the LOCUS line, whose fields sit at fixed columns.

Columns : 13-28 entry name, 30-40 length, 45-47 strands, 48-53 molecule type, 56-63 topology, 65-67 division, 69-79 date.

Parameters

string $sLine

Returns

mixed —

parseVersion()

parseVersion(string  $sLine) : mixed

Parses the VERSION line.

Format : VERSION NC_001416.1 GI:9626243

Parameters

string $sLine

Returns

mixed —

startReference()

startReference(string  $sLine) : \Amelaye\BioPHP\Domain\Parser\Interfaces\EntrezReferenceInterface

Opens the reference a REFERENCE line announces.

Format : REFERENCE 1 (bases 1 to 48502)

Parameters

string $sLine

Returns

\Amelaye\BioPHP\Domain\Parser\Interfaces\EntrezReferenceInterface —

fillReference()

fillReference(string  $sSubkey, \ArrayIterator  $aLines, array  $aFlines) : mixed

Fills one subkey of the reference being read. A subkey met before any REFERENCE line has no reference to belong to and is dropped.

Parameters

string $sSubkey
\ArrayIterator $aLines
array $aFlines

Returns

mixed —

splitAuthors()

splitAuthors(string  $sText) : array

Splits an AUTHORS field into individual names. Names are separated by a comma and a space, the last two by "and" - the comma inside a name itself ("Sanger,F.") carries no space and holds the name together.

Format : Sanger,F., Coulson,A.R., Hong,G.F. and Petersen,G.B.

Parameters

string $sText

Returns

array —