BioEq
A Python package for performing bioequivalence calculations and analysis.
Overview
BioEq is a comprehensive Python package for analyzing pharmacokinetic data in bioequivalence studies. It provides methods for processing and analyzing data from both crossover and parallel design bioequivalence studies.
Features
-
Crossover 2x2 Design Analysis:
- Calculation of AUC, Cmax, Tmax, and other PK parameters
- ANOVA and mixed effects model analysis
- Point estimates and 90% confidence intervals for bioequivalence assessment
-
Parallel Design Analysis:
- Calculation of PK parameters for parallel group studies
- ANOVA and t-test analysis
- Point estimates and 90% confidence intervals
-
Replicate Crossover Design Analysis:
- Support for both partial (3-way) and full (4-way) replicate designs
- Within-subject variability assessment for reference formulation
- Reference-scaled average bioequivalence (RSABE) for highly variable drugs
- Expanded bioequivalence limits based on reference variability
-
Additional Features:
- Estimation of elimination half-life
- Extrapolation of AUC to infinity
- Summary statistics for PK parameters
- Data visualization tools
- Flexible data input/output handling
Installation
pip install bioeq
Quick Start
import polars as pl
from bioeq import Crossover2x2
# Load your data
data = pl.read_csv("your_data.csv")
# Initialize analyzer
analyzer = Crossover2x2(
data=data,
subject_col="SubjectID",
seq_col="Sequence",
period_col="Period",
time_col="Time",
conc_col="Concentration",
form_col="Formulation"
)
# Calculate point estimate and confidence intervals
results = analyzer.calculate_point_estimate("log_AUC")
print(f"Point Estimate: {results['point_estimate']:.2f}%")
print(f"90% CI: {results['lower_90ci']:.2f}% - {results['upper_90ci']:.2f}%")
Replicate Crossover Example
import polars as pl
from bioeq import ReplicateCrossover
# Load data for a partial replicate (3-way) design
data = pl.read_csv("replicate_data.csv")
# Initialize analyzer for a partial replicate design
analyzer = ReplicateCrossover(
data=data,
design_type="partial", # Use "full" for 4-way replicate design
subject_col="SubjectID",
seq_col="Sequence",
period_col="Period",
time_col="Time",
conc_col="Concentration",
form_col="Formulation"
)
# Calculate within-subject CV for the reference product
cv_results = analyzer.calculate_within_subject_cv("log_AUC")
print(f"Within-subject CV for reference: {cv_results['cv_percent']:.2f}%")
# If drug is highly variable (CV ≥ 30%), run reference-scaled approach
if cv_results['cv_percent'] >= 30:
rsabe_results = analyzer.run_rsabe("log_AUC")
print(f"RSABE criterion met: {rsabe_results['rsabe_criterion_met']}")
print(f"Expanded BE limits: {rsabe_results['lower_scaled_limit']:.2f}% - {rsabe_results['upper_scaled_limit']:.2f}%")
else:
# Use standard bioequivalence approach
print("Standard bioequivalence assessment recommended (CV < 30%)")
Documentation
Comprehensive documentation is available in the docs directory:
-
Regulatory Documentation:
-
Developer Documentation:
-
Bioequivalence Notes:
For a complete overview of the documentation, see the docs README.
Validation and Regulatory Compliance
BioEq is designed with regulatory requirements in mind. The package includes:
- Validation Module: Built-in functionality to validate calculations against known values
- Traceability: Documentation mapping requirements to implementation
- Algorithm Documentation: Detailed descriptions of implemented methods with scientific references
- Regulatory References: Documentation linking to relevant FDA guidance documents
Running Validation Tests
To validate the package calculations:
# Run the built-in validation suite
bioeq validate --output validation_report.json
Requirements
- Python ≥ 3.10
- Polars ≥ 1.18.0
- NumPy ≥ 2.2.1
- SciPy ≥ 1.15.0
- Statsmodels ≥ 0.14.4
- PyArrow ≥ 19.0.0
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for bioeq 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bioeq-0.1.4.tar.gz | 19.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bioeq-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.7 kB
Release files / bioeq-0.1.4.tar.gz
| Download URL | bioeq-0.1.4.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a4df99705cb8aa03af854c6ec20cfaf83a7dd7f7992a62c9ab5cdfc5eaa12ab
|
|
BLAKE2b-256 checksum How to use checksums |
8fa514b0f436b6e7b4a7fc0157a0c60a64b6a5b43e78c41e8472a92de7548bb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.11.11 Linux/6.8.0-1021-azure
|
Release files / bioeq-0.1.4-py3-none-any.whl
| Download URL | bioeq-0.1.4-py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e999b679e21281ed309c94d711e3d270c0328491162a57f6c2042a66cd4cb7d
|
|
BLAKE2b-256 checksum How to use checksums |
621fdc8172eb3663efa8cba20ba017c56f93ce949d48715cbb2435c5d12aae75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.11.11 Linux/6.8.0-1021-azure
|