\Amelaye\BioPHP\Domain\Parser\Service ParsePrfManager

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.

Summary

Methods
Properties
Constants
__construct
getFormat
isEntryStart
isEntryEnd
getEntryId
parseDataFile
getEntryCode
getEntryName
getSource
getCommonName
getTaxonomy
getJournal
getAuthors
getTitle
getKeywords
getComment
getCrossRefs
getSequence
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
separatorFor
splitAuthors
splitKeywords
splitTaxonomy
parseCrossRefs
entryCode
entryName
source
commonName
taxonomy
journal
authors
title
keywords
comment
crossRefs
sequence
LABEL_WIDTH

Constant

LABEL_WIDTH

LABEL_WIDTH = 12

Width of the label column, the data starting right after it.

Properties

$entryCode

$entryCode : string

Type

string —

$entryName

$entryName : string

Type

string —

$source

$source : string

Type

string —

$commonName

$commonName : string

Type

string —

$taxonomy

$taxonomy : array

Type

array<string|int, mixed> —

$journal

$journal : string

Type

string —

$authors

$authors : array

Type

array<string|int, mixed> —

$title

$title : string

Type

string —

$keywords

$keywords : array

Type

array<string|int, mixed> —

$comment

$comment : string

Type

string —

$crossRefs

$crossRefs : array

Type

array<string|int, mixed> —

$sequence

$sequence : string

Type

string —

Methods

__construct()

__construct() : mixed

Constructor.

Returns

mixed —

getFormat()

getFormat() : string

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

Returns

string —

isEntryStart()

isEntryStart(string  $sLine) : bool

Tells whether a line opens a new PRF entry.

Parameters

string $sLine

The line to analyze

Returns

bool —

isEntryEnd()

isEntryEnd(string  $sLine) : bool

Tells whether a line closes a PRF entry. PRF uses a triple slash, where the GenBank family uses a double one.

Parameters

string $sLine

The line to analyze

Returns

bool —

getEntryId()

getEntryId(array  $aFlines, string  $sLine) : string

Extracts the identifier uniquely naming a PRF entry.

Parameters

array $aFlines

The whole file, buffered

string $sLine

The line opening the entry

Returns

string —

parseDataFile()

parseDataFile(array  $aFlines) : \Amelaye\BioPHP\Domain\Sequence\Entity\Sequence

Parses a PRF data file and populates this manager's fields.

Parameters

array $aFlines

The lines the script has to parse

Throws

\Exception

Returns

\Amelaye\BioPHP\Domain\Sequence\Entity\Sequence —

$oSequence

getEntryCode()

getEntryCode() : string

Returns

string —

getEntryName()

getEntryName() : string

Returns

string —

getSource()

getSource() : string

Returns

string —

getCommonName()

getCommonName() : string

Returns

string —

getTaxonomy()

getTaxonomy() : array

Returns

array —

getJournal()

getJournal() : string

Returns

string —

getAuthors()

getAuthors() : array

Returns

array —

getTitle()

getTitle() : string

Returns

string —

getKeywords()

getKeywords() : array

Returns

array —

getComment()

getComment() : string

Returns

string —

getCrossRefs()

getCrossRefs() : array

Returns

array —

getSequence()

getSequence() : string

Returns

string —

separatorFor()

separatorFor(string  $sField) : 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.

Parameters

string $sField

The field being accumulated

Returns

string —

splitAuthors()

splitAuthors(string  $sAuthors) : array

Authors are written "Surname,Initial., Surname,Initial." : the separator is the period closing the initial, which has to be put back on each name.

Parameters

string $sAuthors

The accumulated AUTHOR lines

Returns

array —

splitKeywords()

splitKeywords(string  $sKeywords) : array

Keywords sit on one line each, separated by a run of at least two spaces.

Parameters

string $sKeywords

The accumulated KEYWORD lines

Returns

array —

splitTaxonomy()

splitTaxonomy(string  $sTaxonomy) : array

The taxonomy is a semicolon separated lineage, which may span several lines.

Parameters

string $sTaxonomy

The accumulated taxon lines

Returns

array —

parseCrossRefs()

parseCrossRefs(string  $sData) : 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.

Example: CROSSREF PIR=ICHU2;PIR=ICGI2

Parameters

string $sData

The CROSSREF line, label stripped

Returns

void —