Properties

$accession

$accession : array

Type

array<string|int, mixed> —

$sequence

$sequence : \Amelaye\BioPHP\Domain\Sequence\Entity\Sequence

Type

Sequence

$authors

$authors : array

Type

array<string|int, mixed> —

$features

$features : array

Type

array<string|int, mixed> —

$keywords

$keywords : array

Type

array<string|int, mixed> —

$references

$references : array

Type

array<string|int, mixed> —

$srcForm

$srcForm : \Amelaye\BioPHP\Domain\Sequence\Entity\SrcForm

Type

SrcForm

$gbSequence

$gbSequence : \Amelaye\BioPHP\Domain\Sequence\Entity\GbSequence

Type

GbSequence

$spDatabank

$spDatabank : array

Type

array<string|int, mixed> —

$aLines

$aLines : array

Type

array<string|int, mixed> —

$sequpdDate

$sequpdDate : string

Date of the last sequence update, read from the DT lines. The Sequence entity only carries the creation date, so the two other DT dates stay on the parser.

Type

string —

$notupdDate

$notupdDate : string

Date of the last annotation update, read from the DT lines.

Type

string —

$geneNames

$geneNames : array

Gene names, as groups of synonyms: ( (GNAME1, GNAME2), (GNAME3) ).

Type

array<string|int, mixed> —

Methods

getFormat()

getFormat() : string

The name this format is known by in the collection records and in DatabaseParserFactory.

Returns

string —

isEntryStart()

isEntryStart(string  $sLine) : bool

Tells whether a line opens a new Swiss-Prot entry.

Parameters

string $sLine

The line to analyze

Returns

bool —

isEntryEnd()

isEntryEnd(string  $sLine) : bool

Tells whether a line closes a Swiss-Prot entry.

Parameters

string $sLine

The line to analyze

Returns

bool —

getEntryId()

getEntryId(array  $aFlines, string  $sLine) : string

Extracts the identifier uniquely naming a Swiss-Prot entry.

Parameters

array $aFlines

The whole file, buffered

string $sLine

The line opening the entry

Returns

string —

parseDataFile()

parseDataFile(array  $aFlines) : \Amelaye\BioPHP\Domain\Sequence\Entity\Sequence

Parses a GenBank data file and returns a Seq object containing parsed data.

Parameters

array $aFlines

The lines the script has to parse

Throws

\Exception

Returns

\Amelaye\BioPHP\Domain\Sequence\Entity\Sequence —

$oSequence

getSequpdDate()

getSequpdDate() : string

Date of the last sequence update (DT line).

Returns

string —

getNotupdDate()

getNotupdDate() : string

Date of the last annotation update (DT line).

Returns

string —

getGeneNames()

getGeneNames() : array

Gene names (GN line), as groups of synonyms.

Returns

array —

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 —

__construct()

__construct() : mixed

Constructor.

Returns

mixed —

getAccession()

getAccession() : array

Returns

array —

getSequence()

getSequence() : \Amelaye\BioPHP\Domain\Sequence\Entity\Sequence

Returns

\Amelaye\BioPHP\Domain\Sequence\Entity\Sequence —

getAuthors()

getAuthors() : array

Returns

array —

getGbSequence()

getGbSequence() : \Amelaye\BioPHP\Domain\Sequence\Entity\GbSequence

Returns

\Amelaye\BioPHP\Domain\Sequence\Entity\GbSequence —

getFeatures()

getFeatures() : array

Returns

array —

getKeywords()

getKeywords() : array

Returns

array —

getReferences()

getReferences() : array

Returns

array —

getSrcForm()

getSrcForm() : \Amelaye\BioPHP\Domain\Sequence\Entity\SrcForm

Returns

\Amelaye\BioPHP\Domain\Sequence\Entity\SrcForm —

getSpDatabank()

getSpDatabank() : array

Returns

array —

setAccession()

setAccession(array  $accession) : void

Parameters

array $accession

Returns

void —

setSequence()

setSequence(\Amelaye\BioPHP\Domain\Sequence\Entity\Sequence  $sequence) : void

Parameters

\Amelaye\BioPHP\Domain\Sequence\Entity\Sequence $sequence

Returns

void —

setAuthors()

setAuthors(array  $authors) : void

Parameters

array $authors

Returns

void —

setFeatures()

setFeatures(array  $features) : void

Parameters

array $features

Returns

void —

setKeywords()

setKeywords(array  $keywords) : void

Parameters

array $keywords

Returns

void —

setReferences()

setReferences(array  $references) : void

Parameters

array $references

Returns

void —

setSrcForm()

setSrcForm(\Amelaye\BioPHP\Domain\Sequence\Entity\SrcForm  $srcForm) : void

Parameters

\Amelaye\BioPHP\Domain\Sequence\Entity\SrcForm $srcForm

Returns

void —

setGbSequence()

setGbSequence(\Amelaye\BioPHP\Domain\Sequence\Entity\GbSequence  $gbSequence) : void

Parameters

\Amelaye\BioPHP\Domain\Sequence\Entity\GbSequence $gbSequence

Returns

void —

setSpDatabank()

setSpDatabank(array  $spDatabank) : void

Parameters

array $spDatabank

Returns

void —

parseLocationBounds()

parseLocationBounds(string  $sLocation) : array

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.

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

string $sLocation

The raw location text, e.g. "complement(join(<1..10,50..>60))".

Returns

array —

[$iFrom, $iTo, $sStrand] - $sStrand is "-" when the location was wrapped in complement(...), "+" otherwise.

buildIDFields()

buildIDFields() : mixed

Parses ID line Format : ID PROTNAME_PROTSOURCE DATA_CLASS; MOL_TYPE; LENGTH AA.

Throws

\Exception

Returns

mixed —

buildACFields()

buildACFields(array  $aAccess) : array

Parses AC line Format : AC P01375;

Parameters

array $aAccess

Throws

\Exception

Returns

array —

buildDTFields()

buildDTFields() : mixed

Parses DT Line Format : DT 21-JUL-1986 (REL. 01, LAST SEQUENCE UPDATE)

Throws

\Exception

Returns

mixed —

buildDEFields()

buildDEFields(string  $sDescription, int  $iDescCpt) : mixed

Parses DE line Format : DE TUMOR NECROSIS FACTOR PRECURSOR (TNF-ALPHA) (CACHECTIN).

Parameters

string $sDescription
int $iDescCpt

Throws

\Exception

Returns

mixed —

buildKWFields()

buildKWFields(string  $sKeywords) : mixed

Parses KW Fields Format : KW WORD1; WORD2; WORD3; etc .

..

Parameters

string $sKeywords

Throws

\Exception

Returns

mixed —

buildOSFields()

buildOSFields(string  $sSource, int  $iSourceCpt) : mixed

Parses OS line Format : OS HOMO SAPIENS (HUMAN).

Parameters

string $sSource
int $iSourceCpt

Throws

\Exception

Returns

mixed —

buildOCField()

buildOCField(string  $sOrganism, int  $iOrgaCpt) : mixed

Parses OC lines Format : OC EUKARYOTA; METAZOA; CHORDATA; VERTEBRATA; TETRAPODA; MAMMALIA; OC EUTHERIA; PRIMATES.

Parameters

string $sOrganism
int $iOrgaCpt

Throws

\Exception

Returns

mixed —

buildFTField()

buildFTField() : mixed

Parses FT lines Format : FT KEY START END COMMENT.

Throws

\Exception

Returns

mixed —

buildDRField()

buildDRField() : mixed

Parses DR lines Format : DR DATA_BANK_IDENTIFIER; PRIMARY_IDENTIFIER; SECONDARY_IDENTIFIER We assume that all three data items are mandatory/present in all DR entries.

( refno => ( (dbname1, pid1, sid1), (dbname2, pid2, sid2), ... ), 1 => ( ... ) ) ( 0 => ( (REBASE, pid1, sid1), (WORPEP, pid2, sid2), ... ), 1 => ( ... ) ) ( rn => ( "rp" => "my rp", "rc" => ("tok1" => "value", ...) ) ) ( 10 => ( "RP" => "my rp", "RC" => ("PLASMID" => "PLA_VAL", ... ) ) ) Example: DR AARHUS/GHENT-2DPAGE; 8006; IEF.

Throws

\Exception

Returns

mixed —

buildRNField()

buildRNField(array  $aFlines, array  $aReferences, array  $aAuthors) : mixed

Parses RN lines - This is a paragraph which contains several lines Example : RN [8] RP X-RAY CRYSTALLOGRAPHY (2.6 ANGSTROMS).

RX MEDLINE; 90008932. RA ECK M.J., SPRANG S.R.; RL J. BIOL. CHEM. 264:17595-17605(1989).

Parameters

array $aFlines
array $aReferences
array $aAuthors

Throws

\Exception

Returns

mixed —

buildGNField()

buildGNField() : mixed

Parses GN line - GN is always exactly one line.

GNAME1 OR GNAME2 ( (GNAME1, GNAME2) ) GNAME1 AND GNAME2 ( (GNAME1), (GNAME2) ) GNAME1 AND (GNAME2 OR GNAME3) ( (GNAME1), (GNAME2, GNAME3) ) GNAME1 OR (GNAME2 AND GNAME3) NOT POSSIBLE!!! ALGORITHM:

  1. Split expressions by " AND ".
  2. Test each "token" if in between parentheses or not.
  3. If not, then token is a singleton, else it's a multiple-ton.
  4. Singletons are translated into (GNAME1). Multiple-tons are translated into (GNAME1, GNAME 2).
  5. Push gene name array into larger array. Go to next token.

Throws

\Exception

Returns

mixed —

buildSQField()

buildSQField() : mixed

Parses SQ lines and below SQ SEQUENCE XXXX AA; XXXXX MW; XXXXX CN;

Throws

\Exception

Returns

mixed —

makeRefArray()

makeRefArray(array  $aReferences) : mixed

Creates references array

Parameters

array $aReferences

Throws

\Exception

Returns

mixed —