Properties

$accession

$accession : array

Type

array

$authors

$authors : array

Type

array

$features

$features : array

Type

array

$keywords

$keywords : array

Type

array

$references

$references : array

Type

array

$spDatabank

$spDatabank : array

Type

array

$aLines

$aLines : array

Type

array

Methods

__construct()

__construct() 

Constructor.

getAccession()

getAccession() : array

Returns

array

getAuthors()

getAuthors() : array

Returns

array

getFeatures()

getFeatures() : array

Returns

array

getKeywords()

getKeywords() : array

Returns

array

getReferences()

getReferences() : array

Returns

array

getSpDatabank()

getSpDatabank() : array

Returns

array

setAccession()

setAccession(array  $accession) 

Parameters

array $accession

setAuthors()

setAuthors(array  $authors) 

Parameters

array $authors

setFeatures()

setFeatures(array  $features) 

Parameters

array $features

setKeywords()

setKeywords(array  $keywords) 

Parameters

array $keywords

setReferences()

setReferences(array  $references) 

Parameters

array $references

setSpDatabank()

setSpDatabank(array  $spDatabank) 

Parameters

array $spDatabank

parseDataFile()

parseDataFile(array  $aFlines) : \AppBundle\Service\IO\Sequence

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

Parses the Feature Table lines (those that begin with FT) in a Swissprot data file, extracts the feature key name, from endpoint, to endpoint, and description, and stores them in a (simple) array.

Parameters

array $aFlines

The lines the script has to parse

Throws

\Exception

Returns

\AppBundle\Service\IO\Sequence —

$oSequence

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

buildIDFields()

buildIDFields() 

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

Throws

\Exception

buildACFields()

buildACFields(array  $aAccess) : array

Parses AC line Format : AC P01375;

Parameters

array $aAccess

Throws

\Exception

Returns

array

buildDTFields()

buildDTFields() 

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

Throws

\Exception

buildDEFields()

buildDEFields(string  $sDescription, integer  $iDescCpt) 

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

Parameters

string $sDescription
integer $iDescCpt

Throws

\Exception

buildKWFields()

buildKWFields(string  $sKeywords) 

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

..

Parameters

string $sKeywords

Throws

\Exception

buildOSFields()

buildOSFields(string  $sSource, integer  $iSourceCpt) 

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

Parameters

string $sSource
integer $iSourceCpt

Throws

\Exception

buildOCField()

buildOCField(string  $sOrganism, integer  $iOrgaCpt) 

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

Parameters

string $sOrganism
integer $iOrgaCpt

Throws

\Exception

buildFTField()

buildFTField() 

Parses FT lines Format : FT KEY START END COMMENT.

Throws

\Exception

buildDRField()

buildDRField() 

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

buildRNField()

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

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

buildGNField()

buildGNField(  $aGename) 

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.

Parameters

$aGename

Throws

\Exception

buildSQField()

buildSQField() 

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

Throws

\Exception

makeRefArray()

makeRefArray(array  $aReferences) 

Creates references array

Parameters

array $aReferences

Throws

\Exception