ParseSwissprotManager
extends ParseDbAbstractManager
in package
Class ParseSwissprotManager
Tags
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
$accession
protected
array<string|int, mixed>
$accession
$authors
protected
array<string|int, mixed>
$authors
$features
protected
array<string|int, mixed>
$features
$gbSequence
protected
GbSequence
$gbSequence
$keywords
protected
array<string|int, mixed>
$keywords
$references
protected
array<string|int, mixed>
$references
$sequence
protected
Sequence
$sequence
$spDatabank
protected
array<string|int, mixed>
$spDatabank
$srcForm
protected
SrcForm
$srcForm
$aLines
private
array<string|int, mixed>
$aLines
$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
__construct()
Constructor.
public
__construct() : mixed
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
stringgetFeatures()
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
stringgetGbSequence()
public
getGbSequence() : GbSequence
Return values
GbSequencegetGeneNames()
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
intgetNotupdDate()
Date of the last annotation update (DT line).
public
getNotupdDate() : string
Return values
stringgetReferences()
public
getReferences() : array<string|int, mixed>
Return values
array<string|int, mixed>getSequence()
public
getSequence() : Sequence
Return values
SequencegetSequpdDate()
Date of the last sequence update (DT line).
public
getSequpdDate() : string
Return values
stringgetSpDatabank()
public
getSpDatabank() : array<string|int, mixed>
Return values
array<string|int, mixed>getSrcForm()
public
getSrcForm() : SrcForm
Return values
SrcFormintrim()
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
boolisEntryStart()
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
boolleft()
Returns the first $numchars characters of a string.
public
left(string $str, int $numchars) : bool|string
Parameters
- $str : string
- $numchars : int
Return values
bool|stringparseDataFile()
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
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|stringright()
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|stringsetAccession()
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>
setGbSequence()
public
setGbSequence(GbSequence $gbSequence) : void
Parameters
- $gbSequence : GbSequence
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>
setSequence()
public
setSequence(Sequence $sequence) : void
Parameters
- $sequence : Sequence
setSpDatabank()
public
setSpDatabank(array<string|int, mixed> $spDatabank) : void
Parameters
- $spDatabank : array<string|int, mixed>
setSrcForm()
public
setSrcForm(SrcForm $srcForm) : void
Parameters
- $srcForm : SrcForm
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
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
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
buildDTFields()
Parses DT Line Format : DT 21-JUL-1986 (REL. 01, LAST SEQUENCE UPDATE)
private
buildDTFields() : mixed
Tags
buildFTField()
Parses FT lines Format : FT KEY START END COMMENT.
private
buildFTField() : mixed
Tags
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:
- Split expressions by " AND ".
- Test each "token" if in between parentheses or not.
- If not, then token is a singleton, else it's a multiple-ton.
- Singletons are translated into (GNAME1). Multiple-tons are translated into (GNAME1, GNAME 2).
- Push gene name array into larger array. Go to next token.
Tags
buildIDFields()
Parses ID line Format : ID PROTNAME_PROTSOURCE DATA_CLASS; MOL_TYPE; LENGTH AA.
private
buildIDFields() : mixed
Tags
buildKWFields()
Parses KW Fields Format : KW WORD1; WORD2; WORD3; etc .
private
buildKWFields(string &$sKeywords) : mixed
..
Parameters
- $sKeywords : string
Tags
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
buildOSFields()
Parses OS line Format : OS HOMO SAPIENS (HUMAN).
private
buildOSFields(string &$sSource, int &$iSourceCpt) : mixed
Parameters
- $sSource : string
- $iSourceCpt : int
Tags
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
buildSQField()
Parses SQ lines and below SQ SEQUENCE XXXX AA; XXXXX MW; XXXXX CN;
private
buildSQField() : mixed
Tags
makeRefArray()
Creates references array
private
makeRefArray(array<string|int, mixed> $aReferences) : mixed
Parameters
- $aReferences : array<string|int, mixed>