Skip to main content

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:

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.

Download files

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

Source Distribution

bioeq-0.1.4.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

bioeq-0.1.4-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file bioeq-0.1.4.tar.gz.

File metadata

  • Download URL: bioeq-0.1.4.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.11 Linux/6.8.0-1021-azure

File hashes

Hashes for bioeq-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4a4df99705cb8aa03af854c6ec20cfaf83a7dd7f7992a62c9ab5cdfc5eaa12ab
MD5 44b462f5af8b45e34148d767f24951a1
BLAKE2b-256 8fa514b0f436b6e7b4a7fc0157a0c60a64b6a5b43e78c41e8472a92de7548bb7

See more details on using hashes here.

File details

Details for the file bioeq-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: bioeq-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.11 Linux/6.8.0-1021-azure

File hashes

Hashes for bioeq-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0e999b679e21281ed309c94d711e3d270c0328491162a57f6c2042a66cd4cb7d
MD5 c74a28b1615b6a11b5d942f4922a8283
BLAKE2b-256 621fdc8172eb3663efa8cba20ba017c56f93ce949d48715cbb2435c5d12aae75

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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