packages
library(knitr)
library(readxl)
#detach(package:plyr)
library(dplyr)
library(ggplot2)
library(reshape2)
library(stringr)
library(kableExtra)
set.seed(100)
upload files
path<-"/Users/kylielanglois/OneDrive - SCCWRP/eDNA citrus"
dat<-read.csv(file.path(path, "2026-03-03 gPie.csv"))
check negative and positive controls
## [1] "NTC positive droplets: 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0"
| Sample | Target | dilution | Positives | Negatives | Total |
|---|---|---|---|---|---|
| GBLOCK | gPie | 1e+04 | 38129 | 3917 | 42046 |
| GBLOCK | gPie | 1e+06 | 9615 | 33678 | 43293 |
| TISSUE | gPie | 1e+00 | 36961 | 0 | 36961 |
| TISSUE | gPie | 1e+02 | 33612 | 4543 | 38155 |
| TISSUE | gPie | 1e+06 | 2 | 35996 | 35998 |
#convert to per microliter-------
dat1.m$Conc.copies.µL.<-as.numeric(as.character(dat1.m$Conc.copies.µL.))
dat1.m$Copies.ul<-((dat1.m$Conc.copies.µL.*20)/
dat1.m$Template.uL)*dat1.m$dilution
dat1.m$PoissConfMaxcopiesperµL<-((dat1.m$PoissonConfMax*20)/
dat1.m$Template.uL)*dat1.m$dilution
dat1.m$PoissConfMincopiesperµL<-((dat1.m$PoissonConfMin*20)/
dat1.m$Template.uL)*dat1.m$dilution
#convert to different metrics--------
dat1.m$LOQ.Conc.<--log(1-(3/dat1.m$Accepted.Droplets))/drop.size
dat1.m$LOQ.ul<-(dat1.m$LOQ.Conc.*20)/dat1.m$Template.uL
#flag if under LOQ-----------
dat1.m$underLOQ<-ifelse(dat1.m$Copies.ul<dat1.m$LOQ.ul, "under LOQ", "")
#confidence68--------
dat1.m$TotalConfidenceMin68perµL<-
((dat1.m$TotalConfidenceMin68*20)/dat1.m$Template.uL)*dat1.m$dilution
dat1.m$TotalConfidenceMax68perµL<-
((dat1.m$TotalConfidenceMax68*20)/dat1.m$Template.uL)*dat1.m$dilution