{"id":26376328,"url":"https://github.com/nanhung/pksensi","last_synced_at":"2025-03-17T03:16:57.501Z","repository":{"id":56934801,"uuid":"130850362","full_name":"nanhung/pksensi","owner":"nanhung","description":"An R package for applying global sensitivity analysis in physiologically based kinetic modeling","archived":false,"fork":false,"pushed_at":"2024-11-27T17:35:13.000Z","size":2533,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-09T03:49:04.325Z","etag":null,"topics":["gnu-mcsim","pharmacokinetics","r","r-package","rstats","sensitivity","sensitivity-analysis"],"latest_commit_sha":null,"homepage":"https://nanhung.github.io/pksensi/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nanhung.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-24T12:25:27.000Z","updated_at":"2024-11-27T19:02:31.000Z","dependencies_parsed_at":"2022-08-21T00:30:08.446Z","dependency_job_id":null,"html_url":"https://github.com/nanhung/pksensi","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanhung%2Fpksensi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanhung%2Fpksensi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanhung%2Fpksensi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanhung%2Fpksensi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanhung","download_url":"https://codeload.github.com/nanhung/pksensi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965780,"owners_count":20375920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnu-mcsim","pharmacokinetics","r","r-package","rstats","sensitivity","sensitivity-analysis"],"created_at":"2025-03-17T03:16:57.028Z","updated_at":"2025-03-17T03:16:57.490Z","avatar_url":"https://github.com/nanhung.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# pksensi \u003cimg src=\"man/figures/logo.png\" height=\"200px\" align=\"right\" alt=\"pksensi logo\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n[![R-CMD-check](https://github.com/nanhung/pksensi/workflows/R-CMD-check/badge.svg)](https://github.com/nanhung/pksensi/actions)\n[![Codecov test coverage](https://codecov.io/gh/nanhung/pksensi/branch/master/graph/badge.svg)](https://codecov.io/gh/nanhung/pksensi?branch=master)\n![CRAN downloads](https://cranlogs.r-pkg.org/badges/pksensi)\n\u003c!-- badges: end --\u003e\n\n**pksensi** implements the global sensitivity analysis workflow to investigate the parameter uncertainty and sensitivity in physiologically based kinetic (PK) models, especially the physiologically based pharmacokinetic/toxicokinetic  model with multivariate outputs. The package also provides some functions to check the convergence and sensitivity of model parameters.\n\nThrough **pksensi**, you can:\n\n-\tRun sensitivity analysis for PK models in R with script that were written in C or GNU MCSim.\n\n-\tDecision support: The output results and visualization tools can be used to easily determine which parameters have \"non-influential\" effects on the model output and can be fixed in following model calibration. \n\n## Installation\n\nYou can install the released version of **pksensi** from [CRAN](https://CRAN.R-project.org) with:\n\n``` r\ninstall.packages(\"pksensi\")\n```\n\nAnd the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"nanhung/pksensi\")\n```\n\n- This package includes a function that can help you install GNU MCSim more easily through the function `mcsim_install()`.\n\n- All updated details can be found in [NEWS.md](https://github.com/nanhung/pksensi/blob/master/NEWS.md).\n\n- **NOTE:** Windows users need to install [Rtools40](https://cran.r-project.org/bin/windows/Rtools/) to compile the model code.\n\n## Workflow\n\n\u003cimg src=\"man/figures/sensitivity-workflow.png\" align=\"left\" alt=\"Workflow of sensitivity analysis\" /\u003e\n\n**Note:** The parameter correlation (e.g., V~max~ and K~M~ in metabolism) might be an issue in the global sensitivity analysis. If you have experiment data, suggest using small datasets as a sample in Markov Chain Monte Carlo Simulation. Then, check correlation before conducting the sensitivity analysis. The issue will try to address in the future version. \n\n## Example\n\nThis is a basic example of applying **pksensi** in one-compartment pbtk model:\n\n```{r example}\nlibrary(pksensi)\n```\n\n### Step 1. Construct 1-cpt pbtk model\n```{r}\npbtk1cpt \u003c- function(t, state, parameters) {\n  with(as.list(c(state, parameters)), {\n    dAgutlument = - kgutabs * Agutlument\n    dAcompartment = kgutabs * Agutlument - ke * Acompartment\n    dAmetabolized = ke * Acompartment\n    Ccompartment = Acompartment / vdist * BW;\n    list(c(dAgutlument, dAcompartment, dAmetabolized), \n         \"Ccompartment\" = Ccompartment) \n  })\n}\n```\n\n\n### Step 2. Define initial conditions, output time steps and variable\n\n```{r}\ninitState \u003c- c(Agutlument = 10, Acompartment = 0, Ametabolized = 0)\nt \u003c- seq(from = 0.01, to = 24.01, by = 1)\noutputs \u003c- c(\"Ccompartment\")\n```\n\n### Step 3. Generate parameter matrix \n\n#### 3.1. (Optional) Extract parameter value from httk package\n\n```{r, message=FALSE, warning=FALSE}\nlibrary(httk)\npars1comp \u003c- (parameterize_1comp(chem.name = \"acetaminophen\"))\n```\n\n#### 3.2. Set parameter distributions\n\n```{r}\nq \u003c- c(\"qunif\", \"qunif\", \"qunif\", \"qnorm\")\nq.arg \u003c- list(list(min = pars1comp$Vdist / 2, max = pars1comp$Vdist * 2),\n              list(min = pars1comp$kelim / 2, max = pars1comp$kelim * 2),\n              list(min = pars1comp$kgutabs / 2, max = pars1comp$kgutabs * 2),\n              list(mean = pars1comp$BW, sd = 5))\n```\n\n#### 3.3. Create parameter matrix\n\n```{r}\nset.seed(1234)\nparams \u003c- c(\"vdist\", \"ke\", \"kgutabs\", \"BW\")\nx \u003c- rfast99(params, n = 200, q = q, q.arg = q.arg, replicate = 1)\n```\n\n### Step 4. Conduct simulation (will take few minutes with more replications)\n\n```{r}\nout \u003c- solve_fun(x, time = t, func = pbtk1cpt, initState = initState, outnames = outputs)\n```\n\n### Step 5. Uncertainty analysis\n\n```{r fig.alt=\"pksim plot\"}\npksim(out)  # Use to compare with \"real\" data (if any)\n```\n\n### Step 6. Check and visualize the result of sensitivity analysis\n\n```{r fig.alt=\"autoplot\"}\nplot(out)   # Visualize result\ncheck(out)  # Print result to console\n```\n\n## Citation\n\n\n```{r, comment = \"\", echo = FALSE}\ncitation(package = \"pksensi\")\n```\n\n## Reference\n\nHsieh NH, Reisfeld B, Bois FY, Chiu WA. [Applying a global sensitivity analysis workflow to improve the computational efficiencies in physiologically-based pharmacokinetic modeling](https://www.frontiersin.org/articles/10.3389/fphar.2018.00588/full). Frontiers in Pharmacology 2018 Jun; 9:588.\n\nHsieh NH, Reisfeld B, Chiu WA. [pksensi: An R package to apply global sensitivity analysis in physiologically based kinetic modeling](https://doi.org/10.1016/j.softx.2020.100609). SoftwareX 2020 Jul; 12:100609.\n\nHsieh NH, Bois FY, Tsakalozou E, Ni Z, Yoon M, Sun W, Klein M, Reisfeld B, Chiu WA. [A Bayesian population physiologically based pharmacokinetic absorption modeling approach to support generic drug development: application to bupropion hydrochloride oral dosage forms](https://doi.org/10.1007/s10928-021-09778-5). Journal of Pharmacokinetics and Pharmacodynamics 2021 Sep; 22:1-6.\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanhung%2Fpksensi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanhung%2Fpksensi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanhung%2Fpksensi/lists"}