DOI: 10.48667/xcf2-gg25
title: The chEQWRk v0.2 code

description: This dataset represents a series of Python codes that collectively form chEQWRk v0.2 (Pronounced "check work")
These codes allow for the recreation of the data and the reproduction of the figures found in "Evaluating Serpentinization as a Source of Phosphite to Microbial Communities in Hydrothermal Vents" by Joanne Boden et al., Geobiology, 2025.
Installation guidelines and dependencies are listed on GitHub: https://github.com/sanjoymsom/chEQWRk
The README file below is also stored in /study_files/boden_2025_phosphorus_study: https://github.com/sanjoymsom/chEQWRk/blob/v0.2.0/study_files/boden_2025_phosphorus_study/READ.me
Key files                                             <br /><br />executor.py:   Program launcher.                                                        <br />serpentinization.py:   Runs the W:R rock reaction.                    <br />plotcsv.py:   Generates all the plots.                     <br />eq36python.py:   Function library that act on EQ3/6 input and output files.                                                                                 <br /><br />Initial considerations<br /><br />1. Think first of the simulation you want to do. Doing so will allow you to setup the water file correctly.                             <br />     - The water file is swmajp_tde.3i in /input_files.                <br />2. It's a good habit to clear everything (option 0) prior to running a set of computations. You can save your results at any time with option 6, and load those saved files with option 1. <br />     - Saved file are stored in the /saved_files folder.                                 <br />3. Feel free to mess with the source code to improve things. If you screw up and need to revert, the original .py files released at manuscript publication are saved in /python_backup.                <br />                                                                      <br />Manuscript figure reproduction                                    <br />                                                                      <br />#A1# To generate Fig. 4A either:                                      <br />  - Use option 1 to load 'serp_WR0p2_and_1p0', then select option 7, type 'group' as your Y variable and 'Temp' as your X variable,    <br />    select option 3 to plot Phosphites                                <br />  - OR regenerate from scratch:                                       <br />    a. Run option 0 to clear files.                                   <br />    b. Run option 2.                                                  <br />    c. Run option 4.                                                  <br />    d. Run option 7 and proceed as above.                             <br />                                                                      <br />#A2# To generate Fig. 4B, either:                                     <br /> - Use option 1 to load 'serp_WR0p2_and_1p0', then select option 9, type 'group' as your Numerator Y variable and 'Temp' as your X     <br />   variable, then select option 2 for Phosphates as the Numerator. Next, type 'group' as your Denominator Y variable and 'Temp' as    <br />   your X variable, then selection option 3 for Phosphites as the Denominator.                                                       <br /> - OR regenerate from scratch:                                        <br />    a. Run option 0 to clear files.                                   <br />    b. Run option 2.                                                  <br />    c. Run option 4.                                                  <br />    d. Run option 9 and proceed as above.                             <br />                                                                      <br />#B# To generate Fig. S4A, either                                      <br />  - Use option 1 to load 'serp_WR0p2_and_1p0_mbn'                     <br />    - Navigate to the plotting_files folder, for example with the command 'cd plotting_files'                                     <br />    - overwrite the mineral.colors file with mineral.colors.S2A file, for example with the command 'cp mineral.colors.S4A mineral.colors'<br />    - Run option 10. Fig S4A will be the second plot generated (WR=1)<br />  - OR generate from scratch:                                            <br />     a. Edit the file boden_2025_phosphorus_study.py in the folder    <br />        study_files/boden_2025_phosphorus_study/ by removing the      <br />        comment (#) that begins line 34 to enable                     <br />           serp_db = 'mbn'                                            <br />        This tells the code to use the mbn database.                  <br />     b. Run option 0 to clear files.                                  <br />     c. Run option 2.                                                 <br />     d. Run option 4.                                                 <br />     e. Run option 9, type 'group', and follow the prompts.           <br />                                                                      <br />#C# To generate Fig. S4B, either                                      <br />  - Use option 1 to load 'serp_WR0p2_and_1p0'                         <br />    - Navigate to the plotting_files folder, for example with the command 'cd plotting_files'                                     <br />    - overwrite the mineral.colors file with mineral.colors.S4A file, for example with the command 'cp mineral.colors.S4B mineral.colors'<br />    - Run option 10. Fig S4B will be the second plot generated (WR=1) <br />  - OR generate from scratch:                                         <br />     a. Edit the file boden_2025_phosphorus_study.py in the folder    <br />        study_files/boden_2025_phosphorus_study/ by commenting        <br />        line 34 by placing # in front:                                <br />           #serp_db = 'mbn'                                           <br />        This tells the code to use the tde database as enabled on     <br />        line 33.                                                      <br />     b. Run option 0 to clear files.                                  <br />     c. Run option 2.                                                 <br />     d. Run option 4.                                                 <br />     e. Run option 9, type 'group', and follow the prompts.           <br />                                                                      <br />#E# To generate Fig. 5 either:                                        <br />  - Use option 1 to load 'full_ternary_wP_300C_0p2', then select option 11.                                                        <br />    - Follow the prompts carefully to select what to plot.            <br />  - OR regenerate from scratch (caution: can take some time):         <br />    a. Run option 0 to clear files.                                   <br />    b. Run option 3. [~3hr40 on laptop (2020 i7 processor)]           <br />    c. Run option 4. [~25 mins]                                       <br />    d. Run option 5. [~9 mins]                                        <br />    d. Run option 11. Follow the prompts carefully to select the plot.<br />       - Figs. a,b,c are in log scale.                                <br />       - Fig. d is in linear scale.               
Other reasonably useful information
- The reason for creating a Python wrapper code is to automatically string EQ3 and EQ6 files, which is tedious if done manually. While the plots above are the end-product of the runs, the intermediary files are also available:
- The files representing the brines as output of evaporation are in the output_files/ folder, and titled just_the_brine.<br />- The file that represents the brine reacting with rock at the initial temperature (10C in this study) is also found in the output_files/ folder as serp_10C.<br />- The files that represent the result of serpentinization at the initial temperature and heated to 400C are in the plotting_files/raw6o folder.<br />- The 6o files in the plotting_files/raw6o folder are the source data for the csvs in plotting_files/csvs
- The colors chosen for the minerals (option 11) are hard-coded in plotcsv.py. Twenty of them are listed there. To see those twenty colors, set the visualize flag to 'True' in study_files/som_2024_brines_study.py (line 255).
- Why is the code called chEQWRk? Well, it has a double meaning. First, it is read as "checkwork", implying that it can be used to check the science that is presented by using it. A nod to open science. Second, it also can mean 'C'onsiderable 'h'elp when running 'EQ'3/6 for 'W'ater:'R'ock 'k'alculations.