metacyc
MetacycClient
Bases: SBMLClient
add_props_to_nodes(node_label, node_prop_key, nodes, desc, **kwargs)
Add properties to a list of nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_label |
str
|
Label of the node. |
required |
node_prop_key |
str
|
Property key of the node used to locate the node. |
required |
nodes |
list[dict[str, Any]]
|
Properties to add to the node. |
required |
desc |
str
|
see :meth: |
required |
Source code in db/metacyc.py
get_all_compounds()
Fetch all Compound nodes.
All Compound node with RDF have BioCyc IDs.
Source code in db/metacyc.py
get_all_nodes(label, prop)
Fetch a property of nodes with a certain label.
Source code in db/metacyc.py
merge_nodes(n1_label, n2_label, n1_attr, n2_attr, attr_val)
Merge two nodes with the same attribute value. Note that properties is hard-coded to be
"override", which means all node attributes of n2 will be used to override the
attributes of n1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n1_label |
str
|
The label of the first node. |
required |
n2_label |
str
|
The label of the second node. |
required |
n1_attr |
str
|
The attribute of the first node for filtering. |
required |
n2_attr |
str
|
The attribute of the second node for filtering. |
required |
attr_val |
str
|
The value of the attributes for filtering. |
required |
Source code in db/metacyc.py
metacyc_to_graph(parser)
Enterpoint for setting up the database.
The process is as follows:
. Parse the SBML file. All parsing errors are logged as warnings.
. If db_name is not given, use the metaid attribute of the SBML
file to name the database.
. Create the database and constraints.
. Feed the SBML file into the database. This will populate
Compartment, Reaction, Compound, GeneProduct,
GeneProductSet, GeneProductComplex, and RDF nodes.
. If reactions.dat is given, parse the file and add standard Gibbs
free energy, standard reduction potential, reaction direction,
reaction balance status, systematic name, comment attributes to
Reaction nodes. Also link Reaction nodes to Pathway and
Citation nodes.
#. If pathways.dat is given:
* Add synonyms, types, comments, common names to ``Pathway`` nodes.
* Link ``Pathway`` nodes to super-pathway ``Pathway`` and taxonomy
``Taxa`` nodes.
* Link ``Reaction`` nodes within the pathway with
``isPrecedingEvent`` relationships.
* Link ``Pathway`` nodes with their rate limiting steps
(``Reaction`` nodes).
* Link ``Pathway`` nodes with primary reactant and product
``Compound`` nodes.
* Link ``Pathway`` nodes with other ``Pathway`` nodes and annotate
the shared ``Compound`` nodes.
* For ``Reaction`` nodes, add ``isPrimary[Reactant|Product]InPathway``
labels in their links to ``Compound`` nodes.
. If atom-mappings-smiles.dat is given, parse the file and add
SMILES_ mappings to Reaction nodes.
. If compounds.dat is given, parse the file and add standard Gibbs
free energy, logP, molecular weight, monoisotopic molecular weight,
polar surface area, pKa {1,2,3}, comment, and synonyms to Compound
nodes. Also add SMILES and INCHI strings to related RDF nodes, and
link the Compound nodes to Citation nodes.
. If pubs.dat is given, parse the file and add DOI, PUBMED, MEDLINE IDs,
title, source, year, URL, and REFERENT-FRAME to Citation nodes.
. If classes.dat is given, parse the file and:
- Add common name and synonyms to
Compartmentnodes. - Add common name, strain name, comment, and synonyms to
Taxanodes.
.. _SMILES: https://en.wikipedia.org/wiki/SMILES