\Amelaye\BioPHP\Domain\Database\Service DatabaseManager

This class does many things like create and/or read a collection of database's index files, initialize certain SeqDB properties, etc.

Syntax: $seqdb = new seqdb($dbname, $dbformat, $file1, $file2, ...); Behavior: if $dbname exists and user gave no specific values for $file1, $file2, ... then seqdb() object USES/OPENS existing database (index files). if $dbname exists and user gave specific values for $file1, $file2, ... then seqdb() object OVERWRITES existing database (index files). if $dbname does not exist, then seqdb() object CREATES new database. even if $file1, $file2, ... are not specified. We provide the create() method to explicitly create a new database. We provide the use() or open() method to explicitly use an existing database.

Summary

Methods
Properties
Constants
__construct
fetch
recording
left
right
intrim
getmin
rem_right
trim_element
No public properties found
No public constants found
No protected methods found
em
sPath
No protected constants found
line2r
No private properties found
No private constants found

Properties

$em

$em : \Doctrine\ORM\EntityManager

Type

EntityManager —

$sPath

$sPath : string

Type

string —

Methods

__construct()

__construct(\Doctrine\ORM\EntityManagerInterface  $em, string  $sPath) : mixed

DatabaseManager constructor.

Parameters

\Doctrine\ORM\EntityManagerInterface $em

Entity Manager, for Doctrine

string $sPath

Path to the data

Returns

mixed —

fetch()

fetch(string  $sSeqId) : \Amelaye\BioPHP\Domain\Database\Service\ParseSwissprotManager|\Amelaye\BioPHP\Domain\Database\Service\ParseGenbankManager|\Amelaye\BioPHP\Domain\Database\Service\ParseEmblManager|bool

Retrieves all data from the specified sequence record and returns them in the form of a Seq object. This method invokes one of several parser methods.

Parameters

string $sSeqId

The id of the seq obj.

Throws

\Exception

Returns

\Amelaye\BioPHP\Domain\Database\Service\ParseSwissprotManager|\Amelaye\BioPHP\Domain\Database\Service\ParseGenbankManager|\Amelaye\BioPHP\Domain\Database\Service\ParseEmblManager|bool —

recording()

recording(string  $sDbName, string  $sDbFormat = "GENBANK", mixed  ...$sDataFile) : mixed

Records the new elements of a collection, reads a collection db exists fileX args ACTION Y Y create Y N use N Y create N N create

Parameters

string $sDbName

Name of the database

string $sDbFormat

Format of the database

mixed $sDataFile variadic

Files to parse

Throws

\Exception

Returns

mixed —

left()

left(string  $str, int  $numchars) : bool|string

Returns the first $numchars characters of a string.

Parameters

string $str
int $numchars

Returns

bool|string —

right()

right(string  $str, int  $numchars) : bool|string

Returns the substring beginning at $numchars characters from the right end of a string.

Parameters

string $str
int $numchars

Returns

bool|string —

intrim()

intrim(string  $string) : mixed

Removes "internal spaces" (as opposed to leading and trailing spaces) from a string.

Parameters

string $string

Returns

mixed —

getmin()

getmin(int  $x, int  $y, int  $z) : int

Gets the minimum of three (usually numeric) values $x, $y, and $z.

For now, this can't handle situations when one or more arguments is FALSE.

Parameters

int $x
int $y
int $z

Returns

int —

rem_right()

rem_right(string  $str, int  $charcount = 1) : bool|string

Removes $charcount characters from the right (end) of a string.

Parameters

string $str
int $charcount

Returns

bool|string —

trim_element()

trim_element(mixed  $value, mixed  $key) : 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.

Parameters

mixed $value
mixed $key

Returns

mixed —

line2r()

line2r(mixed  $fpseq, mixed  $sDbFormat, mixed  $iLineNo = 0) : array|bool

Copies the lines belonging to a single sequence entry into an array.

Parameters

mixed $fpseq
mixed $sDbFormat
mixed $iLineNo

Throws

\Exception

Returns

array|bool —