Skip to content

Commit 77febf1

Browse files
committed
collect graph data
1 parent f9e6c34 commit 77febf1

7 files changed

Lines changed: 715 additions & 20 deletions

File tree

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ It extracts **organic ligands**, **space group information**, and computes the *
6060
Quickly run command on any cif file
6161

6262
```bash
63-
fairmofsyncondition_syncon my_mof.cif
63+
fairmofsyncondition_syncon my_mof.cif
6464
```
6565

6666
Or run and provide and outfile
6767

6868
```bash
69-
fairmofsyncondition_syncon my_mof.cif -o my_mof_report.txt
69+
fairmofsyncondition_syncon my_mof.cif -o my_mof_report.txt
7070
```
7171

7272
`iupac2cheminfor`
@@ -75,13 +75,13 @@ as inchikey and smile strings directly from iupac names or common names. This ca
7575
achieved using `iupac2cheminfor` CLI as follows:
7676

7777
```bash
78-
iupac2cheminfor 'water'
78+
iupac2cheminfor 'water'
7979
```
8080

8181
or
8282

8383
```bash
84-
iupac2cheminfor -n 'water' -o filename
84+
iupac2cheminfor -n 'water' -o filename
8585
```
8686

8787
The out will be written by default to cheminfor.csv if no output is provided
@@ -93,15 +93,23 @@ Another useful tool is directly convert a `smile` or and `inchikey` their iupac
9393
To achieve this simply run the following commandline tool
9494

9595
```bash
96-
cheminfo2iupac -n 'O' -o filename
96+
cheminfo2iupac -n 'O' -o filename
9797
```
9898

9999
`struct2iupac`
100100
In other cases one may one to directly extract the iupac name and cheminformatic identifier of a chemical structure.
101101
The quickest way to do this is by running the following commands.
102102

103103
```bash
104-
struct2iupac XOWJUR.xyz
104+
struct2iupac XOWJUR.xyz
105+
```
106+
107+
`pg_graph from cif file or folder`
108+
109+
One can reliably create an `lmdb` dataset using the following code.
110+
111+
```bash
112+
pggraph_from_cifs -i ./CIFs/ -o mof_db.lmdb
105113
```
106114

107115
## Training
@@ -123,7 +131,6 @@ command line arguments.
123131
find_bde_parameters -h
124132
```
125133

126-
127134
## Machine Learning Folder
128135

129136
The folder **`machine_learning/`** contains the code and Jupyter notebooks to predict the **metal salt of a given MOF** using **Graph Neural Networks (GNNs)**.
@@ -143,8 +150,6 @@ The folder **`machine_learning/`** contains the code and Jupyter notebooks to pr
143150
**Note**:
144151
If you only want to **test the model** with pre-trained weights, you can simply **skip step 3** (training).
145152

146-
147-
148153
## Documentation
149154

150155
Full documentation can be found [docs](https://bafgreat.github.io/fairmofsyncondition/).

fairmofsyncondition/call_model/run_model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
1313
from mofstructure.filetyper import load_iupac_names
1414
from fairmofsyncondition.read_write import cheminfo2iupac, coords_library, filetyper
15-
from fairmofsyncondition.read_write import filetyper, coords_library
1615
from fairmofsyncondition.call_model.utils_model import get_models, ensemble_predictions, get_model_energy, get_energy_prediction
1716
import warnings
1817
from openbabel import openbabel
@@ -325,7 +324,7 @@ def compile_data(self):
325324
for solvent_data in solvents[:3]:
326325
solvent, prob = solvent_data
327326
data.append(f"{solvent:<40} {prob:>15} %\n")
328-
327+
329328
data.append("=" * 80 + "\n")
330329
data.append("\n")
331330
data.append("Report generated by fairmofsyncondition\n")

fairmofsyncondition/crystal/__init__.py

Whitespace-only changes.

fairmofsyncondition/crystal/analysis.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ def find_diffraction_pattern(self):
6767
"""
6868
if self.diffraction_type == "PXRD":
6969
xrd = XRDCalculator(wavelength=self.wavelength)
70-
pattern = xrd.get_pattern(self.structure)
70+
pattern = xrd.get_pattern(self.structure, two_theta_range=(0, 100))
7171
elif self.diffraction_type == "ND":
72-
xrd = NDCalculator(wavelength=self.wavelength)
73-
pattern = xrd.get_pattern(self.structure)
72+
nd = NDCalculator(wavelength=self.wavelength, two_theta_range=(0, 100))
73+
pattern = nd.get_pattern(self.structure)
7474
else:
7575
raise ValueError("""Invalid diffraction type.
7676
Choose between PXRD and ND""")
@@ -81,8 +81,8 @@ def get_pattern(self):
8181
"""
8282
"""
8383
pattern = self.find_diffraction_pattern()
84-
two_theta = np.array(pattern.x)
85-
intensity = np.array(pattern.y)
84+
two_theta = np.array(pattern.x, dtype=np.float32)
85+
intensity = np.array(pattern.y, dtype=np.float32)
8686
return two_theta, intensity
8787

8888

0 commit comments

Comments
 (0)