ParsePirManager
in package
implements
ParseDatabaseInterface
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
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
$accessions
private
array<string|int, mixed>
$accessions
= []
$checksum
private
string
$checksum
= ""
$createDate
private
string
$createDate
= ""
$entryName
private
string
$entryName
= ""
$entryType
private
string
$entryType
= ""
$keywords
private
array<string|int, mixed>
$keywords
= []
$length
private
int
$length
= 0
$molwt
private
float
$molwt
= 0.0
$organism
private
string
$organism
= ""
$seqrevDate
private
string
$seqrevDate
= ""
$species
private
string
$species
= ""
$title
private
string
$title
= ""
$txtchgDate
private
string
$txtchgDate
= ""
Methods
__construct()
Constructor.
public
__construct() : mixed
getAccessions()
public
getAccessions() : array<string|int, mixed>
Return values
array<string|int, mixed>getChecksum()
public
getChecksum() : string
Return values
stringgetCreateDate()
public
getCreateDate() : string
Return values
stringgetEntryId()
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
stringgetEntryName()
public
getEntryName() : string
Return values
stringgetEntryType()
public
getEntryType() : string
Return values
stringgetFormat()
The name this format is known by in the collection records and in DatabaseParserFactory.
public
static getFormat() : string
Return values
stringgetKeywords()
public
getKeywords() : array<string|int, mixed>
Return values
array<string|int, mixed>getLength()
public
getLength() : int
Return values
intgetMolwt()
public
getMolwt() : float
Return values
floatgetOrganism()
The common name of the source organism.
public
getOrganism() : string
Return values
stringgetSeqrevDate()
public
getSeqrevDate() : string
Return values
stringgetSpecies()
The scientific name of the source organism.
public
getSpecies() : string
Return values
stringgetTitle()
public
getTitle() : string
Return values
stringgetTxtchgDate()
public
getTxtchgDate() : string
Return values
stringisEntryEnd()
Tells whether a line closes a PIR entry.
public
static isEntryEnd(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolisEntryStart()
Tells whether a line opens a new PIR entry.
public
static isEntryStart(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolparseDataFile()
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
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]]