ParseHgbaseManager
in package
implements
ParseDatabaseInterface
Class ParseHgbaseManager An HGBase entry describes a human mutation and the population it was observed in, not a sequence, so this class exposes plain scalars rather than the Sequence/Feature entities of ParseDbAbstractManager. Its lines are a label, a tab, then the data.
Tags
Table of Contents
Interfaces
- ParseDatabaseInterface
- Interface ParseDatabaseInterface
Properties
- $allele : string
- $citation : string
- $freqIndiv : int
- $freqPerc : float
- $haplotypeId : string
- $isInBlock : string
- $popIndiv : int
- $popName : string
- $populationId : string
- $sourceComment : string
- $sourceId : string
- $submissionId : string
- $submitterName : string
Methods
- __construct() : mixed
- Constructor.
- getAllele() : string
- getCitation() : string
- getEntryId() : string
- Extracts the identifier uniquely naming an HGBase entry.
- getFormat() : string
- The name this format is known by in the collection records and in DatabaseParserFactory.
- getFreqIndiv() : int
- getFreqPerc() : float
- getHaplotypeId() : string
- getIsInBlock() : string
- getPopIndiv() : int
- getPopName() : string
- getPopulationId() : string
- getSourceComment() : string
- getSourceId() : string
- getSubmissionId() : string
- getSubmitterName() : string
- isEntryEnd() : bool
- Tells whether a line closes an HGBase entry.
- isEntryStart() : bool
- Tells whether a line opens a new HGBase entry.
- parseDataFile() : Sequence
- Parses an HGBase data file and populates this manager's fields.
- parseFrequency() : void
- Reads a FREQUENCY line, which gives a percentage then the population it was measured on.
- parsePopulation() : void
- Reads a POPULATION line, which names the population then counts its individuals.
- parseSubmitter() : void
- Reads a SUBMITTER line, which names the submitter then gives the submission identifier.
- readData() : string
- Everything a line carries after its label.
- readLabel() : string
- The label opening a line, upper cased. Labels are separated from their data by a tab or a run of spaces.
Properties
$allele
private
string
$allele
= ""
$citation
private
string
$citation
= ""
$freqIndiv
private
int
$freqIndiv
= 0
$freqPerc
private
float
$freqPerc
= 0.0
$haplotypeId
private
string
$haplotypeId
= ""
$isInBlock
private
string
$isInBlock
= ""
$popIndiv
private
int
$popIndiv
= 0
$popName
private
string
$popName
= ""
$populationId
private
string
$populationId
= ""
$sourceComment
private
string
$sourceComment
= ""
$sourceId
private
string
$sourceId
= ""
$submissionId
private
string
$submissionId
= ""
$submitterName
private
string
$submitterName
= ""
Methods
__construct()
Constructor.
public
__construct() : mixed
getAllele()
public
getAllele() : string
Return values
stringgetCitation()
public
getCitation() : string
Return values
stringgetEntryId()
Extracts the identifier uniquely naming an HGBase entry.
public
static getEntryId(array<string|int, mixed> $aFlines, string $sLine) : string
Parameters
- $aFlines : array<string|int, mixed>
-
The whole file, buffered
- $sLine : string
-
The line opening the entry
Return values
stringgetFormat()
The name this format is known by in the collection records and in DatabaseParserFactory.
public
static getFormat() : string
Return values
stringgetFreqIndiv()
public
getFreqIndiv() : int
Return values
intgetFreqPerc()
public
getFreqPerc() : float
Return values
floatgetHaplotypeId()
public
getHaplotypeId() : string
Return values
stringgetIsInBlock()
public
getIsInBlock() : string
Return values
stringgetPopIndiv()
public
getPopIndiv() : int
Return values
intgetPopName()
public
getPopName() : string
Return values
stringgetPopulationId()
public
getPopulationId() : string
Return values
stringgetSourceComment()
public
getSourceComment() : string
Return values
stringgetSourceId()
public
getSourceId() : string
Return values
stringgetSubmissionId()
public
getSubmissionId() : string
Return values
stringgetSubmitterName()
public
getSubmitterName() : string
Return values
stringisEntryEnd()
Tells whether a line closes an HGBase entry.
public
static isEntryEnd(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolisEntryStart()
Tells whether a line opens a new HGBase entry.
public
static isEntryStart(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolparseDataFile()
Parses an HGBase data file and populates this manager's fields.
public
parseDataFile(array<string|int, mixed> $aFlines) : Sequence
The label is matched whole rather than by its first characters : POPULATION is a prefix of POPULATIONID, and the original BioPHP parser read a POPULATIONID line as both.
Parameters
- $aFlines : array<string|int, mixed>
-
The lines the script has to parse
Tags
Return values
Sequence —$oSequence
parseFrequency()
Reads a FREQUENCY line, which gives a percentage then the population it was measured on.
private
parseFrequency(string $sData) : void
Example: 2% (1039 individuals)
Parameters
- $sData : string
-
The line, label stripped
parsePopulation()
Reads a POPULATION line, which names the population then counts its individuals.
private
parsePopulation(string $sData) : void
Example: Caucasian (USA) (216 individuals)
Parameters
- $sData : string
-
The line, label stripped
parseSubmitter()
Reads a SUBMITTER line, which names the submitter then gives the submission identifier.
private
parseSubmitter(string $sData) : void
Example: Jan. W. Koper (SUB0001234)
Parameters
- $sData : string
-
The line, label stripped
readData()
Everything a line carries after its label.
private
static readData(string $sLine) : string
Parameters
- $sLine : string
-
The line to analyze
Return values
stringreadLabel()
The label opening a line, upper cased. Labels are separated from their data by a tab or a run of spaces.
private
static readLabel(string $sLine) : string
Parameters
- $sLine : string
-
The line to analyze