Querying Properties
You can query properties from PubChem using the chemical_properties
which returns a dictionary, or any of the specific functions like molecular_weight
etc. These take either a CID, a name, a formula or a species in Catalyst that you have attached metadata to in advance.
Catalyst Metadata example
For this example, 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 CH3COOH
To 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.05
To 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.021129366
To get the charge on the species, we can use:
charge(CH3COOH)
0
To 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"
Querying Directly
All of the above methods work with named, CIDs, or formula as well.
using PubChem
chemical_properties("water")
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"
chemical_properties("oxidane")
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"
chemical_properties(962)
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"
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"