Querying Properties
Once we have attached the properties to our species using the @attach_metadata macro, we can query them using pre-defined functions.
Let us begin by attaching metadata to a species.
using PubChem, Catalyst
# Define the species and attach metadata
@variables t
@species CH3COOH(t)
@attach_metadata CH3COOHTo get all the chemical properties attached to the species, we can use:
chemical_properties(CH3COOH)Dict{Any, Any} with 7 entries:
"IUPAC_Name_Preferred" => "acetic acid"
"IUPAC_Name_Traditional" => "acetic acid"
"Charge" => 0
"Molecular_formula" => "C2H4O2"
"Molecular_mass" => 60.0211
"Molecular_weight" => 60.05
"Smiles" => "CC(=O)O"To get the molecular weight of the species, we can use:
molecular_weight(CH3COOH)60.05To get the molecular formula of the species, we can use:
molecular_formula(CH3COOH)"C2H4O2"To get the molecular mass of the species, we can use:
molecular_mass(CH3COOH)60.021129366To get the charge on the species, we can use:
charge(CH3COOH)0To get the SMILES of the species, we can use:
smiles(CH3COOH)"CC(=O)O"To get the preferred IUPAC name of the species, we can use:
IUPAC_Name_Preferred(CH3COOH)"acetic acid"To get the traditional IUPAC name of the species, we can use:
IUPAC_Name_Traditional(CH3COOH)"acetic acid"