\Amelaye\BioPHP\Domain\Parser\Service ParsePirManager

Class ParsePirManager A PIR entry qualifies most of its fields with "#key value" pairs, a pattern this class reads once and reuses everywhere. It exposes plain scalars rather than the Sequence/Feature entities of ParseDbAbstractManager.

Summary

Methods
Properties
Constants
__construct
getFormat
isEntryStart
isEntryEnd
getEntryId
parseDataFile
getEntryName
getEntryType
getTitle
getAccessions
getOrganism
getSpecies
getCreateDate
getSeqrevDate
getTxtchgDate
getLength
getMolwt
getChecksum
getKeywords
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
splitQualifiers
readEntry
readOrganism
readDates
readSummary
splitList
entryName
entryType
title
accessions
organism
species
createDate
seqrevDate
txtchgDate
length
molwt
checksum
keywords
LABEL_WIDTH

Constant

LABEL_WIDTH

LABEL_WIDTH = 16

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

Properties

$entryName

$entryName : string

Type

string —

$entryType

$entryType : string

Type

string —

$title

$title : string

Type

string —

$accessions

$accessions : array

Type

array<string|int, mixed> —

$organism

$organism : string

Type

string —

$species

$species : string

Type

string —

$createDate

$createDate : string

Type

string —

$seqrevDate

$seqrevDate : string

Type

string —

$txtchgDate

$txtchgDate : string

Type

string —

$length

$length : int

Type

int —

$molwt

$molwt : float

Type

float —

$checksum

$checksum : string

Type

string —

$keywords

$keywords : array

Type

array<string|int, mixed> —

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 PIR entry.

Parameters

string $sLine

The line to analyze

Returns

bool —

isEntryEnd()

isEntryEnd(string  $sLine) : bool

Tells whether a line closes a PIR entry.

Parameters

string $sLine

The line to analyze

Returns

bool —

getEntryId()

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

Extracts the identifier uniquely naming a PIR entry, which is the entry name preceding the qualifiers.

Example: ENTRY RHTDTO #type complete

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

getEntryName()

getEntryName() : string

Returns

string —

getEntryType()

getEntryType() : string

Returns

string —

getTitle()

getTitle() : string

Returns

string —

getAccessions()

getAccessions() : array

Returns

array —

getOrganism()

getOrganism() : string

The common name of the source organism.

Returns

string —

getSpecies()

getSpecies() : string

The scientific name of the source organism.

Returns

string —

getCreateDate()

getCreateDate() : string

Returns

string —

getSeqrevDate()

getSeqrevDate() : string

Returns

string —

getTxtchgDate()

getTxtchgDate() : string

Returns

string —

getLength()

getLength() : int

Returns

int —

getMolwt()

getMolwt() : float

Returns

float —

getChecksum()

getChecksum() : string

Returns

string —

getKeywords()

getKeywords() : array

Returns

array —

splitQualifiers()

splitQualifiers(string  $sData) : array

Splits a "value #key1 val1 #key2 val2" string into its leading value and its qualifiers.

Parameters

string $sData

The field content

Returns

array —

[leading value, [key => value]]

readEntry()

readEntry(string  $sData) : void

Example: ENTRY RHTDTO #type complete

Parameters

string $sData

The accumulated ENTRY lines

Returns

void —

readOrganism()

readOrganism(string  $sData) : void

Example: ORGANISM #formal_name Oryctolagus cuniculus #common_name domestic rabbit

Parameters

string $sData

The accumulated ORGANISM lines

Returns

void —

readDates()

readDates(string  $sData) : void

Example: DATE 15-Jun-2001 #sequence_revision 15-Jun-2001 #text_change 15-Jun-2001

Parameters

string $sData

The accumulated DATE lines

Returns

void —

readSummary()

readSummary(string  $sData) : void

Example: SUMMARY #length 3 #molecular-weight 380 #checksum 465

Parameters

string $sData

The accumulated SUMMARY lines

Returns

void —

splitList()

splitList(string  $sData) : array

Accessions and keywords are semicolon separated lists which may run over several lines.

Parameters

string $sData

The accumulated lines

Returns

array —