Documentation

ParsePrfManager implements ParseDatabaseInterface

FinalYes

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
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

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

Methods

getAuthors()

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

getCommonName()

public getCommonName() : string
Return values
string

getCrossRefs()

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

getEntryId()

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
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 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
bool

isEntryStart()

Tells whether a line opens a new PRF entry.

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

The line to analyze

Return values
bool

parseDataFile()

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
throws
Exception
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
string

splitAuthors()

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

Return values
array<string|int, mixed>
On this page

Search results