<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Transfer of Knowledge Through Ontological Relationships
Author
Step1:  Environment
Step2:  Dependencies
Step3:  Example Graph
This notebook uses a small example related to statins and their target, HMG-CoA_reductase. While it is not exhaustively importing relationships using Bio2BEL ExPASy and Bio2BEL ChEBI, it still provides an atomic example on how in- and out-edges can be inferred through hierarchies.
Step4:  Propogation on Chemical Hierarchy
The first transformation made is to assert that all things true for EC 1.1.1.34/EC 1.1.88 inhibitors are also true for their descendants. There are two relationships showing decrease in the activities of the corresponding enzyme nodes that will be asserted for its two children, statin and mevinolinic acid, as well as recursively for their descendants.
Step5:  Propogation on Protein Hierarchy
While EC 1.1.1.34 has several proteins across many species annotated in ExPASy, HMGCR is normalized to its HGNC nomenclature and used as the only example in this graph. Since HMGCR is an EC 1.1.1.34, all of the relationships with this enzyme node are transferred below.
<ASSISTANT_TASK:>
Python Code:
import time
import sys
import random
from pybel.utils import get_version
from pybel.struct.mutation import infer_child_relations
from pybel_tools.visualization import *
from pybel.examples.statin_example import statin_graph, hmgcr_inhibitor, hmgcr, ec_11134
Explanation: Transfer of Knowledge Through Ontological Relationships
Author: Charles Tapley Hoyt
Estimated Run Time: 5 seconds
This notebook shows how ontological relationships, such as chemical families and enzyme classes, can be used to make inferences in knowledge assemblies using the infer_child_relations mutations function.
Imports
End of explanation
print(time.asctime())
print(sys.version)
# Set seed for visualization
random.seed(127)
Explanation: Environment
End of explanation
print(get_version())
Explanation: Dependencies
End of explanation
to_jupyter(statin_graph)
Explanation: Example Graph
This notebook uses a small example related to statins and their target, HMG-CoA_reductase. While it is not exhaustively importing relationships using Bio2BEL ExPASy and Bio2BEL ChEBI, it still provides an atomic example on how in- and out-edges can be inferred through hierarchies.
End of explanation
infer_child_relations(statin_graph, hmgcr_inhibitor)
to_jupyter(statin_graph)
Explanation: Propogation on Chemical Hierarchy
The first transformation made is to assert that all things true for EC 1.1.1.34/EC 1.1.88 inhibitors are also true for their descendants. There are two relationships showing decrease in the activities of the corresponding enzyme nodes that will be asserted for its two children, statin and mevinolinic acid, as well as recursively for their descendants.
End of explanation
infer_child_relations(statin_graph, ec_11134)
to_jupyter(statin_graph)
Explanation: Propogation on Protein Hierarchy
While EC 1.1.1.34 has several proteins across many species annotated in ExPASy, HMGCR is normalized to its HGNC nomenclature and used as the only example in this graph. Since HMGCR is an EC 1.1.1.34, all of the relationships with this enzyme node are transferred below.
End of explanation
<END_TASK>