Skip to content

Commit baa4f0c

Browse files
committed
refine README
1 parent e6255a8 commit baa4f0c

1 file changed

Lines changed: 107 additions & 56 deletions

File tree

README.md

Lines changed: 107 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
## Contents
3030
* [Dependencies](#dependencies-)
3131
* [Install](#install-)
32-
* [Usages](#usages-)
32+
* [Input Preparation](#input-preparation-)
33+
* [Command Line Interface](#command-line-interface-)
34+
* [Running Simulations](#running-simulations-)
35+
* [Outputs](#outputs-)
36+
* [Replotting Utility](#replotting-utility-)
3337
* [Examples](#examples-)
3438
* [Limitations](#limitations-)
3539
* [Citation](#citation-)
@@ -42,7 +46,7 @@ The code runs on pure python with the following dependencies:
4246
- `autograd`
4347
- `matplotlib`
4448
- `pandas`
45-
- `scipy`
49+
- `scikit-learn`
4650
- `h5py`
4751
- `fire`
4852
- `navicat_volcanic`
@@ -61,64 +65,113 @@ or
6165
python setup.py install
6266
```
6367

64-
## Usages [](#usages)
65-
66-
The code requires two essential inputs for the analysis: energy data and reaction network (along with initial concentrations to be incorporated in the reaction network). All these files must be in the working directory or in the directory targeted with the `-d` option..
67-
68-
- energy data: reaction_data (in csv or xlsx format)
69-
- reaction network: rxn_network (in csv or xlsx format)
70-
- (optional) kinetic data: kinetic_data (in csv or xlsx format)
71-
72-
73-
The energy data must be named "reaction_data" and share similar format as in `navicat_volcanic` found [here](https://raw.githubusercontent.com/lcmd-epfl/volcanic). In cases involving multiple reaction pathways, the final column of each pathway (including those pathways leading to the resting state) should contain "Prod" (case-insensitive).
74-
75-
The reaction network must be provided as a pandas-compatible csv or xlsx file named "rxn_network". Each row in the network represents an elementary step, while the columns represent the chemical species involved in the mechanism, excluding transition states. When filling in the reaction network, it is crucial to ensure that the species names match those in the energy data.
76-
77-
For each step (denoted as *i*) in the reaction network, assign a value of *-n* to the species on the left side of the elementary step equation and *+n* (or simply *n*) to the species on the right side, where *n* represents the stoichiometric coefficient. If a chemical species is not involved in step i, leave the corresponding cell empty or fill it with 0.
78-
79-
The initial concentrations should be specified in the last row of the reaction network file. This row can be named "c0", "initial_conc," or "initial conc."
80-
81-
82-
The code offers three modes of operation:
83-
84-
- **mkm**: This mode is for a single MKM run. If there are multiple profiles in the reaction data file, the top-most row is read.
85-
- **cond**: Use this mode for screening over reaction time and/or temperature.
86-
- **vp**: This mode is for screening over all energy profiles in the reaction data file. Note that it's only applicable when the reaction data contains more than one energy profile.
87-
88-
Once all input files are ready and `mikimo` is installed, several run options are available:
89-
90-
1. Call just microkinetic solver:
68+
## Input Preparation [](#input-preparation)
69+
70+
The code requires two essential inputs for the analysis: energy/kinetic data and reaction network (along with initial concentrations). All files must be in the working directory or in the directory targeted with the `-d` option.
71+
72+
### 1. Reaction Data (Energy Profile)
73+
* **Filename:** `reaction_data.csv` or `reaction_data.xlsx`
74+
* **Format:** Matches the `navicat_volcanic` format found [here](https://raw.githubusercontent.com/lcmd-epfl/volcanic).
75+
* **Details:**
76+
* In cases involving multiple reaction pathways, the final column of each pathway (including those leading to the resting state) should contain "Prod" (case-insensitive).
77+
* Used by default.
78+
79+
### 2. Kinetic Data (Rate Constants)
80+
* **Filename:** `kinetic_data.csv` or `kinetic_data.xlsx`
81+
* **Format:** Similar structure to reaction data but values are rate constants.
82+
* **Details:**
83+
* Used when the `-k` or `--kinetic` flag is active.
84+
* Allows inputting direct rate constants, bypassing Eyring equation calculations.
85+
* **Note:** Screening over temperature ranges is not supported in this mode.
86+
87+
### 3. Reaction Network
88+
* **Filename:** `rxn_network.csv` or `rxn_network.xlsx`
89+
* **Format:** Pandas-compatible CSV/XLSX.
90+
* **Structure:**
91+
* **Rows:** Elementary steps.
92+
* **Columns:** Chemical species involved (excluding transition states).
93+
* **Values:** Stoichiometric coefficients.
94+
* Left side (Reactants): `-n`
95+
* Right side (Products): `+n`
96+
* Not involved: `0` or empty.
97+
* **Matching:** Species names must match those in the `reaction_data`/`kinetic_data`.
98+
* **Initial Concentrations:** Specified in the last row, labeled "c0", "initial_conc", or "initial conc".
99+
100+
## Command Line Interface [](#command-line-interface)
101+
102+
The main tool is `navicat_mikimo`. Below are the available flags:
103+
104+
| Flag | Long Flag | Description | Default |
105+
| :--- | :--- | :--- | :--- |
106+
| `-d` | `--dir` | Directory containing input files. | `.` |
107+
| `-e` | `--eprofile_choice` | Index of energy profile to use (for single runs). | `0` |
108+
| `-t` | `--temp` | Temperature(s) in Kelvin. | `298.15` |
109+
| `-Tf` | `--Time` | Total reaction time(s) in seconds. | `86400` (1 day) |
110+
| `-k` | `--kinetic` | Toggle to use `kinetic_data` instead of `reaction_data`. | `False` |
111+
| `-nd` | `--run_mode` | `0`: MKM for all profiles, `1`: Volcano Plot, `2`: Activity Map. | `1` |
112+
| `-ncore`| `--ncore` | Number of CPU cores for parallel computing. | `1` |
113+
| `-v` | `--verb` | Verbosity level (2 generates output files). | `2` |
114+
| `-pm` | `--plotmode` | Plot detail level (`0`-`3`). | `1` |
115+
| `-p` | `--percent` | Report activity as percent yield instead of concentration. | `False` |
116+
| `-ev` | `--plot_evo` | Toggle to generate evolution plots for all profiles. | `False` |
117+
| `-x` | `--xscale` | Time scale for plots (`ls`, `s`, `min`, `h`, `d`). | `ls` (log seconds) |
118+
| `-ci` | `--ci` | Compute confidence intervals (requires statistical data). | `False` |
119+
| `-is` | `--imputer_strat`| Strategy to fill missing data (`knn`, `iterative`, `simple`). | `knn` |
120+
| `-tt` | `--map` | Construct a Time-Temperature activity map. | `False` |
121+
122+
## Running Simulations [](#running-simulations)
123+
124+
The code offers three main modes of operation:
125+
126+
### 1. Single MKM Run (`mkm`)
127+
Performs a single microkinetic modeling run. If multiple profiles exist, the top-most row (or specified via `-e`) is used.
91128
```python
92129
python -m navicat_mikimo mkm -d [DIR]
93130
```
94-
2. Microkinetic modeling for all reaction profiles:
95-
```python
96-
python -m navicat_mikimo vp -d [DIR] -nd 0
97-
```
98131

99-
3. To construct microkinetic volcano plot:
132+
### 2. Screening / Volcano Plots (`vp`)
133+
Screens over all profiles in the reaction data file.
134+
* **Run MKM for all profiles (no plot):** `-nd 0`
135+
* **Volcano Plot:** `-nd 1`
136+
* **Activity/Selectivity Map:** `-nd 2`
137+
100138
```python
101139
python -m navicat_mikimo vp -d [DIR] -nd 1
102140
```
103141

104-
4. To construct microkinetic activity/selectivity map with a descriptor variable representing catalyst and temperature (or reaction time) (T1 and T2 are the lower and upper bounds of the temperature range, respectively):
142+
### 3. Conditions Screening (`cond`)
143+
Screens over reaction time and/or temperature ranges.
105144
```python
106-
python -m navicat_mikimo vp -d [DIR] -nd 1 -t T1 T2
145+
python -m navicat_mikimo cond -d [DIR]
107146
```
108147

109-
5. To construct microkinetic activity/selectivity map:
110-
```python
111-
python -m navicat_mikimo vp -d [DIR] -nd 2
112-
```
148+
## Outputs [](#outputs)
149+
150+
* **Single Run (`mkm`):**
151+
* `mkm_output.json`: Time-course data.
152+
* `mkm_[name].png`: Concentration evolution plot.
153+
* **Volcano/Screening (`vp`, `cond`):**
154+
* **HDF5 Files:** `mkm_vp.h5`, `mkm_descr_phys.h5`, `mkm_vp_3d.h5`. Contain raw data for replotting.
155+
* **Plots:** Combo plots, profile plots, and activity/selectivity maps (PNG).
156+
157+
## Replotting Utility [](#replotting-utility)
158+
159+
A standalone script `replot.py` is provided to smooth or adjust plots using generated HDF5 files.
113160

114-
6. To screen over reaction time and temperature:
115161
```python
116-
python -m navicat_mikimo cond -d [DIR]
162+
python replot.py [h5_file] [options]
117163
```
118164

119-
7. To smooth the volcano plots generated:
165+
**Options:**
166+
* `-f`: Filter method (`savgol`, `wiener`, `None`). Default: `savgol`.
167+
* `-w`: Window length (list of integers).
168+
* `-p`: Polynomial order (list of integers, for Savitzky-Golay).
169+
* `-s`: Save polished data to new HDF5 file.
170+
* `-pm`: Plot mode.
171+
172+
**Example:**
120173
```python
121-
python replot.py [i]
174+
python -m navicat_mikimo replot examples/data/vp/data_a.h5 -p 3 3 3 -w 20 20 20
122175
```
123176

124177
## Examples [](#examples)
@@ -149,30 +202,29 @@ python -m navicat_mikimo vp -d test_cases/pincer_CO2/ -t 273.15 423.15 -Tf 7200
149202
```
150203

151204
6. Constructing microkinetic activity and selectivity maps with reaction time [2-24 hr] and temperature [273.15-423.15 K] as descriptors for the catalytic hydrosilylation of carbon dioxide with the Co pincer complex:
152-
153205
```python
154206
python -m navicat_mikimo cond -d test_cases/pincer_CO2_jacs/ -tt -Tf 7200 86400 -t 273.15 423.15 -ncore 24
155207
```
156208

157-
7. Using filtering to smooth the plot:
209+
7. Generate evolution plots for all profiles in a dataset:
210+
```python
211+
python -m navicat_mikimo vp -d [DIR] -nd 0 -ev
212+
```
158213

214+
8. Using filtering to smooth the plot:
159215
```python
160216
python -m navicat_mikimo replot examples/data/vp/data_a.h5 -p 3 3 3 -w 20 20 20
161217
```
162218

163219
You can find examples demonstrating how to read h5 files and regenerate plots in the "examples" folder.
164220

165-
If the kinetic profile is detected in the directory, the code will prompt the user with an option to choose between using the kinetic profile instead of the energy profile. However, it's important to note that selecting the kinetic profile will restrict the user from screening over a range of temperatures or utilizing different temperature settings. Additionally, using the kinetic profile will limit the information about species names (for ax labelling purposes) and may worsen the quality of the linear scaling relationships in volcano plot generation.
166-
167221
## Limitations [](#limitations)
168222

169-
1. Overlapping states of different pathways before the reference state (starting point).
223+
1. **Overlapping states** of different pathways before the reference state (starting point).
224+
2. **Bridging states** between otherwise separate pathways.
225+
3. **Different TSs** connecting the same 2 intermediates: just choose the lowest one or compute an effective TS energy that corresponds to the sum of the two rate constants.
170226

171-
2. Bridging states between otherwise separate pathways.
172-
173-
3. Different TSs connecting the same 2 intermediates: just choose the lowest one or compute an effective TS energy that corresponds to the sum of the two rate constants.
174-
175-
To overcome these limitations and offer more flexibility, users have the option to input a kinetic profile named "kinetic_profile" in either csv or xlsx format, replacing the conventional energy profile. However, this choice comes with the trade-off of disabling the ability to screen over a range of temperatures or use different temperature settings.
227+
To overcome these limitations and offer more flexibility, users have the option to input a kinetic profile named "kinetic_data" in either csv or xlsx format, replacing the conventional energy profile. However, this choice comes with the trade-off of disabling the ability to screen over a range of temperatures or use different temperature settings.
176228

177229
## Citation [](#citation)
178230

@@ -181,5 +233,4 @@ If you use navicat_mikimo in your work, please cite our work and the publication
181233
```
182234
Worakul, T., Laplaza, R., Das, S., Wodrich, M.D., Corminboeuf, C., Microkinetic Molecular Volcano Plots for Enhanced Catalyst Selectivity and Activity Predictions. ACS Catalysis 2024 14 (13), 9829-9839.
183235
```
184-
[![DOI](https://img.shields.io/badge/DOI-10.1021/acscatal.4c01175-red)](https://pubs.acs.org/doi/10.1021/acscatal.4c01175)
185-
236+
[![DOI](https://img.shields.io/badge/DOI-10.1021/acscatal.4c01175-red)](https://pubs.acs.org/doi/10.1021/acscatal.4c01175)

0 commit comments

Comments
 (0)