Documentation

ParseGenbankManager extends ParseDbAbstractManager

FinalYes

Class ParseGenbankManager

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

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

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>

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
string

getFeatures()

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
string

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

isEntryEnd()

Tells whether a line closes a GenBank entry.

public static isEntryEnd(string $sLine) : bool
Parameters
$sLine : string

The line to analyze

Return values
bool

isEntryStart()

Tells whether a line opens a new GenBank entry.

public static isEntryStart(string $sLine) : bool
Parameters
$sLine : string

The line to analyze

Return values
bool

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

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

parseDefinition()

Parses DEFINITION field @ param array $flines

private parseDefinition(mixed $flines) : mixed
Parameters
$flines : mixed
Tags
throws
Exception

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

parseKeywords()

Parses KEYWORDS field

private parseKeywords() : mixed
Tags
throws
Exception

parseOrganism()

Parses information about organism

private parseOrganism(mixed $flines) : mixed
Parameters
$flines : mixed
Tags
throws
Exception

parseReferences()

private parseReferences(array<string|int, mixed> $aFlines) : mixed
Parameters
$aFlines : array<string|int, mixed>

The lines the script has to parse

Tags
throws
Exception

parseVersion()

Parses VERSION field

private parseVersion() : mixed
Tags
throws
Exception

seekReferences()

Parse every multi-line fields from REFERENCES

private seekReferences(string &$sReferenceProperty) : string
Parameters
$sReferenceProperty : string

The references part

Tags
throws
Exception
Return values
string
On this page

Search results