Documentation

ParseSwissprotManager extends ParseDbAbstractManager

FinalYes

Class ParseSwissprotManager

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Properties

$accession  : array<string|int, mixed>
$authors  : array<string|int, mixed>
$features  : array<string|int, mixed>
$gbSequence  : GbSequence
$keywords  : array<string|int, mixed>
$references  : array<string|int, mixed>
$sequence  : Sequence
$spDatabank  : array<string|int, mixed>
$srcForm  : SrcForm
$aLines  : array<string|int, mixed>
$geneNames  : array<string|int, mixed>
Gene names, as groups of synonyms: ( (GNAME1, GNAME2), (GNAME3) ).
$notupdDate  : string
Date of the last annotation update, read from the DT lines.
$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.

Methods

__construct()  : mixed
Constructor.
getAccession()  : array<string|int, mixed>
getAuthors()  : array<string|int, mixed>
getEntryId()  : string
Extracts the identifier uniquely naming a Swiss-Prot entry.
getFeatures()  : array<string|int, mixed>
getFormat()  : string
The name this format is known by in the collection records and in DatabaseParserFactory.
getGbSequence()  : GbSequence
getGeneNames()  : array<string|int, mixed>
Gene names (GN line), as groups of synonyms.
getKeywords()  : array<string|int, mixed>
getmin()  : int
Gets the minimum of three (usually numeric) values $x, $y, and $z.
getNotupdDate()  : string
Date of the last annotation update (DT line).
getReferences()  : array<string|int, mixed>
getSequence()  : Sequence
getSequpdDate()  : string
Date of the last sequence update (DT line).
getSpDatabank()  : array<string|int, mixed>
getSrcForm()  : SrcForm
intrim()  : mixed
Removes "internal spaces" (as opposed to leading and trailing spaces) from a string.
isEntryEnd()  : bool
Tells whether a line closes a Swiss-Prot entry.
isEntryStart()  : bool
Tells whether a line opens a new Swiss-Prot entry.
left()  : bool|string
Returns the first $numchars characters of a string.
parseDataFile()  : Sequence
Parses a Swissprot data file and returns a Seq object containing parsed data.
rem_right()  : bool|string
Removes $charcount characters from the right (end) of a string.
right()  : bool|string
Returns the substring beginning at $numchars characters from the right end of a string.
setAccession()  : void
setAuthors()  : void
setFeatures()  : void
setGbSequence()  : void
setKeywords()  : void
setReferences()  : void
setSequence()  : void
setSpDatabank()  : void
setSrcForm()  : void
trim_element()  : 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.
parseLocationBounds()  : array<string|int, mixed>
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.
buildACFields()  : array<string|int, mixed>
Parses AC line Format : AC P01375;
buildDEFields()  : mixed
Parses DE line Format : DE TUMOR NECROSIS FACTOR PRECURSOR (TNF-ALPHA) (CACHECTIN).
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.
buildDTFields()  : mixed
Parses DT Line Format : DT 21-JUL-1986 (REL. 01, LAST SEQUENCE UPDATE)
buildFTField()  : mixed
Parses FT lines Format : FT KEY START END COMMENT.
buildGNField()  : mixed
Parses GN line - GN is always exactly one line.
buildIDFields()  : mixed
Parses ID line Format : ID PROTNAME_PROTSOURCE DATA_CLASS; MOL_TYPE; LENGTH AA.
buildKWFields()  : mixed
Parses KW Fields Format : KW WORD1; WORD2; WORD3; etc .
buildOCField()  : mixed
Parses OC lines Format : OC EUKARYOTA; METAZOA; CHORDATA; VERTEBRATA; TETRAPODA; MAMMALIA; OC EUTHERIA; PRIMATES.
buildOSFields()  : mixed
Parses OS line Format : OS HOMO SAPIENS (HUMAN).
buildRNField()  : mixed
Parses RN lines - This is a paragraph which contains several lines Example : RN [8] RP X-RAY CRYSTALLOGRAPHY (2.6 ANGSTROMS).
buildSQField()  : mixed
Parses SQ lines and below SQ SEQUENCE XXXX AA; XXXXX MW; XXXXX CN;
makeRefArray()  : mixed
Creates references array

Properties

$geneNames

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

private array<string|int, mixed> $geneNames = []

$notupdDate

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

private string $notupdDate = ""

$sequpdDate

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.

private string $sequpdDate = ""

Methods

getAccession()

public getAccession() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAuthors()

public getAuthors() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEntryId()

Extracts the identifier uniquely naming a Swiss-Prot entry.

public static getEntryId(array<string|int, mixed> $aFlines, string $sLine) : string
Parameters
$aFlines : array<string|int, mixed>

The whole file, buffered

$sLine : string

The line opening the entry

Return values
string

getFeatures()

public getFeatures() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFormat()

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

public static getFormat() : string
Return values
string

getGeneNames()

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

public getGeneNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

getKeywords()

public getKeywords() : array<string|int, mixed>
Return values
array<string|int, mixed>

getmin()

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

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

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

Parameters
$x : int
$y : int
$z : int
Return values
int

getNotupdDate()

Date of the last annotation update (DT line).

public getNotupdDate() : string
Return values
string

getReferences()

public getReferences() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSequpdDate()

Date of the last sequence update (DT line).

public getSequpdDate() : string
Return values
string

getSpDatabank()

public getSpDatabank() : array<string|int, mixed>
Return values
array<string|int, mixed>

intrim()

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

public intrim(string $string) : mixed
Parameters
$string : string

isEntryEnd()

Tells whether a line closes a Swiss-Prot entry.

public static isEntryEnd(string $sLine) : bool
Parameters
$sLine : string

The line to analyze

Return values
bool

isEntryStart()

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

public static isEntryStart(string $sLine) : bool
Parameters
$sLine : string

The line to analyze

Return values
bool

left()

Returns the first $numchars characters of a string.

public left(string $str, int $numchars) : bool|string
Parameters
$str : string
$numchars : int
Return values
bool|string

parseDataFile()

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

public parseDataFile(array<string|int, mixed> $aFlines) : Sequence

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
$aFlines : array<string|int, mixed>
Tags
throws
Exception
Return values
Sequence

$oSequence

rem_right()

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

public rem_right(string $str[, int $charcount = 1 ]) : bool|string
Parameters
$str : string
$charcount : int = 1
Return values
bool|string

right()

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

public right(string $str, int $numchars) : bool|string
Parameters
$str : string
$numchars : int
Return values
bool|string

setAccession()

public setAccession(array<string|int, mixed> $accession) : void
Parameters
$accession : array<string|int, mixed>

setAuthors()

public setAuthors(array<string|int, mixed> $authors) : void
Parameters
$authors : array<string|int, mixed>

setFeatures()

public setFeatures(array<string|int, mixed> $features) : void
Parameters
$features : array<string|int, mixed>

setKeywords()

public setKeywords(array<string|int, mixed> $keywords) : void
Parameters
$keywords : array<string|int, mixed>

setReferences()

public setReferences(array<string|int, mixed> $references) : void
Parameters
$references : array<string|int, mixed>

setSpDatabank()

public setSpDatabank(array<string|int, mixed> $spDatabank) : void
Parameters
$spDatabank : array<string|int, mixed>

trim_element()

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.

public trim_element(mixed &$value, mixed $key) : mixed
Parameters
$value : mixed
$key : mixed

parseLocationBounds()

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.

protected parseLocationBounds(string $sLocation) : array<string|int, mixed>

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
$sLocation : string

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

Return values
array<string|int, mixed>

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

buildACFields()

Parses AC line Format : AC P01375;

private buildACFields(array<string|int, mixed> &$aAccess) : array<string|int, mixed>
Parameters
$aAccess : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

buildDEFields()

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

private buildDEFields(string &$sDescription, int &$iDescCpt) : mixed
Parameters
$sDescription : string
$iDescCpt : int
Tags
throws
Exception

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.

private buildDRField() : mixed

( 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.

Tags
throws
Exception

buildDTFields()

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

private buildDTFields() : mixed
Tags
throws
Exception

buildFTField()

Parses FT lines Format : FT KEY START END COMMENT.

private buildFTField() : mixed
Tags
throws
Exception

buildGNField()

Parses GN line - GN is always exactly one line.

private buildGNField() : mixed

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.
Tags
throws
Exception

buildIDFields()

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

private buildIDFields() : mixed
Tags
throws
Exception

buildKWFields()

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

private buildKWFields(string &$sKeywords) : mixed

..

Parameters
$sKeywords : string
Tags
throws
Exception

buildOCField()

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

private buildOCField(string &$sOrganism, int &$iOrgaCpt) : mixed
Parameters
$sOrganism : string
$iOrgaCpt : int
Tags
throws
Exception

buildOSFields()

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

private buildOSFields(string &$sSource, int &$iSourceCpt) : mixed
Parameters
$sSource : string
$iSourceCpt : int
Tags
throws
Exception

buildRNField()

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

private buildRNField(array<string|int, mixed> $aFlines, array<string|int, mixed> &$aReferences, array<string|int, mixed> &$aAuthors) : mixed

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

Parameters
$aFlines : array<string|int, mixed>
$aReferences : array<string|int, mixed>
$aAuthors : array<string|int, mixed>
Tags
throws
Exception

buildSQField()

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

private buildSQField() : mixed
Tags
throws
Exception

makeRefArray()

Creates references array

private makeRefArray(array<string|int, mixed> $aReferences) : mixed
Parameters
$aReferences : array<string|int, mixed>
Tags
throws
Exception
On this page

Search results