ParsePrfManager
in package
implements
ParseDatabaseInterface
Class ParsePrfManager A PRF entry describes a published protein. Its layout is a twelve character label column, a blank label meaning the line continues the one above, and indented sub-keys qualifying the field they follow. This class exposes plain scalars rather than the Sequence/Feature entities of ParseDbAbstractManager. The SOURCE, KEYWORD, CROSSREF and SEQUENCE fields, which the original BioPHP parser declared without ever filling, are read here.
Tags
Table of Contents
Interfaces
- ParseDatabaseInterface
- Interface ParseDatabaseInterface
Constants
- LABEL_WIDTH : mixed = 12
- Width of the label column, the data starting right after it.
Properties
- $authors : array<string|int, mixed>
- $comment : string
- $commonName : string
- $crossRefs : array<string|int, mixed>
- $entryCode : string
- $entryName : string
- $journal : string
- $keywords : array<string|int, mixed>
- $sequence : string
- $source : string
- $taxonomy : array<string|int, mixed>
- $title : string
Methods
- __construct() : mixed
- Constructor.
- getAuthors() : array<string|int, mixed>
- getComment() : string
- getCommonName() : string
- getCrossRefs() : array<string|int, mixed>
- getEntryCode() : string
- getEntryId() : string
- Extracts the identifier uniquely naming a PRF entry.
- getEntryName() : string
- getFormat() : string
- The name this format is known by in the collection records and in DatabaseParserFactory.
- getJournal() : string
- getKeywords() : array<string|int, mixed>
- getSequence() : string
- getSource() : string
- getTaxonomy() : array<string|int, mixed>
- getTitle() : string
- isEntryEnd() : bool
- Tells whether a line closes a PRF entry. PRF uses a triple slash, where the GenBank family uses a double one.
- isEntryStart() : bool
- Tells whether a line opens a new PRF entry.
- parseDataFile() : Sequence
- Parses a PRF data file and populates this manager's fields.
- parseCrossRefs() : void
- Cross-references are semicolon separated "DATABASE=IDENTIFIER" pairs. The same database may appear more than once, so they are returned as a list rather than keyed by name.
- separatorFor() : string
- What joins a field to its continuation line. Keywords are separated by a run of at least two spaces, and the line break itself separates them too : joining those lines with a single space would weld the last keyword of one line to the first of the next.
- splitAuthors() : array<string|int, mixed>
- Authors are written "Surname,Initial., Surname,Initial." : the separator is the period closing the initial, which has to be put back on each name.
- splitKeywords() : array<string|int, mixed>
- Keywords sit on one line each, separated by a run of at least two spaces.
- splitTaxonomy() : array<string|int, mixed>
- The taxonomy is a semicolon separated lineage, which may span several lines.
Constants
LABEL_WIDTH
Width of the label column, the data starting right after it.
private
mixed
LABEL_WIDTH
= 12
Properties
$authors
private
array<string|int, mixed>
$authors
= []
$comment
private
string
$comment
= ""
$commonName
private
string
$commonName
= ""
$crossRefs
private
array<string|int, mixed>
$crossRefs
= []
$entryCode
private
string
$entryCode
= ""
$entryName
private
string
$entryName
= ""
$journal
private
string
$journal
= ""
$keywords
private
array<string|int, mixed>
$keywords
= []
$sequence
private
string
$sequence
= ""
$source
private
string
$source
= ""
$taxonomy
private
array<string|int, mixed>
$taxonomy
= []
$title
private
string
$title
= ""
Methods
__construct()
Constructor.
public
__construct() : mixed
getAuthors()
public
getAuthors() : array<string|int, mixed>
Return values
array<string|int, mixed>getComment()
public
getComment() : string
Return values
stringgetCommonName()
public
getCommonName() : string
Return values
stringgetCrossRefs()
public
getCrossRefs() : array<string|int, mixed>
Return values
array<string|int, mixed>getEntryCode()
public
getEntryCode() : string
Return values
stringgetEntryId()
Extracts the identifier uniquely naming a PRF entry.
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
stringgetJournal()
public
getJournal() : string
Return values
stringgetKeywords()
public
getKeywords() : array<string|int, mixed>
Return values
array<string|int, mixed>getSequence()
public
getSequence() : string
Return values
stringgetSource()
public
getSource() : string
Return values
stringgetTaxonomy()
public
getTaxonomy() : array<string|int, mixed>
Return values
array<string|int, mixed>getTitle()
public
getTitle() : string
Return values
stringisEntryEnd()
Tells whether a line closes a PRF entry. PRF uses a triple slash, where the GenBank family uses a double one.
public
static isEntryEnd(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolisEntryStart()
Tells whether a line opens a new PRF entry.
public
static isEntryStart(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolparseDataFile()
Parses a PRF 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
parseCrossRefs()
Cross-references are semicolon separated "DATABASE=IDENTIFIER" pairs. The same database may appear more than once, so they are returned as a list rather than keyed by name.
private
parseCrossRefs(string $sData) : void
Example: CROSSREF PIR=ICHU2;PIR=ICGI2
Parameters
- $sData : string
-
The CROSSREF line, label stripped
separatorFor()
What joins a field to its continuation line. Keywords are separated by a run of at least two spaces, and the line break itself separates them too : joining those lines with a single space would weld the last keyword of one line to the first of the next.
private
static separatorFor(string $sField) : string
Parameters
- $sField : string
-
The field being accumulated
Return values
stringsplitAuthors()
Authors are written "Surname,Initial., Surname,Initial." : the separator is the period closing the initial, which has to be put back on each name.
private
splitAuthors(string $sAuthors) : array<string|int, mixed>
Parameters
- $sAuthors : string
-
The accumulated AUTHOR lines
Return values
array<string|int, mixed>splitKeywords()
Keywords sit on one line each, separated by a run of at least two spaces.
private
splitKeywords(string $sKeywords) : array<string|int, mixed>
Parameters
- $sKeywords : string
-
The accumulated KEYWORD lines
Return values
array<string|int, mixed>splitTaxonomy()
The taxonomy is a semicolon separated lineage, which may span several lines.
private
splitTaxonomy(string $sTaxonomy) : array<string|int, mixed>
Parameters
- $sTaxonomy : string
-
The accumulated taxon lines