PubChem.jl
PubChem.jl is a powerful Julia package that facilitates easy access to chemical data from the PubChem database and associates it with chemical species defined using the Catalyst.jl package. This allows you to seamlessly integrate chemical metadata into your computational workflows.
Features
- Effortlessly retrieve chemical information from the PubChem database using the PubChem REST API.
- Determine the molar ratios, limiting reagent and theoretical yield in a chemical reaction.
- Calculate the number of moles of a compound.
Installation
PubChem can be installed through the Julia package manager:
using Pkg
Pkg.add("PubChem")
Illustrative Example
To retrieve chemical properties for the compound H2O
, begin by defining the compound as you would in Catalyst and then attach the relevant metadata:
using PubChem, Catalyst
@variables t
@species H2O(t)
@attach_metadata H2O
\[ \begin{equation} \mathrm{H2O}\left( t \right) \end{equation} \]
Now, our species H2O
contains chemical data retrieved from PubChem as its metadata. To access and query this data, you can utilize the following method:
chemical_properties(H2O)
Dict{Any, Any} with 7 entries:
"IUPAC_Name_Preferred" => "oxidane"
"IUPAC_Name_Traditional" => "water"
"Charge" => 0
"Molecular_formula" => "H2O"
"Molecular_mass" => 18.0106
"Molecular_weight" => 18.015
"Smiles" => "O"