Documentation

ParseEntrezManager implements ParseDatabaseInterface

FinalYes

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 EntrezReference 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.

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Interfaces

ParseDatabaseInterface
Interface ParseDatabaseInterface

Constants

REFERENCE_SUBKEYS  : mixed = ["AUTHORS", "TITLE", "JOURNAL", "MEDLINE", "PUB...
Subkeys of a REFERENCE block, indented under it.

Properties

$accession  : array<string|int, mixed>
$definition  : string
$division  : string
$entryDate  : string
$entryName  : string
$keywords  : array<string|int, mixed>
$length  : int
$molType  : string
$ncbiGiId  : string
$organism  : string
$primAcc  : string
$references  : array<string|int, EntrezReference>
$source  : string
$strands  : string
$taxonomy  : array<string|int, mixed>
$topology  : string
$version  : string

Methods

__construct()  : mixed
Constructor.
getAccession()  : array<string|int, mixed>
getDefinition()  : string
getDivision()  : string
getEntryDate()  : string
getEntryId()  : 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.
getEntryName()  : string
getFormat()  : string
The name this format is known by in the collection records and in DatabaseParserFactory.
getKeywords()  : array<string|int, mixed>
getLength()  : int
getMolType()  : string
getNcbiGiId()  : string
getOrganism()  : string
getPrimAcc()  : string
getReferences()  : array<string|int, EntrezReference>
getSource()  : string
getStrands()  : string
getTaxonomy()  : array<string|int, mixed>
getTopology()  : string
getVersion()  : string
isEntryEnd()  : bool
Tells whether a line closes an Entrez genome record.
isEntryStart()  : bool
Tells whether a line opens a new Entrez genome record.
parseDataFile()  : Sequence
Parses an Entrez genome data file and populates this manager's fields.
accumulate()  : 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.
fillReference()  : 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.
parseLocus()  : mixed
Parses the LOCUS line, whose fields sit at fixed columns.
parseVersion()  : mixed
Parses the VERSION line.
readLabel()  : 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.
splitAuthors()  : array<string|int, mixed>
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.
splitList()  : array<string|int, mixed>
Splits a field listing its values, semicolon separated and closed by a period, into its items. A field holding just the period holds nothing.
startReference()  : EntrezReference
Opens the reference a REFERENCE line announces.

Constants

REFERENCE_SUBKEYS

Subkeys of a REFERENCE block, indented under it.

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

Properties

Methods

getAccession()

public getAccession() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEntryId()

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.

public static getEntryId(array<string|int, mixed> $aFlines, string $sLine) : string
Parameters
$aFlines : array<string|int, mixed>

The whole file, buffered

$sLine : string

The line opening the entry

Return values
string

getFormat()

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

public static getFormat() : string
Return values
string

getKeywords()

public getKeywords() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTaxonomy()

public getTaxonomy() : array<string|int, mixed>
Return values
array<string|int, mixed>

isEntryEnd()

Tells whether a line closes an Entrez genome record.

public static isEntryEnd(string $sLine) : bool
Parameters
$sLine : string

The line to analyze

Return values
bool

isEntryStart()

Tells whether a line opens a new Entrez genome record.

public static isEntryStart(string $sLine) : bool
Parameters
$sLine : string

The line to analyze

Return values
bool

parseDataFile()

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

public parseDataFile(array<string|int, mixed> $aFlines) : Sequence
Parameters
$aFlines : array<string|int, mixed>

The lines the script has to parse

Tags
throws
Exception
Return values
Sequence

$oSequence

accumulate()

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.

private accumulate(ArrayIterator $aLines, array<string|int, mixed> $aFlines[, bool $bSkipFirstLine = false ]) : string
Parameters
$aLines : ArrayIterator
$aFlines : array<string|int, mixed>
$bSkipFirstLine : bool = false

Reads the continuation lines only

Return values
string

fillReference()

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

private fillReference(string $sSubkey, ArrayIterator $aLines, array<string|int, mixed> $aFlines) : mixed
Parameters
$sSubkey : string
$aLines : ArrayIterator
$aFlines : array<string|int, mixed>

parseLocus()

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

private parseLocus(string $sLine) : mixed

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

parseVersion()

Parses the VERSION line.

private parseVersion(string $sLine) : mixed

Format : VERSION NC_001416.1 GI:9626243

Parameters
$sLine : string

readLabel()

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.

private static readLabel(string $sLine) : string
Parameters
$sLine : string

The line to analyze

Return values
string

splitAuthors()

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.

private splitAuthors(string $sText) : array<string|int, mixed>

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

Parameters
$sText : string
Return values
array<string|int, mixed>

splitList()

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

private splitList(string $sText) : array<string|int, mixed>
Parameters
$sText : string
Return values
array<string|int, mixed>
On this page

Search results