diff --git a/.gitignore b/.gitignore index ec17d0c2..cfbb2dd4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ inst/templates inst/shiny/data !inst/shiny/data/DummyRO_ADNCA.csv !inst/shiny/data/adnca_labels.csv -.Rprofile \ No newline at end of file +.Rprofile +/page \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 093c27af..b7aee0f6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -75,4 +75,4 @@ Suggests: testthat (>= 3.0.0) Config/testthat/edition: 3 Language: en-US -URL: https://pharmaverse.github.io/aNCA/ +URL: https://pharmaverse.github.io/aNCA/, https://github.com/pharmaverse/aNCA diff --git a/README.md b/README.md index 11a61a4e..cd982659 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,90 @@ -# automated Non-Compartmental Analysis (aNCA) -aNCA logo dark bg -aNCA logo light bg - +# automated Non-Compartmental Analysis (aNCA) +aNCA logo dark bgaNCA logo light bg -[](https://pharmaverse.org) + +[![Pharmaverse](https://pharmaverse.org/shields/aNCA.svg)](https://pharmaverse.org) [![License](https://img.shields.io/badge/License-Apache_2.0-yellow.svg)](https://opensource.org/licenses/Apache-2.0) [![CRAN status](https://www.r-pkg.org/badges/version/aNCA)](https://CRAN.R-project.org/package=aNCA) [![R build status](https://github.com/pharmaverse/aNCA/actions/workflows/main.yml/badge.svg)](https://github.com/pharmaverse/aNCA/actions) [![RStudio community](https://img.shields.io/badge/community-shiny-blue?style=social&logo=rstudio&logoColor=75AADB)](https://forum.posit.co/new-topic?category=shiny&tags=shiny) - -
+ -> Our aim is to develop and share an open-source R Shiny application for performing Non-Compartmental Analysis (NCA) on clinical and non-clinical datasets worldwide and across pharmaceutical companies. +
-
+> Our aim is to develop and share an open-source R Shiny application for performing Non-Compartmental Analysis (NCA) on clinical and non-clinical datasets worldwide and across pharmaceutical companies. +
## Description This application enables users to upload their datasets and perform Non-Compartment Analysis (NCA) on both pre-clinical and clinical datasets, with the results being easily visualizable. Designed with user-friendliness in mind, this app aims to make NCA accessible and straightforward for all scientists. Among the features it currently possess, the App can: -* **Customize half life calculation**: Either by rule settings definitions or performing manual in-plot adjustments -* **Define AUC intervals of interest**: Providing by default last and to-infinite calculations -* **Visualize data and results** with interactive boxplots, summary statistic tables and scatter plots -* **Produce PP and ADPP** dataset formats of the resulting parameters -* **Save your analysis settings** and reupload them later to keep on analysing! +- **Customize half life calculation**: Either by rule settings definitions or performing manual in-plot adjustments +- **Define AUC intervals of interest**: Providing by default last and to-infinite calculations +- **Visualize data and results** with interactive boxplots, summary statistic tables and scatter plots +- **Produce PP and ADPP** dataset formats of the resulting parameters +- **Save your analysis settings** and reupload them later to keep on analysing! ## Installation + ### Via pak (recommended) + We recommend using [pak](https://github.com/r-lib/pak) for package installation, along with all system dependencies. If you do not have `pak` available, you will need to set it up first: + ```R install.packages("pak") ``` -then you can install [aNCA](.) by running: + +then you can install [aNCA](.) by running: + ```R pak::pak("pharmaverse/aNCA") ``` + in your R console. ### Via cloning the repository (for contributors) + Alternatively, you can set up the package by cloning the repository through your terminal/shell: + ```bash git clone https://github.com/pharmaverse/aNCA.git ``` + and then loading it directly using [devtools](https://github.com/r-lib/devtools) in your IDE (e.g. RStudio) console: + ```R devtools::load_all() ``` ## Quick start + To run the application, simply invoke: + ```R aNCA::run_app() ``` The testing data will be automatically loaded upon application startup. You can provide your own dataset in the **data** tab. Here you can also specify pre-processing filters. -In the **NCA** tab, start off by loading the pre-processed data using *Submit* button. You will also need to choose dose number in the *Settings*. Then, you will be able to run the NCA analysis. From there, you can also specify different analysis options, like applying flag rule sets and selecting slopes. +In the **NCA** tab, start off by loading the pre-processed data using _Submit_ button. You will also need to choose dose number in the _Settings_. Then, you will be able to run the NCA analysis. From there, you can also specify different analysis options, like applying flag rule sets and selecting slopes. After the setup is done and analysis is performed, you are free to explore the results in the **Outputs** tab. Application supports various customizable plots, as well as report exporting. -For more detailed instructions, you can find a pdf guide [here](docs/aNCA-User-Guide.pdf) in the docs folder. +For more detailed instructions, check out the [Get Started](https://pharmaverse.github.io/aNCA/articles/aNCA.html) page. + +## Contributing + +### As developer -## Contributing -### As developer To ensure a clean codebase and smooth cooperation, please adhere to the [contributing guidelines](CONTRIBUTING.md). -### As user +### As user + Feel free to open identified [issues](https://github.com/pharmaverse/aNCA/issues/new/choose), to reach out to us for questions or report in our [google sheet](https://forms.gle/c9ULTTv1s75yRaLj7) for feedback. ## Documentation and references -* Please go to [our Website](https://pharmaverse.github.io/aNCA/) for further information on the **aNCA app** (still in development). -* The main package used by the App is `PKNCA`. You can find more of it on its [GitHub](https://github.com/billdenney/pknca) - +- Please go to [our Website](https://pharmaverse.github.io/aNCA/) for further information on the **aNCA app** (still in development). +- The main package used by the App is `PKNCA`. You can find more of it on its [GitHub](https://github.com/billdenney/pknca) diff --git a/_pkgdown.yml b/_pkgdown.yml deleted file mode 100644 index 7eb512b8..00000000 --- a/_pkgdown.yml +++ /dev/null @@ -1,3 +0,0 @@ -template: - bootstrap: 5 -url: "https://pharmaverse.github.io/aNCA/" diff --git a/docs/aNCA-User-Guide.pdf b/docs/aNCA-User-Guide.pdf deleted file mode 100644 index 37cfa2a1..00000000 Binary files a/docs/aNCA-User-Guide.pdf and /dev/null differ diff --git a/inst/WORDLIST b/inst/WORDLIST index f0d5b7c1..08d99686 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,19 +1,35 @@ ADNCA +ADOSEDUR ADPP +AFRLT +ANALYTE +ARRLT AUClast +AVAL +AVALU +Analyte Bärtschi CDISC DOSEA +DOSEU DOSNO +IXrange NCA +NFRLT +NRRLT +PCSPEC PKNCA PKNCAdata PKNCAdose Pharmacokinetic +Pharmaverse Pre RO +RRLTU RStudio +STUDYID TLG +TRT USUBJID USUBJIDs YAML @@ -28,8 +44,10 @@ csv customizable devtools df +extravascular ggplot ggplots +intravascular lastdose nca pak diff --git a/man/figures/aNCA_logo.png b/man/figures/aNCA_logo.png new file mode 100644 index 00000000..001ee779 Binary files /dev/null and b/man/figures/aNCA_logo.png differ diff --git a/man/figures/aNCA_logo_bbg.png b/man/figures/aNCA_logo_bbg.png new file mode 100644 index 00000000..ac0f3a2b Binary files /dev/null and b/man/figures/aNCA_logo_bbg.png differ diff --git a/man/figures/aNCA_logo_wbg.png b/man/figures/aNCA_logo_wbg.png new file mode 100644 index 00000000..5565bf1c Binary files /dev/null and b/man/figures/aNCA_logo_wbg.png differ diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml new file mode 100644 index 00000000..b02a4539 --- /dev/null +++ b/pkgdown/_pkgdown.yml @@ -0,0 +1,7 @@ +template: + bootstrap: 5 + light-switch: true +navbar: + structure: + right: [search, github, lightswitch] +url: "https://pharmaverse.github.io/aNCA/" diff --git a/pkgdown/extra.css b/pkgdown/extra.css new file mode 100644 index 00000000..d3e6c532 --- /dev/null +++ b/pkgdown/extra.css @@ -0,0 +1,54 @@ +body { + text-align: justify; +} + +blockquote::before { + font-weight: bold; +} + +blockquote.note { + border-color: #1f6feb; + &::before { + content: "ℹ️ Note: "; + } +} + +blockquote.important { + border-color: #9e6a03; + &::before { + content: "⚠️ Important: "; + } +} + +blockquote.warning { + border-color: #da3633; + &::before { + content: "🚨 Warning: "; + } +} + +p > img { + border-radius: 1.5em; + padding: 1em; + margin: 1em 0; +} + +html[data-bs-theme="light"] { + & p > img { + box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2); + } + + #package-logo-dark { + display: none; + } +} + +html[data-bs-theme="dark"] { + #package-logo-light { + display: none; + } +} + +#package-logo-light { + box-shadow: none; +} \ No newline at end of file diff --git a/vignettes/aNCA.Rmd b/vignettes/aNCA.Rmd new file mode 100644 index 00000000..25dc62f5 --- /dev/null +++ b/vignettes/aNCA.Rmd @@ -0,0 +1,157 @@ +--- +title: "aNCA Shiny App User Guide" +description: > + Learn how to get started with the basics of aNCA Shiny application. +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{aNCA Shiny App User Guide} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +This guide will provide users with information on how to get started with the aNCA app. + +# Step 1: Prepare Dataset +### Uploading a dataset +Click *Upload File* and select the dataset you would like to use. The data must be in `.csv` or `.rds` format. The best input for the app is data that follows the ADNCA format. Other formats of data will also work. + +Data upload + +### Data format +| | **Variable** | **Description** | **Format** | +|--------------------------|--------------|--------------------------------------------------------------------|-------------------| +| | STUDYID | Study Identifier | character | +| **Grouping Identifiers** | USUBJID | Unique Subject Identifier | character/numeric | +| | TRT01A | Treatment Group Identifier (Actual) | character | +| | TRT01P | Treatment Group Identifier (Planned) | character | +| | AGE | Age of Subject | numeric | +| | RACE | Race pf Subject | character | +| | SEX | Sex of Subject | character | +| **Sample variables** | ANALYTE | Analyte | character | +| | PCSPEC | Specimen Material Type | character | +| | AVAL | Analysis Value | numeric | +| **Dose Variables** | DOSNO | Dose Number | numeric | +| | ROUTE | Route of Administration, either {intravascular} or {extravascular} | character | +| | DOSEA | Actual Treatment Dose | numeric | +| | ADOSEDUR | Actual Treatment Dose | numeric | +| **Time Variables** | AFRLT | Actual Relative Time from Analyte First Dose | numeric | +| | ARRLT | Actual Relative Time from Reference Dose | numeric | +| | NFRLT | Nominal Relative Time from Analyte First Dose | numeric | +| | NRRLT | Nominal Relative Time from Reference Dose | numeric | +| | AVALU | Analysis Value Unit | character | +| | DOSEU | Treatment Dose Units | character | +| | RRLTU | Relative Time from Reference Dose Unit | character | + +### Data mapping +Once the dataset has been uploaded, you can verify that the data is as expected, and click on the *Mapping and Filters* tab. + - Map the correct columns in your dataset to the corresponding label. For more information on what the column requires, hover over the input boxes. + - For Unit Variables, if your dataset has a defined column for units, select it. Otherwise manually input the units for the corresponding columns. + - Click *Submit Mapping*. You will be automatically directed to the next tab. + +Mapping tab +Mapping + +### Verifying adding filters +Check that the data contains all the information you were expecting and is mapped correctly. If you want to change the data by adding filters, return to the *Mapping and Filters* page, then scroll down to add filters. + +Adding filters + +
+Don’t forget to scroll down and click submit! +
+ +Submitting filters + +# Step 2: Run NCA +Click on the *NCA* tab at the top of the screen to switch to the next section. + +## Data selection +1. Choose the analyte you would like to run the NCA on (it is currently only possible to analyze one analyte at a time). +2. Click *Submit* and check that the data is as expected. + +
+The current version of the app only works with one matrix (PCSPEC) at a time. If you are having problems when clicking *Submit*, ensure that your data has been filtered to fit these specifications. You can return to the *Mapping and Filtering* tab in *Data* to do this. +
+ +NCA tab + +3. Move to *Settings* in the menu on the left hand side. Choose the Dose Number(s) you would like to run the NCA on and the extrapolation method. Select additional options including partial AUCs, or rule sets to flag the data. + +NCA settings + +4. Click *Run NCA*. You will automatically be redirected to the *Results* tab. + +Running NCA + +# Step 3: NCA Results +## Main Results +The NCA results tab shows the individual results of the NCA. You can select which parameters you would like to view. Results in red have been flagged as *False* for the rule sets selected, results in purple are flagged as *Missing*, and results in white are not flagged. + +Click on the *Slopes* tab to view more detailed information about the slopes selected in the NCA. + +In *Parameter datasets* you can see and export the ADPP and PP datasets. + +## Exclusions and Manual Slopes +To add exclusions or manual slope selections, redirect to the *Slope Selector* tab in the *Setup* page. + +Slope selection + +There are two different ways to add exclusions/selections to the slopes. + +#### Via the Buttons. +1. Click *+ Exclusion/Selection* +2. Input required information: Type, Patient, Profile, Range, Reason. IXrange is the Data Point number in the slope, which can be seen by hovering over the points in the plots below. + +Slope selection buttons + +3. To remove, select the sample row and click *-Remove selected rows* + +Removing selections + +#### Via the Plots +For in-app guidance, you can click the ? button. + +1. For selection, click the first point and then the last point you want included in the slope. The plot should then update and a row should be added to the table. There you can add your reason for selection. +2. For exclusion, double click the point you want to exclude. The plot should update along with the table. +3. To remove, either remove via the table selection, or repeat the same action (i.e. select a new slope, double click the same point). + +Slope plots + +#### Applying the exclusions +Once the exclusions/selections have been added, click *Apply*. + +Applying exlusions/selections + +You can check if they have been applied in the *Results* -> *Exclusions* tab. + +Inspecting exlusions/selections + +
+If you do not click *Apply*, the manual slopes will not be added! +
+ +## Saving and uploading settings +After completing an NCA and creating manual slopes, you may want to save these for next time. + +#### Saving +Click *Results* -> *NCA Results* -> *Save Project* Settings. This will download a .csv file. + +Saving settings + +#### Uploading +To upload settings next time, after column mapping, *Setup* -> *Data Selection* -> *Upload* settings. The inclusions and exclusions will be automatically added to the data. + +Uploading settings + +## Step 4: Visualization +In the *Visualization* tab, you will find the different visualization options, including individual plots, mean plots, descriptive statistics, and boxplots. + +
+Currently work in progress +
+ +## Step 5: TLG +
+Currently work in progress +
+ diff --git a/vignettes/images/get_started/01.png b/vignettes/images/get_started/01.png new file mode 100644 index 00000000..95df9b59 Binary files /dev/null and b/vignettes/images/get_started/01.png differ diff --git a/vignettes/images/get_started/02.png b/vignettes/images/get_started/02.png new file mode 100644 index 00000000..faa90525 Binary files /dev/null and b/vignettes/images/get_started/02.png differ diff --git a/vignettes/images/get_started/03.png b/vignettes/images/get_started/03.png new file mode 100644 index 00000000..62d6ee03 Binary files /dev/null and b/vignettes/images/get_started/03.png differ diff --git a/vignettes/images/get_started/04.png b/vignettes/images/get_started/04.png new file mode 100644 index 00000000..7e47e036 Binary files /dev/null and b/vignettes/images/get_started/04.png differ diff --git a/vignettes/images/get_started/05.png b/vignettes/images/get_started/05.png new file mode 100644 index 00000000..9da87599 Binary files /dev/null and b/vignettes/images/get_started/05.png differ diff --git a/vignettes/images/get_started/06.png b/vignettes/images/get_started/06.png new file mode 100644 index 00000000..5424fdad Binary files /dev/null and b/vignettes/images/get_started/06.png differ diff --git a/vignettes/images/get_started/07.png b/vignettes/images/get_started/07.png new file mode 100644 index 00000000..f5a39394 Binary files /dev/null and b/vignettes/images/get_started/07.png differ diff --git a/vignettes/images/get_started/08.png b/vignettes/images/get_started/08.png new file mode 100644 index 00000000..08188426 Binary files /dev/null and b/vignettes/images/get_started/08.png differ diff --git a/vignettes/images/get_started/09.png b/vignettes/images/get_started/09.png new file mode 100644 index 00000000..e6a6ecda Binary files /dev/null and b/vignettes/images/get_started/09.png differ diff --git a/vignettes/images/get_started/10.png b/vignettes/images/get_started/10.png new file mode 100644 index 00000000..be67cc5a Binary files /dev/null and b/vignettes/images/get_started/10.png differ diff --git a/vignettes/images/get_started/11.png b/vignettes/images/get_started/11.png new file mode 100644 index 00000000..f4b806ec Binary files /dev/null and b/vignettes/images/get_started/11.png differ diff --git a/vignettes/images/get_started/12.png b/vignettes/images/get_started/12.png new file mode 100644 index 00000000..a75e7648 Binary files /dev/null and b/vignettes/images/get_started/12.png differ diff --git a/vignettes/images/get_started/13.png b/vignettes/images/get_started/13.png new file mode 100644 index 00000000..b4b4ac8c Binary files /dev/null and b/vignettes/images/get_started/13.png differ diff --git a/vignettes/images/get_started/14.png b/vignettes/images/get_started/14.png new file mode 100644 index 00000000..410c5a4c Binary files /dev/null and b/vignettes/images/get_started/14.png differ diff --git a/vignettes/images/get_started/15.png b/vignettes/images/get_started/15.png new file mode 100644 index 00000000..76db0303 Binary files /dev/null and b/vignettes/images/get_started/15.png differ diff --git a/vignettes/images/get_started/16.png b/vignettes/images/get_started/16.png new file mode 100644 index 00000000..7e78dc60 Binary files /dev/null and b/vignettes/images/get_started/16.png differ