From 184a752ac66cf1a6dbb27e56e96e9c2daa7fe107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tymoteusz=20Kwieci=C5=84ski?= <31191783+Fersoil@users.noreply.github.com> Date: Tue, 2 Jul 2024 18:35:33 +0200 Subject: [PATCH] website for docs (#8) * add sample vignette and artificial dataset * pkgdown workflow --------- Co-authored-by: Fersoil --- .github/workflows/pkgdown.yaml | 50 ++++++++++++++++++++ inst/extdata/artificial_plate.csv | 62 +++++++++++++++++++++++++ vignettes/example_script.Rmd | 77 +++++++++++++++++++++++++++++++ 3 files changed, 189 insertions(+) create mode 100644 .github/workflows/pkgdown.yaml create mode 100644 inst/extdata/artificial_plate.csv create mode 100644 vignettes/example_script.Rmd diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 00000000..05540872 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,50 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main] + pull_request: + branches: [main] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs \ No newline at end of file diff --git a/inst/extdata/artificial_plate.csv b/inst/extdata/artificial_plate.csv new file mode 100644 index 00000000..012fcc06 --- /dev/null +++ b/inst/extdata/artificial_plate.csv @@ -0,0 +1,62 @@ +Program,xPONENT,,MAGPIX,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Build,3.1.871.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Date,01/07/2024,00:00,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +SN,PvSTATEM1234,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Batch,test_plate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Version,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Operator,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +ComputerName,test,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Country Code,616,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +ProtocolName,test,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +ProtocolVersion,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Most Recent Calibration and Verification Results:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Last VER Calibration,Passed 01/07/2024 00:00:00,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Last CAL Calibration,Passed 01/07/2024 00:00:00,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Last Fluidics Test,Passed 01/07/2024 00:00:00,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +CALInfo:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Calibrator,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Lot,ExpirationDate,CalibrationTime,DDTemp,CL1Temp,CL2Temp,DDVolts,CL1Volts,CL2Volts,DDRVal,CL1RVal,CL2RVal,Result,MachineSerialNo,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Samples,8,Min Events,50,Per Bead,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Results,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +DataType:,Median,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Location,Sample,Etramp5_ag1,Etramp4_ag1,AMA1 +1(1,A1),BLANK,20, 21, 23 +2(1,B1),test1,1292,1389,1414 +3(1,C1),test2,1430,1435, 867 +4(1,D1),test3,657,2031,1300 +5(1,E1),CP3 1/50,1486,1437,1893 +6(1,F1),CP3 1/250,130,87,90 +7(1,G1),CP3 1/1250,78,67,64 +8(1,H1),CP3 1/6250, 65,60,64 +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +DataType:,Count,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Location,Sample,Etramp5_ag1,Etramp4_ag1,AMA1 +1(1,A1),BLANK,100,121,143 +2(1,B1),test1,102,104,105 +3(1,C1),test2,130,135, 67 +4(1,D1),test3,57,231,100 +5(1,E1),CP3 1/50,86,37,193 +6(1,F1),CP3 1/250,130,87,90 +7(1,G1),CP3 1/1250,53,47,65 +8(1,H1),CP3 1/6250, 85,50,54 +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +DataType:,Per Bead Count,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Alyte:,Etramp5_ag1,Etramp4_ag1,AMA1 +BeadID:,73,75,34 +Per Bead:,50,50,50, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +DataType:,Audit Logs,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +UserId,Date,Message,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +DataType:,Warnings/Errors,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Location,Status,Message,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +-- CRC --,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +CRC32: 85C2BFCD,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/vignettes/example_script.Rmd b/vignettes/example_script.Rmd new file mode 100644 index 00000000..1ac5db3d --- /dev/null +++ b/vignettes/example_script.Rmd @@ -0,0 +1,77 @@ +--- +title: "Simple example of basic PvSTATEM package pre-release version functionalities" +author: "Tymoteusz Kwieciński" +date: "`r Sys.Date()`" +output: rmarkdown::html_document +vignette: > + %\VignetteIndexEntry{Simple example of basic PvSTATEM package pre-release version functionalities} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set( + collapse = FALSE, + comment = "#>", + warning = FALSE, + message = FALSE +) +``` + +# Introduction +The basic functionality of the `PvSTATEM` package is reading raw MBA data. To present the functionalities of the package, we created a simple, artificial `csv` file, which is pre-loaded into the package. + +```{r} +library(PvSTATEM) + +plate_filepath <- system.file("extdata", "artificial_plate.csv", package = "PvSTATEM", mustWork = TRUE) # get the filepath of the csv dataset + + +plate <- read_data(plate_filepath) # read the data + +``` + +After the plate is successfully loaded, we can look into some basic information about the plate. + +```{r} + + +plate$summary() + +plate$get_sample(1) +plate$get_sample_by_type("POSITIVE CONTROL")[[1]] + +plate$sample_names +plate$analyte_names +``` + + + +## Warnings +Our scripts are designed to catch potential errors in the data. If there are any warnings, they will be stored in the `warnings` field of the plate object. The warnings can be accessed by the `$warnings` field of the plate object or by the `$warnings` field of the sample object. + +```{r} +```{r} +## warnings ---------------------------------------------------------------- + +plate$warnings + +plate$get_sample(1)$warnings + +plate$get(analyte = "AMA1", sample = 1) + +plate$get_sample_by_type("POSITIVE CONTROL")[[1]]$warnings +``` + + + +## simple standard curve plotting +```{r} +plot_standard_curve_antibody(plate, antibody_name = "AMA1") + +plate$blank_adjustment() + +plot_standard_curve_antibody(plate, antibody_name = "AMA1") + + +```