ParseEntrezManager
in package
implements
ParseDatabaseInterface
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
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
$accession
private
array<string|int, mixed>
$accession
= []
$definition
private
string
$definition
= ""
$division
private
string
$division
= ""
$entryDate
private
string
$entryDate
= ""
$entryName
private
string
$entryName
= ""
$keywords
private
array<string|int, mixed>
$keywords
= []
$length
private
int
$length
= 0
$molType
private
string
$molType
= ""
$ncbiGiId
private
string
$ncbiGiId
= ""
$organism
private
string
$organism
= ""
$primAcc
private
string
$primAcc
= ""
$references
private
array<string|int, EntrezReference>
$references
= []
$source
private
string
$source
= ""
$strands
private
string
$strands
= ""
$taxonomy
private
array<string|int, mixed>
$taxonomy
= []
$topology
private
string
$topology
= ""
$version
private
string
$version
= ""
Methods
__construct()
Constructor.
public
__construct() : mixed
getAccession()
public
getAccession() : array<string|int, mixed>
Return values
array<string|int, mixed>getDefinition()
public
getDefinition() : string
Return values
stringgetDivision()
public
getDivision() : string
Return values
stringgetEntryDate()
public
getEntryDate() : string
Return values
stringgetEntryId()
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
stringgetEntryName()
public
getEntryName() : string
Return values
stringgetFormat()
The name this format is known by in the collection records and in DatabaseParserFactory.
public
static getFormat() : string
Return values
stringgetKeywords()
public
getKeywords() : array<string|int, mixed>
Return values
array<string|int, mixed>getLength()
public
getLength() : int
Return values
intgetMolType()
public
getMolType() : string
Return values
stringgetNcbiGiId()
public
getNcbiGiId() : string
Return values
stringgetOrganism()
public
getOrganism() : string
Return values
stringgetPrimAcc()
public
getPrimAcc() : string
Return values
stringgetReferences()
public
getReferences() : array<string|int, EntrezReference>
Return values
array<string|int, EntrezReference>getSource()
public
getSource() : string
Return values
stringgetStrands()
public
getStrands() : string
Return values
stringgetTaxonomy()
public
getTaxonomy() : array<string|int, mixed>
Return values
array<string|int, mixed>getTopology()
public
getTopology() : string
Return values
stringgetVersion()
public
getVersion() : string
Return values
stringisEntryEnd()
Tells whether a line closes an Entrez genome record.
public
static isEntryEnd(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolisEntryStart()
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
boolparseDataFile()
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
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
stringfillReference()
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
stringsplitAuthors()
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>startReference()
Opens the reference a REFERENCE line announces.
private
startReference(string $sLine) : EntrezReference
Format : REFERENCE 1 (bases 1 to 48502)
Parameters
- $sLine : string