Examples

Generate graph and save graph to file

using PharmaceuticalClassification
using Serialization

rxnrel = "/path/to/rrf/RXNREL.RRF"
rxnsat = "/path/to/rrf/RXNSAT.RRF"
graph = @time build_graph(; rxnrel, rxnsat) # usually takes approx 3-5 minutes
@time Serialization.serialize("my_graph_filename.serialized", graph) # usually takes approx 3-4 minutes

Load graph from file

using PharmaceuticalClassification
using Serialization

graph = @time Serialization.deserialize("my_graph_filename.serialized") # usually takes approx 1-3 minutes

Make queries

using PharmaceuticalClassification
using Serialization

graph = Serialization.deserialize("my_graph_filename.serialized")

available_systems(graph)
equivalent(graph, PharmClass("NDC", "1234-5678-90"))
parents(graph, PharmClass("NDC", "1234-5678-90"))
children(graph, PharmClass("NDC", "1234-5678-90"))