Python tools for analyzing electrochemistry voltammograms. The script
vg2signal.py
processes a potentiostat voltammogram data file using a method
analogous to LDNH, into a signal value and optionally plots the "detilted"
voltammogram. It can also optionally re-center the analysis window on the
empirical peak voltage from the first phase of analysis of the data (which is
only a good idea to run on a voltammogram that has a clear and unambiguous
analyte peak).
- Python 3.9 (
scikit-learn
package does not work on any later version) git
- Coding Application/IDE
- A github account
So far, this software has only been tested on Windows11/x86_64. It has not been tested on MacOS 12.6.5 on Apple M1, Linux/x86_64, etc.
-
Download Python 3.9 (can be 3.9.0-3.9.12)
- make sure to select
Add Python 3.9 to PATH
when you install it
- make sure to select
-
Download a coding application/IDE (i.e. VisualStudio, VSCode, PyCharm)
-
Clone the software repo (2 ways)
- sign into your github through the IDE
- paste the repo address:
https://github.com/ramseylab/vgrampy.git
-
Change to the correct branch- for running for one experiment use
user-friendly
- for VisualStudio- on the right side click
Git Changes
and change the drop-down menu
- for VisualStudio- on the right side click
-
Open the command prompt and change your directory to the software repo
cd vgrampy
- if you open the command prompt within your IDE, it should already be in the right directory
-
Install all of the required packages:
pip install numpy
- depending on your computer, it may be
pip
orpip3
- most packages will be installed when creating the virtual environment
- Run the program by typing in
python groupvg2.py
- depending on your computer, it may be
python
orpython3
orpy
- Log-Transformation: log-transform or not (default = log)
- Peak Feature: peak curvature, height or area (default = peak curvature)
- Smoothing Parameter: amount of smoothing the voltammogram (default = 0.006)
- Stiffness Parameter: how strictly the spline passes through the data points (default = 0)
- Window Width: voltage width to window out when making the spline (default = 0.15)
The plots saved will be the smoothed and detilted voltammograms, more options are in plotseparate.py
The naming convention for each file is: [filename]_[log or no log]_[smoothing parameter]_[stiffness parameter]_[window width]
For example dataframe_log_curvature_0.006_0_0.15.xlsx
conc | replicate | V | I | logI | smoothed | detilted |
---|---|---|---|---|---|---|
0 | 1 | 0.504 | 0.08379 | -0.25515 | -0.24431 | 0 |
0 | 1 | 0.508 | 0.8375 | -0.25584 | -0.23192 | 0 |
0 | 1 | 0.512 | 0.8564 | -0.21048 | -0.21048 | 0 |
0 | 1 | 0.516 | 0.8797 | -0.18492 | -0.18001 | 0 |
0 | 1 | 0.520 | 0.9069 | -0.14098 | -0.14420 | 0 |
In the file, the vcenter
column contains the voltage value, for each voltammogram,
of the inflection point identified by the "shoulder getter" function; and the peak V
column contains the voltage value, for each voltammogram, at which the background-subtracted
voltammogram has a critical point within the censoring window.
file | signal | peak V | vcenter |
---|---|---|---|
2024_01_02_cbz00_01.txt | 23.9020 | 1.083 | 1.012 |
2024_01_02_cbz15_01.txt | 324.8372 | 1.074 | 1.076 |
2024_01_02_cbz15_02.txt | 236.3741 | 1.061 | 1.064 |
conc | average | std | CV | T-Statistic | avg peak | std peak |
---|---|---|---|---|---|---|
0.0μM | 28.9 | 20.11 | 0 | 0 | 1.02 | 0.04 |
5.0μM | 84.11 | 14.19 | 0.169 | 6.34 | 1.06 | 0.01 |
10.0μM | 9.80 | 29.8 | 0.206 | 5.19 | 1.07 | 0 |
15.0μM | 227.97 | 42.43 | 0.186 | 4.54 | 1.07 | 0 |
Exception of type 'Microsoft.TeamFoundation.Git.Contracts.GitCheckoutConflictException' was thrown`"
This means that the destination branch has more exclusions in .gitignore than the original branch.
Solution: in the Git changes, 'ignore' the .suo (or .wsuo) file and then do a force checkout to get to your desired branch.
This means that you are not using Python 3.9
Solution:
- Uninstall the Python version you have on your computer (make sure it is no longer in PATH).
- Install Python 3.9 and change your interpreter to the correct version
You need to be added by an admin in order to access the code (currently Noel)
Solution: email the admin to get your github account added to the repo