---
title: "PvLDH Tutorial"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{PvLDH Tutorial}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
options(rmarkdown.html_vignette.check_title = FALSE)
setup <- function() {
  needed <- c("knitr", "rmarkdown", "tidyverse", "kableExtra")
  
  lapply(needed, function(pkg) {
    if (requireNamespace(pkg, quietly = TRUE)) {
      library(pkg, character.only = TRUE)
    }
  })
}

setup()
library(SeroTrackR)

knitr::opts_chunk$set(
  dpi = 72
)
```

## Data Analysis: LDH

For the LDH data analysis, follow the steps below: 

### Using Tutorial Dataset: Load the Data

We will be using the build-in files in the R package for this tutorial, as shown below. 

```{r setup 1, eval=FALSE}
library(SeroTrackR)
library(tidyverse)

your_raw_data <- system.file("extdata", "example_BioPlex_PvLDH_plate1.csv", package = "SeroTrackR")
your_plate_layout <- system.file("extdata", "example_platelayout_1.xlsx", package = "SeroTrackR")
```

To run your OWN data, follow the code below and uncomment (i.e., remove the hashtags): 

```{r exec=FALSE, eval=FALSE}
your_raw_data <- "PATH/TO/YOUR/FILE/plate1.csv"
your_plate_layout <- "PATH/TO/YOUR/FILE/plate_layout.xlsx"
```

### Run Pipeline 

```{r example code for LDH, eval=FALSE}
runLDHpipeline(
  raw_data = your_raw_data,
  plate_layout = your_plate_layout,
  platform = "bioplex",                               # Defaults to "bioplex" but "magpix" also works
  file_path = NULL                                    # Defaults to current folder/working directory
)
```

