ParseDbAbstractManager
in package
implements
ParseDatabaseInterface
uses
FormatsTrait
Class ParseDbAbstractManager
Tags
Table of Contents
Interfaces
- ParseDatabaseInterface
- Interface ParseDatabaseInterface
Properties
- $accession : array<string|int, mixed>
- $authors : array<string|int, mixed>
- $features : array<string|int, mixed>
- $gbSequence : GbSequence
- $keywords : array<string|int, mixed>
- $references : array<string|int, mixed>
- $sequence : Sequence
- $spDatabank : array<string|int, mixed>
- $srcForm : SrcForm
Methods
- __construct() : mixed
- Constructor.
- getAccession() : array<string|int, mixed>
- getAuthors() : array<string|int, mixed>
- getFeatures() : array<string|int, mixed>
- getGbSequence() : GbSequence
- getKeywords() : array<string|int, mixed>
- getmin() : int
- Gets the minimum of three (usually numeric) values $x, $y, and $z.
- getReferences() : array<string|int, mixed>
- getSequence() : Sequence
- getSpDatabank() : array<string|int, mixed>
- getSrcForm() : SrcForm
- intrim() : mixed
- Removes "internal spaces" (as opposed to leading and trailing spaces) from a string.
- left() : bool|string
- Returns the first $numchars characters of a string.
- parseDataFile() : Sequence
- Parses a GenBank data file and returns a Seq object containing parsed data.
- rem_right() : bool|string
- Removes $charcount characters from the right (end) of a string.
- right() : bool|string
- Returns the substring beginning at $numchars characters from the right end of a string.
- setAccession() : void
- setAuthors() : void
- setFeatures() : void
- setGbSequence() : void
- setKeywords() : void
- setReferences() : void
- setSequence() : void
- setSpDatabank() : void
- setSrcForm() : void
- trim_element() : mixed
- trim_element() removes leading and trailing spaces from a string. In conjunction with the array_walk() function, it removes spaces from each element of an array.
- parseInsdcFeature() : mixed
- Parses one feature of an INSDC feature table, shared by GenBank and EMBL, whose columns are the same : the key from column 6, the location (possibly wrapped over several lines) and the /qualifier lines from column 22. $aFlines is read ahead to find where the feature ends : a line holding something in its first 12 columns starts another feature or section, so EMBL hands its lines with their "FT" tag blanked out.
- parseLocationBounds() : array<string|int, mixed>
- Parses an INSDC feature location (shared by GenBank and EMBL) into its outer bounds and strand, 1-based and inclusive. The location as written is kept apart (Feature::getFtLocation()) : these bounds only frame it.
- buildInsdcFeature() : mixed
- Creates Feature object
Properties
$accession
protected
array<string|int, mixed>
$accession
= null
$authors
protected
array<string|int, mixed>
$authors
= null
$features
protected
array<string|int, mixed>
$features
= null
$gbSequence
protected
GbSequence
$gbSequence
= null
$keywords
protected
array<string|int, mixed>
$keywords
= null
$references
protected
array<string|int, mixed>
$references
= null
$sequence
protected
Sequence
$sequence
= null
$spDatabank
protected
array<string|int, mixed>
$spDatabank
= null
$srcForm
protected
SrcForm
$srcForm
= null
Methods
__construct()
Constructor.
public
__construct() : mixed
getAccession()
public
getAccession() : array<string|int, mixed>
Return values
array<string|int, mixed>getAuthors()
public
getAuthors() : array<string|int, mixed>
Return values
array<string|int, mixed>getFeatures()
public
getFeatures() : array<string|int, mixed>
Return values
array<string|int, mixed>getGbSequence()
public
getGbSequence() : GbSequence
Return values
GbSequencegetKeywords()
public
getKeywords() : array<string|int, mixed>
Return values
array<string|int, mixed>getmin()
Gets the minimum of three (usually numeric) values $x, $y, and $z.
public
getmin(int $x, int $y, int $z) : int
For now, this can't handle situations when one or more arguments is FALSE.
Parameters
- $x : int
- $y : int
- $z : int
Return values
intgetReferences()
public
getReferences() : array<string|int, mixed>
Return values
array<string|int, mixed>getSequence()
public
getSequence() : Sequence
Return values
SequencegetSpDatabank()
public
getSpDatabank() : array<string|int, mixed>
Return values
array<string|int, mixed>getSrcForm()
public
getSrcForm() : SrcForm
Return values
SrcFormintrim()
Removes "internal spaces" (as opposed to leading and trailing spaces) from a string.
public
intrim(string $string) : mixed
Parameters
- $string : string
left()
Returns the first $numchars characters of a string.
public
left(string $str, int $numchars) : bool|string
Parameters
- $str : string
- $numchars : int
Return values
bool|stringparseDataFile()
Parses a GenBank data file and returns a Seq object containing parsed data.
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
rem_right()
Removes $charcount characters from the right (end) of a string.
public
rem_right(string $str[, int $charcount = 1 ]) : bool|string
Parameters
- $str : string
- $charcount : int = 1
Return values
bool|stringright()
Returns the substring beginning at $numchars characters from the right end of a string.
public
right(string $str, int $numchars) : bool|string
Parameters
- $str : string
- $numchars : int
Return values
bool|stringsetAccession()
public
setAccession(array<string|int, mixed> $accession) : void
Parameters
- $accession : array<string|int, mixed>
setAuthors()
public
setAuthors(array<string|int, mixed> $authors) : void
Parameters
- $authors : array<string|int, mixed>
setFeatures()
public
setFeatures(array<string|int, mixed> $features) : void
Parameters
- $features : array<string|int, mixed>
setGbSequence()
public
setGbSequence(GbSequence $gbSequence) : void
Parameters
- $gbSequence : GbSequence
setKeywords()
public
setKeywords(array<string|int, mixed> $keywords) : void
Parameters
- $keywords : array<string|int, mixed>
setReferences()
public
setReferences(array<string|int, mixed> $references) : void
Parameters
- $references : array<string|int, mixed>
setSequence()
public
setSequence(Sequence $sequence) : void
Parameters
- $sequence : Sequence
setSpDatabank()
public
setSpDatabank(array<string|int, mixed> $spDatabank) : void
Parameters
- $spDatabank : array<string|int, mixed>
setSrcForm()
public
setSrcForm(SrcForm $srcForm) : void
Parameters
- $srcForm : SrcForm
trim_element()
trim_element() removes leading and trailing spaces from a string. In conjunction with the array_walk() function, it removes spaces from each element of an array.
public
trim_element(mixed &$value, mixed $key) : mixed
Parameters
- $value : mixed
- $key : mixed
parseInsdcFeature()
Parses one feature of an INSDC feature table, shared by GenBank and EMBL, whose columns are the same : the key from column 6, the location (possibly wrapped over several lines) and the /qualifier lines from column 22. $aFlines is read ahead to find where the feature ends : a line holding something in its first 12 columns starts another feature or section, so EMBL hands its lines with their "FT" tag blanked out.
protected
parseInsdcFeature(ArrayIterator $oLines, array<string|int, mixed> $aFlines, string $sKey) : mixed
Parameters
- $oLines : ArrayIterator
-
The parser's line iterator, on the feature's key line
- $aFlines : array<string|int, mixed>
-
The lines, as read ahead
- $sKey : string
-
The feature key
Tags
parseLocationBounds()
Parses an INSDC feature location (shared by GenBank and EMBL) into its outer bounds and strand, 1-based and inclusive. The location as written is kept apart (Feature::getFtLocation()) : these bounds only frame it.
protected
parseLocationBounds(string $sLocation) : array<string|int, mixed>
- complement(), join() and order() wrappers and the "<" / ">" partial marks are stripped ;
- "a..b" spans a to b, "a" is one base, "a.b" one base somewhere in a..b and "a^b" the site between two bases : both give a..b ;
- a segment of another entry ("J00194.1:100..202") lies on another sequence and is left out ; a location made of such segments only has no bounds here (null, null) ;
- the segments of a join() are listed in the order they are transcribed. When the record is circular, all of them lie on the same strand and that order goes back past the origin (join(4900..5000,1..100), or join(complement(1..100),complement(4900..5000)) on the other strand), that order goes back exactly once, from the last base of the molecule to the first, and the join is not an order(), the bounds are from = 4900, to = 100 : from > to, the origin-crossing convention of PlasmidFeature, as for a single segment written "4900..100". Otherwise - a linear record, an order(), a trans-spliced gene (plant organelle nad1, rps12) whose segments are listed out of order - they are the lowest start and the highest end.
Parameters
- $sLocation : string
-
The raw location text, e.g. "complement(join(<1..10,50..>60))".
Return values
array<string|int, mixed> —[$iFrom, $iTo, $sStrand] - $sStrand is "-" when every segment of this entry is complemented, "+" when none is, null when the location lies on both strands (a trans-spliced join(complement(a..b),c..d)).
buildInsdcFeature()
Creates Feature object
private
buildInsdcFeature(string $sLine, string $sKey, array<string|int, mixed> $aBounds) : mixed
Parameters
- $sLine : string
- $sKey : string
- $aBounds : array<string|int, mixed>
-
[$iFtFrom, $iFtTo, $sStrand], as returned by parseLocationBounds(), followed by the location as written.