DatabaseParserFactory
in package
AbstractYes
The single place that knows which parsers exist. Everything a format implies - its name, how an entry starts, how its identifier reads, how it is parsed - lives in the parser itself, so supporting a new format means writing one class and adding one line below.
Class DatabaseParserFactory
Tags
Table of Contents
Constants
- PARSERS : mixed = [\Amelaye\BioPHP\Domain\Parser\ParseGenbankMana...
- Every parser the library ships with.
Methods
- createParser() : ParseDatabaseInterface
- Builds a fresh parser for a format. A parser holds the state of the record it has read, so each call returns its own instance.
- getFormats() : array<string|int, mixed>
- The format names accepted by the library, in registration order.
- getParserClass() : string
- Resolves a format name to the class handling it.
Constants
PARSERS
Every parser the library ships with.
private
mixed
PARSERS
= [\Amelaye\BioPHP\Domain\Parser\ParseGenbankManager::class, \Amelaye\BioPHP\Domain\Parser\ParseSwissprotManager::class, \Amelaye\BioPHP\Domain\Parser\ParseEmblManager::class, \Amelaye\BioPHP\Domain\Parser\ParsePdbManager::class, \Amelaye\BioPHP\Domain\Parser\ParsePrositeManager::class, \Amelaye\BioPHP\Domain\Parser\ParseExpasyEnzymeManager::class, \Amelaye\BioPHP\Domain\Parser\ParsePdbstrManager::class, \Amelaye\BioPHP\Domain\Parser\ParseUnigeneManager::class, \Amelaye\BioPHP\Domain\Parser\ParsePrintsManager::class, \Amelaye\BioPHP\Domain\Parser\ParseBlocksManager::class, \Amelaye\BioPHP\Domain\Parser\ParseAaindexManager::class, \Amelaye\BioPHP\Domain\Parser\ParseProdomManager::class, \Amelaye\BioPHP\Domain\Parser\ParseNcbiLitManager::class, \Amelaye\BioPHP\Domain\Parser\ParsePmdManager::class, \Amelaye\BioPHP\Domain\Parser\ParseHgbaseManager::class, \Amelaye\BioPHP\Domain\Parser\ParsePrfManager::class, \Amelaye\BioPHP\Domain\Parser\ParsePirManager::class, \Amelaye\BioPHP\Domain\Parser\ParseEpdManager::class, \Amelaye\BioPHP\Domain\Parser\ParseGenomeManager::class, \Amelaye\BioPHP\Domain\Parser\ParseEntrezManager::class, \Amelaye\BioPHP\Domain\Parser\ParseTransfacMatrixManager::class, \Amelaye\BioPHP\Domain\Parser\ParseTransfacGeneManager::class, \Amelaye\BioPHP\Domain\Parser\ParseTransfacClassManager::class, \Amelaye\BioPHP\Domain\Parser\ParseTransfacCellManager::class, \Amelaye\BioPHP\Domain\Parser\ParseTransfacFactorManager::class, \Amelaye\BioPHP\Domain\Parser\ParseTransfacSiteManager::class, \Amelaye\BioPHP\Domain\Parser\ParseKeggCompoundManager::class, \Amelaye\BioPHP\Domain\Parser\ParseKeggReactionManager::class, \Amelaye\BioPHP\Domain\Parser\ParseKeggEnzymeManager::class, \Amelaye\BioPHP\Domain\Parser\ParseKeggOrthologManager::class, \Amelaye\BioPHP\Domain\Parser\ParseKeggGenomeManager::class]
Methods
createParser()
Builds a fresh parser for a format. A parser holds the state of the record it has read, so each call returns its own instance.
public
static createParser(string $sFormat) : ParseDatabaseInterface
Parameters
- $sFormat : string
-
Database format, e.g. "GENBANK"
Tags
Return values
ParseDatabaseInterfacegetFormats()
The format names accepted by the library, in registration order.
public
static getFormats() : array<string|int, mixed>
Return values
array<string|int, mixed>getParserClass()
Resolves a format name to the class handling it.
public
static getParserClass(string $sFormat) : string
Parameters
- $sFormat : string
-
Database format, e.g. "GENBANK"
Tags
Return values
string —Fully qualified name of the parser class