import ase
from ase import io
import numpy as np
import chemiscope
import pandas as pd
df_1 = pd.read_csv("property_2063.txt",sep='\t')
df_1.head()
refcode | metal | total_charge | spin_multiplicity | elem_nr | m_ox | d_elec | CN | geometry | rel_m | |
---|---|---|---|---|---|---|---|---|---|---|
0 | KIPLIH | Cr | 0 | 1 | 24 | 0 | 5 | 5 | Square pyramidal | 0.836 |
1 | AYIZIS | Cr | 0 | 1 | 24 | 0 | 5 | 6 | Octahedral | 0.848 |
2 | MISLAB | Cr | 0 | 1 | 24 | 0 | 5 | 6 | Octahedral | 0.859 |
3 | KOQBAT | Cr | 0 | 1 | 24 | 0 | 5 | 6 | Octahedral | 0.860 |
4 | VOWRAA | Cr | -1 | 1 | 24 | 0 | 5 | 6 | Octahedral | 0.856 |
mols_1 = []
for structure in df_1["refcode"]:
mols_1.append(ase.io.read(f"Ground_state_spin_dataset/{structure}.xyz"))
properties_1 = {}
for key in df_1.keys():
#print(key)
units = None
if key == "refcode" or key == "name":
continue
if "total_charge" in key:
units = ""
if "spin_multiplicity" in key:
units = ""
if "elem_nr" in key:
units = ""
if key == "m_ox":
units = ""
if key == "d_elec":
units = "electrons"
if key == "CN":
units == ""
if key == "rel_m":
units == ""
if units is not None:
keydict = {
"target": "structure",
"values": df_1[f"{key}"].to_list(),
"units": f"{units}",
}
else:
continue
properties_1[f"{key}"] = keydict
chemiscope.write_input(
path=f"Ground_state_spin_dataset_chemiscope.json.gz",
frames=mols_1,
properties=properties_1,
)
/home/ruben/anaconda3/lib/python3.8/site-packages/chemiscope/structures.py:278: UserWarning: the following structure properties properties are only defined for a subset of frames: ['-1', '-2', '-3', '-4', '-5', '0', '1', '2', '3', '4', '5', '6']; they will be ignored warnings.warn(
widget = chemiscope.show(mols_1, properties_1)
widget
ChemiscopeWidget(value=None, data='{"meta": {"name": " "}, "structures": [{"size": 59, "names": ["Cr", "O", "O…
df_2 = pd.read_csv("property_1838.txt",sep='\t')
df_2.head()
refcode | metal | total_charge | spin_multiplicity | elem_nr | m_ox | d_elec | hapticity | |
---|---|---|---|---|---|---|---|---|
0 | DIDSEQ | Sc | 0 | 1 | 21 | 3 | 0 | False |
1 | EZUYUW | Sc | 0 | 1 | 21 | 3 | 0 | False |
2 | NURLAQ | Sc | 0 | 1 | 21 | 3 | 0 | False |
3 | ZIGKOS | Sc | 0 | 1 | 21 | 3 | 0 | False |
4 | ACOJAD | Ti | 0 | 3 | 22 | 2 | 2 | False |
mols_2 = []
for structure in df_2["refcode"]:
mols_2.append(ase.io.read(f"Supplementary_dataset/{structure}.xyz"))
properties_2 = {}
for key in df_2.keys():
#print(key)
units = None
if key == "refcode" or key == "name":
continue
if "total_charge" in key:
units = ""
if "spin_multiplicity" in key:
units = ""
if "elem_nr" in key:
units = ""
if key == "m_ox":
units = ""
if key == "d_elec":
units = "electrons"
if key == "CN":
units == ""
if key == "rel_m":
units == ""
if key == "hapticity":
units == ""
if key == "hapttype":
units == ""
if units is not None:
keydict = {
"target": "structure",
"values": df_2[f"{key}"].to_list(),
"units": f"{units}",
}
else:
continue
properties_2[f"{key}"] = keydict
chemiscope.write_input(
path=f"Supplementary_dataset_chemiscope.json.gz",
frames=mols_2,
properties=properties_2,
)
/home/ruben/anaconda3/lib/python3.8/site-packages/chemiscope/structures.py:278: UserWarning: the following structure properties properties are only defined for a subset of frames: ['-1', '-2', '-3', '-4', '0', '1', '2', '3', '4', '5', '6']; they will be ignored warnings.warn(