\AppBundle\Service\IODatabaseManager

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, integer  $numchars) : boolean|string

Returns the first $numchars characters of a string.

Parameters

string $str
integer $numchars

Returns

boolean|string

right()

right(string  $str, integer  $numchars) : boolean|string

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

Parameters

string $str
integer $numchars

Returns

boolean|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(integer  $x, integer  $y, integer  $z) : integer

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

integer $x
integer $y
integer $z

Returns

integer

rem_right()

rem_right(string  $str, integer  $charcount = 1) : boolean|string

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

Parameters

string $str
integer $charcount

Returns

boolean|string

trim_element()

trim_element(  $value,   $key) 

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

__construct()

__construct(\Doctrine\ORM\EntityManagerInterface  $em) 

DatabaseManager constructor.

Parameters

\Doctrine\ORM\EntityManagerInterface $em

Entity Manager, for Doctrine

fetch()

fetch(string  $sSeqId) : \AppBundle\Service\IO\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.

Throws

\Exception

Returns

\AppBundle\Service\IO\ParseSwissprotManager

| ParseGenbankManager | bool

recording()

recording() 

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

atEntrystart()

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

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

boolean

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

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

Parameters

$fpseq

Throws

\Exception

Returns

array|boolean