A simple calculator program that performs buffer calculations.
- Entry into an imported or new user generated chemical library that can be updated each time a new buffer is created
- Scale buffers to any volume required simply
- Export buffers to a CSV file for easy printing and logging
- Python 3.x
-
Clone the repository:
git clone https://github.com/kodyklupt/WarrenBuffer
Run the script from the command line, providing the total volume and the chemicals to add. The script accepts concentrations in mM.
python buffercalculator.py create --name test --volume <L> --dry <name> <concentration> --wet <name> <concentration>To create a 1.5 L buffer with 200 mM Sodium Chloride, 100 mM Tris, and 50 mM HCl, you would run:
python buffercalculator.py create --volume 1.5 --dry "Sodium Chloride" 200 --dry "Tris" 100 --wet "HCl" 50 --name "test"To 'scale' the 1.5 L buffer you created take the csv, original volume, and the new volume: (Note: the volume is stored in the file name)
python buffercalculator.py scale --original_volume 1.5 --new_volume 1.0 --input_file "test"To 'edit' the buffer and add new wet or dry reagents, for example urea:
python buffercalculator.py edit --input_file "test" --dry "Urea" 8000 --volume 1.5 --name "test_with_urea"
## Chemical Libraries
The `Chemical Libraries` folder contains lists of wet and dry reagents that can be used by the buffer calculator. You can easily add your own chemicals to these lists.
- `dry.csv`: This file contains a list of dry reagents and their corresponding molecular weights in g/mol.
- `wet.csv`: This file contains a list of wet reagents and their corresponding molarities in mol/L.
## Google Gemini Chemical Libraries
Gemini was prompted to generate a list of common chemical reagents and associated molecular weights. These are the loaded default files. Use caution when using these libraries.
## Generating user specific dictionaries
Go to ```/Chemical_Libraries/.gitignore``` and uncomment the dry.csv or wet.csv so your libraries are not written over in future pulls from Git. Alternatively, you can use redirect the library in buffercalculator.py
```bash
dry_lib = pd.read_csv("Chemical_Libraries/dry.csv")
wet_lib = pd.read_csv("Chemical_Libraries/wet.csv")The Outputs folder contains the generated buffer recipes in CSV format. Each time you create a new buffer, a CSV file with the recipe will be saved in this folder.