PKbioanalysis

R-CMD-check

CRAN version CRAN total downloads CRAN monthly downloads

PKbioanalysis is a comprehensive R package designed to streamline pharmacokinetic (PK) and bioanalytical workflows from study design through data analysis and reporting. Built on regulatory best practices and FAIR principles, it provides an integrated solution for managing bioanalytical experiments with persistent data storage, interactive visualizations, and AI-assisted quality control.


โœจ Key Features

๐Ÿ“Š Study Management & Design

๐Ÿงช Bioanalytical Workflows

๐Ÿ“ˆ Data Analysis & Export

๐Ÿค– AI Capabilities


๐Ÿ“ฆ Installation

GUI-Only Installation (No Coding Required)

PKbioanalysis provides modular Shiny applications for study management (study_app()), chromatography processing (chrom_app()), and quantification (quant_app()). These run locally with persistent data storage.

Windows Users

  1. Download the installer and shortcuts from Google Drive
  2. Run install_PKbioanalysis.bat to install the package
  3. Use the desktop shortcuts:

R Package Installation

For users comfortable with R programming:

Stable Release (CRAN)

install.packages("PKbioanalysis")

Development Version (GitHub)

# Install remotes if needed
install.packages("remotes")

# Install PKbioanalysis from GitHub
remotes::install_github("OmarAshkar/PKbioanalysis")

Optional: Python Dependencies

For advanced chromatography file parsing (Waters .raw files):

PKbioanalysis::install_py_dep()

This creates a virtual environment with required Python packages (pandas, rainbow-api, numpy, scipy).

๐Ÿš€ Quick Start

library(PKbioanalysis)

# Study design and management
study_app()

# Chromatogram integration
chrom_app()

# Quantification, linearity assessment, residual error estimation, and PK dataset generation
quant_app()

๐Ÿค– AI Capabilities & Configuration

PKbioanalysis integrates AI-powered quality assessment and decision support throughout the bioanalytical workflow.

Supported AI Features

1. Automated Chromatogram Integration

2. Linearity Assessment Assistant

3. Suitability Evaluation

4. Study Design Review

5. Plate Design Optimization

6. Injection List Quality Control

AI Configuration

PKbioanalysis uses OpenAI-compatible APIs (including local models via Ollama or cloud providers).

Setup via GUI

  1. Launch any app (study_app(), chrom_app(), or quant_app())
  2. Click the โš™๏ธ Configure Settings button
  3. Enter your configuration:

Setup Programmatically

# Update configuration
PKbioanalysis::update_config(
  base_url = "https://api.openai.com/v1",
  api_key = Sys.getenv("OPENAI_API_KEY"),  # Or set in .Renviron
  model = "gpt-4",
  temperature = 0.5
)

# Refresh to apply changes
PKbioanalysis::refresh_config()

# Check current settings
PKbioanalysis::get_pkbioanalysis_option("ai_model")

Supported Models

The package supports any OpenAI-compatible model, including: - OpenAI: gpt-4, gpt-3.5-turbo - Open-source via Ollama/LM Studio: llama-3.1-70b-instruct, mistral-7b-instruct, codestral-22b - Cloud providers: gemma-3-27b-it, granite-3.3-8b-instruct

Environment Variables (Alternative Setup)

# In .Renviron file
OPENAI_API_KEY=your_api_key_here

Using Local Models (Privacy-First)

For organizations requiring data privacy: 1. Install Ollama or LM Studio 2. Download a model (e.g., ollama pull llama3.1:70b) 3. Configure PKbioanalysis:

update_config(
  base_url = "http://localhost:11434/v1",  # Ollama default
  api_key = "not-needed",  # Local models don't need keys
  model = "llama3.1:70b"
)

AI Usage Tips

Documentation & Resources

Architecture

PKbioanalysis uses a relational database (DuckDB) to maintain study integrity:

Study Design โ†’ Plate Design โ†’ Injection Sequences โ†’ Chromatography โ†’ Quantification
     โ†“              โ†“                 โ†“                   โ†“              โ†“
  Subjects      Samples           File List           Peak Data    Concentrations
     โ†“              โ†“                 โ†“                   โ†“              โ†“
  Dosing         Metadata          Database           Linearity      PK Datasets

License

AGPL-3.0 or later. See details.