Documentation

ParsePirManager implements ParseDatabaseInterface

FinalYes

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.

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Interfaces

ParseDatabaseInterface
Interface ParseDatabaseInterface

Constants

LABEL_WIDTH  : mixed = 16
Width of the label column, the data starting right after it.

Properties

$accessions  : array<string|int, mixed>
$checksum  : string
$createDate  : string
$entryName  : string
$entryType  : string
$keywords  : array<string|int, mixed>
$length  : int
$molwt  : float
$organism  : string
$seqrevDate  : string
$species  : string
$title  : string
$txtchgDate  : string

Methods

__construct()  : mixed
Constructor.
getAccessions()  : array<string|int, mixed>
getChecksum()  : string
getCreateDate()  : string
getEntryId()  : string
Extracts the identifier uniquely naming a PIR entry, which is the entry name preceding the qualifiers.
getEntryName()  : string
getEntryType()  : string
getFormat()  : string
The name this format is known by in the collection records and in DatabaseParserFactory.
getKeywords()  : array<string|int, mixed>
getLength()  : int
getMolwt()  : float
getOrganism()  : string
The common name of the source organism.
getSeqrevDate()  : string
getSpecies()  : string
The scientific name of the source organism.
getTitle()  : string
getTxtchgDate()  : string
isEntryEnd()  : bool
Tells whether a line closes a PIR entry.
isEntryStart()  : bool
Tells whether a line opens a new PIR entry.
parseDataFile()  : Sequence
Parses a PIR data file and populates this manager's fields.
readDates()  : void
Example: DATE 15-Jun-2001 #sequence_revision 15-Jun-2001 #text_change 15-Jun-2001
readEntry()  : void
Example: ENTRY RHTDTO #type complete
readOrganism()  : void
Example: ORGANISM #formal_name Oryctolagus cuniculus #common_name domestic rabbit
readSummary()  : void
Example: SUMMARY #length 3 #molecular-weight 380 #checksum 465
splitList()  : array<string|int, mixed>
Accessions and keywords are semicolon separated lists which may run over several lines.
splitQualifiers()  : array<string|int, mixed>
Splits a "value #key1 val1 #key2 val2" string into its leading value and its qualifiers.

Constants

LABEL_WIDTH

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

private mixed LABEL_WIDTH = 16

Properties

Methods

getAccessions()

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

getCreateDate()

public getCreateDate() : string
Return values
string

getEntryId()

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

public static getEntryId(array<string|int, mixed> $aFlines, string $sLine) : string

Example: ENTRY RHTDTO #type complete

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>

getOrganism()

The common name of the source organism.

public getOrganism() : string
Return values
string

getSeqrevDate()

public getSeqrevDate() : string
Return values
string

getSpecies()

The scientific name of the source organism.

public getSpecies() : string
Return values
string

getTxtchgDate()

public getTxtchgDate() : string
Return values
string

isEntryEnd()

Tells whether a line closes a PIR entry.

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

The line to analyze

Return values
bool

isEntryStart()

Tells whether a line opens a new PIR entry.

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

The line to analyze

Return values
bool

parseDataFile()

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

readDates()

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

private readDates(string $sData) : void
Parameters
$sData : string

The accumulated DATE lines

readEntry()

Example: ENTRY RHTDTO #type complete

private readEntry(string $sData) : void
Parameters
$sData : string

The accumulated ENTRY lines

readOrganism()

Example: ORGANISM #formal_name Oryctolagus cuniculus #common_name domestic rabbit

private readOrganism(string $sData) : void
Parameters
$sData : string

The accumulated ORGANISM lines

readSummary()

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

private readSummary(string $sData) : void
Parameters
$sData : string

The accumulated SUMMARY lines

splitList()

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

private splitList(string $sData) : array<string|int, mixed>
Parameters
$sData : string

The accumulated lines

Return values
array<string|int, mixed>

splitQualifiers()

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

private static splitQualifiers(string $sData) : array<string|int, mixed>
Parameters
$sData : string

The field content

Return values
array<string|int, mixed>

[leading value, [key => value]]

On this page

Search results