\Amelaye\BioPHP\Domain\Database\ServiceDatabaseManager

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
left()
right()
intrim()
getmin()
rem_right()
trim_element()
__construct()
fetch()
recording()
No public properties found
No constants found
No protected methods found
$em
N/A
atEntrystart()
getEntryid()
line2r()
No private properties found
N/A

Properties

$em

$em : \Doctrine\ORM\EntityManager

Type

\Doctrine\ORM\EntityManager

Methods

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( $value,  $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

$value
$key

Returns

mixed

__construct()

__construct(\Doctrine\ORM\EntityManagerInterface  $em) : mixed

DatabaseManager constructor.

Parameters

\Doctrine\ORM\EntityManagerInterface $em

Entity Manager, for Doctrine

Returns

mixed

fetch()

fetch(string  $sSeqId, mixed  $sDataPath) : \Amelaye\BioPHP\Domain\Database\Service\ParseSwissprotManager

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.

mixed $sDataPath

The path to the data file.

Throws

\Exception

Returns

\Amelaye\BioPHP\Domain\Database\Service\ParseSwissprotManager —

| ParseGenbankManager | bool

recording()

recording() : 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

Throws

\Exception

Returns

mixed

atEntrystart()

atEntrystart(string  $linestr, string  $dbformat) : bool

Tests if the file pointer is at the start of a new sequence entry.

Parameters

string $linestr

The line to analyze

string $dbformat

Original DB format (Swissprot, Genbank)

Throws

\Exception

Returns

bool

getEntryid()

getEntryid(array  $flines, string  $linestr, string  $dbformat) : string

Gets the primary accession number of the sequence entry which we are currently processing. This uniquely identifies a sequence entry.

Parameters

array $flines

Buffed file as array

string $linestr

Current line

string $dbformat

Original DB format (Swissprot, Genbank)

Throws

\Exception

Returns

string

line2r()

line2r( $fpseq) : array|bool

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

Parameters

$fpseq

Throws

\Exception

Returns

array|bool