Skip to main content

PyPI version Actions Status License Downloads pre-commit.ci status Code style: black Imports: isort

Background

The Hill equation is defined as follows:

y = bottom + ((top - bottom) * xnH) / (EC50nH+ xnH)

where bottom is the minimum activity; top is maximum activity; EC50 is the half-maximum effective dose; and nH is the Hill coefficient. The variables x & y are the stimuli dose and the cellular or tissue response. The hillfit module applies this biological equation, and is available with the MIT License.

Usage

installation

The following command are executed in a command prompt/terminal environment:

pip install hillfit

__init__

The data environment, in a Python IDE, is defined:

import hillfit
hf = hillfit.HillFit(x_data, y_data, bottom_param=True)
  • x_data & y_data list or ndarray: specifies the x-values & y-values, respectively, of the raw data that will be fitted with the Hill equation.

  • bottom_param bool: specifies whether the accessory bottom parameter of the Hill equation will be employed in the regression.

fitting()

The parameterized data is fitted to the Hill equation, with the following arguments and their default values:

hf.fitting(x_label='x', y_label='y', title='Fitted Hill equation', sigfigs=6, log_x=False, print_r_sqr=True,
           generate_figure=True, view_figure=True, export_directory=None, export_name=None, figure=True, curve_fit_kws:Optional[dict]=None)
  • x_label & y_label str: specifies the x-axis & y-axis labels, respectively, that will be applied to the regression plot for the raw data points and the fitted Hill equation.

  • title str: specifies the title of the regression plot for the raw data points and the fitted Hill equation.

  • sigfigs int: specifies the number of significant figures that will be used in printed instances of the fitted Hill equation.

  • log_x bool: specifies whether the x-axis of the regression plot will be converted into a logarithmic scale.

  • generate_figure & view_figure bool: specifies whether the regression plot will be generated and printed in the Python environment, respectively.

  • print_r_sqr bool: specifies whether the coefficient of determination (R2) regression plot will be printed in the Python environment.

  • export_name & export_directory str: optionally specifies the folder and the directory to where the contents folder will be exported, where None design a unique folder name for the information in the current working directory.

  • figure bool: specifies whether a figure will be exported with the fitted content.

  • curve_fit_kws Optional[dict]: Keyword arguments to pass to scipy.optimize.curve_fit.

Accessible content

Many data sets and exported components of the fitted information are accessible through the hillfit model object.

  • top, bottom, ec50, & nH float: The fitted parameters of the Hill equation are accessible via hf.top, hf.bottom, hf.ec50, & hf.nH, respectively.

  • R2float: The coefficient of determination of the regression figure is available via hf.r_2.

  • fitted_xs & fitted_ys list: The x- and y-values of the fitted Hill equation are accessible via hf.x_fit & hf.y_fit, respectively.

  • fitted_equation str: The fitted Hill equation, in an amenable string format for the eval() built-in function of Python that allows the user to directly execute the string as a function for an “x” variable, is accessible via hf.equation.

  • figure & ax matplotlib.figure: The fig and ax objects of the regression figure are available via hf.figure & hf.ax, respectively. This allows users to edit the figures after the simulation is conducted.

  • x_data & y_data ndarray: The arrays of original data are available via hf.x_data & hf.y_data, respectively.

export()

The fitted Hill equation, with its data points and parameters, and the regression information are exported to a designated folder through the following syntax and arguments:

hf.export(export_directory=None, export_name=None, figure=True)
  • export_name & export_directory str: optionally specifies the folder and the directory to where the contents folder will be exported, where None design a unique folder name for the information in the current working directory.

  • figure bool: specifies whether a figure will be exported with the fitted content.

Execution

Hillfit is executed through the following example sequence of the aforementioned functions, which is exemplified in the example Notebook of our GitHub repository:

import hillfit
hf = hillfit.HillFit(x_data, y_data)
hf.fitting(x_label='test_x', y_label='test_y', title='Fitted Hill equation', generate_figure=False, export_name="example_contents")

Release files for hillfit 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hillfit 0.1.7
File Size Uploaded
hillfit-0.1.7.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hillfit 0.1.7
File Interpreter ABI Platform
hillfit-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 16.5 kB

Release files / hillfit-0.1.7.tar.gz

Download URL hillfit-0.1.7.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
876dd92806ed1edaa485d676ba989988d75654d3689c6dd91c5826e4875fae37
BLAKE2b-256 checksum
How to use checksums
472549d76739b54eb2cdf0a29d52c2c3ea8bbb261c2ef17de92d0e139bb8fcc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / hillfit-0.1.7-py3-none-any.whl

Download URL hillfit-0.1.7-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71f44b40c75c96124c572493f4ce0f0fd27643c095a6a55a1c830be691ab81ec
BLAKE2b-256 checksum
How to use checksums
30aedc22be670ee0a268542bb198dee86873d04a78750ce9f46078fda16af827
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page