Documentation

ParseDbAbstractManager implements ParseDatabaseInterface uses FormatsTrait

AbstractYes

Class ParseDbAbstractManager

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

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

Methods

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>

getKeywords()

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
int

getReferences()

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

getSpDatabank()

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

intrim()

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

parseDataFile()

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
throws
Exception
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|string

right()

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

setAccession()

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>

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>

setSpDatabank()

public setSpDatabank(array<string|int, mixed> $spDatabank) : void
Parameters
$spDatabank : array<string|int, mixed>

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
throws
Exception

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.

On this page

Search results