A simple package for VTNA analysis of chemical reactions
Project description
Kinalite - Simple VTNA
Kinalite is a Python package that provides a simple API for running Variable Time Normalization Analysis on chemical data.
Requirements
Python 3.6+
Installation
Kinalite can be installed with pip:
$ pip install kinalite
Usage
To use kinalite you will need to provide two DataFrames with experiment data to compare. Kinalite will then use VTNA to find a best order for the first experiment.
Reading data
The first step is using the Pandas package to convert your experiment data into DataFrames:
import pandas as pd
# supply an absolute or relative path to CSV files
experiment_a_data = pd.read_csv('./data/experiment_a.csv')
experiment_b_data = pd.read_csv('./data/experiment_b.csv')
These CSV files need to have a single header row and time in the first columns. All values, including Time, are numbers. For example:
Time | C | A | B | D | cat |
---|---|---|---|---|---|
0 | 0 | 1 | 1 | 0 | 0.01 |
5 | 5.45911E-05 | 0.997274 | 0.997328 | 0.00267175 | 0.00994541 |
10 | 5.45909E-05 | 0.994555 | 0.99461 | 0.0053903 | 0.00994541 |
15 | 5.45907E-05 | 0.991844 | 0.991899 | 0.00810143 | 0.00994541 |
20 | 5.45906E-05 | 0.98914 | 0.989195 | 0.0108052 | 0.00994541 |
Running VTNA
Next you can use your converted data to create an Experiment
and run VTNA. You must also provide the
column indexes for the substrate and product, starting at 0 (Time is column index 0):
import pandas as pd
from kinalite.experiment import Experiment
# supply an absolute or relative path to CSV files
experiment_a_data = pd.read_csv('./data/experiment_a.csv')
experiment_b_data = pd.read_csv('./data/experiment_b.csv')
# create an experiment and supply the column indexes for the substrate and product
experiment = Experiment('A', [experiment_a_data, experiment_b_data], substrate_index=2, product_index=4)
# run VTNA and print out the best order
result = experiment.calculate_best_result()
print('Order in A: ', result.order)
Plotting data
Kinalite provides some plotting methods to help visualize the results of running VTNA:
from kinalite.plots import plot_experiment_results
plot_experiment_results(experiment)
Example Script
There is also an example script with a comparison of multiple sets of data: kinalite_example/main.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file kinalite-0.0.6.tar.gz
.
File metadata
- Download URL: kinalite-0.0.6.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.8.2 requests/2.27.1 setuptools/57.5.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6b177fe4192d4e40a26c4f337fb2c6b68ca3f916ecd914f22819aee90090cb5 |
|
MD5 | 156b0ba513085099738cca96af5fe6ca |
|
BLAKE2b-256 | 7722e024d54d3c56dc1c3862338f0d49a8424d03e65fad98e4ed577b468aeed4 |