numerical deconvolution and convolution methods working for inequal and incompatible timepoints between impulse and response curves for application in IVIVC level A
Project description
Pyvivc
Version 1.0
Stephen Checkley, October 2021.
Description
A Python 3 port of the Rivivc R package for IVIVC linear level A by Aleksander Mendyk and Sebastian Polak. The package contains a numerical deconvolution method working for inequal and incompatible timepoints between impulse and response curves. A numerical convolution method is also included.
Installation
Clone the repository and install with pip:
pip install .
or install with pip from the PyPi repository:
pip install pyvivc
Pyvivc example
from pyvivc import *
from scipy.interpolate import pchip_interpolate as pchip
from scipy.optimize import minimize
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
sns.set()
matplotlib.use('TkAgg')
impulse = pd.read_csv('data/impulse.csv')
response = pd.read_csv('data/resp.csv')
inp = pd.read_csv('data/input.csv')
out = pyivivc(inp,impulse,response,explicit_interpolation=10,implicit_interpolation=5)
rsquare_text = str('R squared = ') + str(round(out[0].rvalue,2))
plt.subplot(1, 2, 1)
plt.plot(inp['C'][0:len(inp)-1], out[1]['par'],'o', label='data')
plt.plot(out[1]['par'], out[0].intercept + out[0].slope*out[1]['par'], 'r')
plt.annotate(rsquare_text, (0,0.8), horizontalalignment='left', verticalalignment='top', fontsize=8) # these are the coordinates to position the label
plt.xlabel('input data (#)')
plt.ylabel('deconvolved input (#)')
plt.legend()
plt.subplot(1, 2, 2)
plt.plot(out[1]['time'], out[1]['par'], 'r', label='deconvolution')
plt.plot(inp['time'][0:len(inp)-1], inp['C'][0:len(inp)-1], 'o', label='data')
plt.xlabel('Time')
plt.ylabel('discovered input (%)')
plt.legend()
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyvivc-1.0.tar.gz.
File metadata
- Download URL: pyvivc-1.0.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
254395c355e1689f2b43474f1ea3c16706d3695ab63726064698091c37aeb735
|
|
| MD5 |
0052fcf94d712aaa798af190dcf2a719
|
|
| BLAKE2b-256 |
f7b3a0823f1c7ad4bc3e1459979b8d2dea209874bd31d9941e3d804c393d7df2
|
File details
Details for the file pyvivc-1.0-py3-none-any.whl.
File metadata
- Download URL: pyvivc-1.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4268e2371c744753e960d8232694e6efd725ac1a7e1f32743b87be770a658e8f
|
|
| MD5 |
5b380ed98ed1dd202578d3d2965d9973
|
|
| BLAKE2b-256 |
4e92ea363433ee923c8c58382e4a51445cb3a7af24e9ee9134e626b5b2957098
|