Hi all,
Hope everyone is doing okay. This is actually the first time I use this platform. I have a very simple question regarding the search engine. So, I want to extract the compounds that have CO2 and OH groups with other elements. The reason is that when I used the primary search engine and use * or -, it directs me to many wrong compounds.
Thanks for your help in advance!
Mohammad Monir
Hi @mohammad_monir, are you referring to the materials search? You can’t query directly by functional groups like this, and since we mostly consider inorganic solids, it’s unlikely that there are any solids with both a CO2 and OH group.
Still, the easiest way to check is programmatically with the API:
from mp_api.client import MPRester
with MPRester("your_api_key") as mpr:
summary_docs = mpr.materials.summary.search(elements=["C","O","H"],fields=["material_id"])
bond_docs = mpr.materials.bonds.search(material_ids = [doc.material_id for doc in d])
From the bond_docs
, you can tell what local coordination environments are detected in the structure. For example, if I look at the bonding doc corresponding to mp-1001080
, I see:
bond_docs[0].coordination_envs # this corresponds to mp-1001080 for me
>>> ['C4+-O2-(3)', 'H+-O2-(2)', 'O2--H+(1),C4+(1)', 'O2--H+(2),C4+(1)']
which tells me there are unique CO3, HO2, COH, and COH2 coordination environments.
If you look through the coordination environments, you can filter for ones that have both C2+-O2-(2)
and O2-H+
in the coordination_envs
field, possibly with other oxidation states for C.