\Amelaye\BioPHP\Domain\Parser\Service ParsePmdManager

Class ParsePmdManager A PMD entry describes a mutation reported in the literature, not a sequence, so this class exposes plain scalars rather than the Sequence/Feature entities of ParseDbAbstractManager.

The CHANGE, DISEASE and DBREF fields are left aside : their layout was never settled, and the original BioPHP parser declared them without ever filling them.

Summary

Methods
Properties
Constants
__construct
getFormat
isEntryStart
isEntryEnd
getEntryId
parseDataFile
getEntryType
getEntryNo
getMutationType
getArticleNo
getAuthors
getMedlineNo
getJournal
getTitle
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
parseEntry
splitAuthors
entryType
entryNo
mutationType
articleNo
authors
medlineNo
journal
title
LABEL_WIDTH

Constant

LABEL_WIDTH

LABEL_WIDTH = 16

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

Properties

$entryType

$entryType : string

Type

string —

$entryNo

$entryNo : string

Type

string —

$mutationType

$mutationType : string

Type

string —

$articleNo

$articleNo : string

Type

string —

$authors

$authors : array

Type

array<string|int, mixed> —

$medlineNo

$medlineNo : string

Type

string —

$journal

$journal : string

Type

string —

$title

$title : 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 PMD entry.

Parameters

string $sLine

The line to analyze

Returns

bool —

isEntryEnd()

isEntryEnd(string  $sLine) : bool

Tells whether a line closes a PMD entry. PMD 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 PMD entry, which is the entry type followed by its number.

Example: ENTRY A000300 - Artificial 2607383

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

getEntryType()

getEntryType() : string

Returns

string —

getEntryNo()

getEntryNo() : string

Returns

string —

getMutationType()

getMutationType() : string

Returns

string —

getArticleNo()

getArticleNo() : string

Returns

string —

getAuthors()

getAuthors() : array

Returns

array —

getMedlineNo()

getMedlineNo() : string

Returns

string —

getJournal()

getJournal() : string

Returns

string —

getTitle()

getTitle() : string

Returns

string —

parseEntry()

parseEntry(string  $sData) : void

Reads the ENTRY line. The entry type is its first character and the entry number the six that follow, both at fixed positions.

Parameters

string $sData

The ENTRY line, label stripped

Returns

void —

splitAuthors()

splitAuthors(string  $sAuthors) : array

Authors are written as a list separated by commas and closed by an ampersand.

Parameters

string $sAuthors

The accumulated AUTHORS lines

Returns

array —