ParseGenbankManager
extends ParseDbAbstractManager
in package
Class ParseGenbankManager
Tags
Table of Contents
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
- $aLines : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructor.
- getAccession() : array<string|int, mixed>
- getAuthors() : array<string|int, mixed>
- getEntryId() : string
- Extracts the identifier uniquely naming a GenBank entry.
- getFeatures() : array<string|int, mixed>
- getFormat() : string
- The name this format is known by in the collection records and in DatabaseParserFactory.
- 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.
- isEntryEnd() : bool
- Tells whether a line closes a GenBank entry.
- isEntryStart() : bool
- Tells whether a line opens a new GenBank entry.
- 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.
- parseLocationBounds() : array<string|int, mixed>
- Parses an INSDC feature location (shared by GenBank and EMBL) into its outer bounds and strand. Strips the complement()/join() wrappers and the "<"/">" fuzzy-boundary markers.
- buildFeature() : mixed
- Creates Feature object
- parseAccession() : mixed
- Parses ACCESSION field
- parseDefinition() : mixed
- Parses DEFINITION field @ param array $flines
- parseFeatures() : mixed
- Parses each fields for FEATURES
- parseKeywords() : mixed
- Parses KEYWORDS field
- parseLocus() : mixed
- Parses line LOCUS
- parseOrganism() : mixed
- Parses information about organism
- parseReferences() : mixed
- parseVersion() : mixed
- Parses VERSION field
- seekReferences() : string
- Parse every multi-line fields from REFERENCES
Properties
$accession
protected
array<string|int, mixed>
$accession
$authors
protected
array<string|int, mixed>
$authors
$features
protected
array<string|int, mixed>
$features
$gbSequence
protected
GbSequence
$gbSequence
$keywords
protected
array<string|int, mixed>
$keywords
$references
protected
array<string|int, mixed>
$references
$sequence
protected
Sequence
$sequence
$spDatabank
protected
array<string|int, mixed>
$spDatabank
$srcForm
protected
SrcForm
$srcForm
$aLines
private
array<string|int, mixed>
$aLines
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>getEntryId()
Extracts the identifier uniquely naming a GenBank 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
stringgetFeatures()
public
getFeatures() : array<string|int, mixed>
Return values
array<string|int, mixed>getFormat()
The name this format is known by in the collection records and in DatabaseParserFactory.
public
static getFormat() : string
Return values
stringgetGbSequence()
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
isEntryEnd()
Tells whether a line closes a GenBank entry.
public
static isEntryEnd(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolisEntryStart()
Tells whether a line opens a new GenBank entry.
public
static isEntryStart(string $sLine) : bool
Parameters
- $sLine : string
-
The line to analyze
Return values
boolleft()
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
parseLocationBounds()
Parses an INSDC feature location (shared by GenBank and EMBL) into its outer bounds and strand. Strips the complement()/join() wrappers and the "<"/">" fuzzy-boundary markers.
protected
parseLocationBounds(string $sLocation) : array<string|int, mixed>
For a join() of several comma-separated segments (a spliced feature), Feature has no room to keep each exon separately, so this returns the lowest start and the highest end across every segment.
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 the location was wrapped in complement(...), "+" otherwise.
buildFeature()
Creates Feature object
private
buildFeature(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().
parseAccession()
Parses ACCESSION field
private
parseAccession() : mixed
Tags
parseDefinition()
Parses DEFINITION field @ param array $flines
private
parseDefinition(mixed $flines) : mixed
Parameters
- $flines : mixed
Tags
parseFeatures()
Parses each fields for FEATURES
private
parseFeatures(array<string|int, mixed> $aFlines, string $sField) : mixed
Parameters
- $aFlines : array<string|int, mixed>
- $sField : string
Tags
parseKeywords()
Parses KEYWORDS field
private
parseKeywords() : mixed
Tags
parseLocus()
Parses line LOCUS
private
parseLocus() : mixed
Tags
parseOrganism()
Parses information about organism
private
parseOrganism(mixed $flines) : mixed
Parameters
- $flines : mixed
Tags
parseReferences()
private
parseReferences(array<string|int, mixed> $aFlines) : mixed
Parameters
- $aFlines : array<string|int, mixed>
-
The lines the script has to parse
Tags
parseVersion()
Parses VERSION field
private
parseVersion() : mixed
Tags
seekReferences()
Parse every multi-line fields from REFERENCES
private
seekReferences(string &$sReferenceProperty) : string
Parameters
- $sReferenceProperty : string
-
The references part