Skip to main content

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()

The output should look like this

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvivc-1.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvivc-1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

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

Hashes for pyvivc-1.0.tar.gz
Algorithm Hash digest
SHA256 254395c355e1689f2b43474f1ea3c16706d3695ab63726064698091c37aeb735
MD5 0052fcf94d712aaa798af190dcf2a719
BLAKE2b-256 f7b3a0823f1c7ad4bc3e1459979b8d2dea209874bd31d9941e3d804c393d7df2

See more details on using hashes here.

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

Hashes for pyvivc-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4268e2371c744753e960d8232694e6efd725ac1a7e1f32743b87be770a658e8f
MD5 5b380ed98ed1dd202578d3d2965d9973
BLAKE2b-256 4e92ea363433ee923c8c58382e4a51445cb3a7af24e9ee9134e626b5b2957098

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page