-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
132 lines (102 loc) · 4.68 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
output: github_document
editor_options:
markdown:
wrap: 72
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/logo.png",
out.width = "100%"
)
```
# eDNAjoint
<img src="man/figures/logo.png" align="right" height="200" style="float:right; height:200px;" dpi="700"/>
<!-- badges: start -->
[![R-CMD-check](https://github.com/ropensci/eDNAjoint/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/eDNAjoint/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/ropensci/eDNAjoint/graph/badge.svg?token=AEVR9NSQ9Z)](https://codecov.io/gh/ropensci/eDNAjoint)
[![Status at rOpenSci Software Peer
Review](https://badges.ropensci.org/642_status.svg)](https://github.com/ropensci/software-review/issues/642)
[![Lifecycle:
stable](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
<!-- badges: end -->
```{r, include = FALSE}
#' @srrstats {BS1.2a} README with high-level overview and examples of specifying
#' prior distributions here
```
The package *eDNAjoint* is useful for interpreting observations from
paired or semi-paired environmental DNA (eDNA) and traditional surveys.
The package runs a Bayesian model that integrates these two data streams
to jointly estimate parameters like the false positive probability of
eDNA detection and expected catch rate at a site. Optional model
variations allow inclusion of site-level covariates that scale the
sensitivity of eDNA sampling relative to traditional sampling, as well
as estimation of catchability coefficients when multiple traditional
gear types are used. Additional functions in the package facilitate
interpretation of model fits.
<div style="text-align: center;">
<img src="man/figures/basic_diagram_final-01.png" style="height:400px;" dpi="700"/>
</div>
## Installation
The most stable version of *eDNAjoint* can be found on Cran:
```{r,eval=FALSE}
install.packages("eDNAjoint")
```
You can also install the development version of *eDNAjoint* from ROpenSci:
```{r,eval=FALSE}
install.packages("eDNAjoint", repos = "https://ropensci.r-universe.dev")
```
## Example
The main functionality in *eDNAjoint* is the use of `jointModel()` that
will fit the model to data. Further functions like `jointSummarize()`
and `detectionCalculate()` can be used to help with model fit
interpretation.
This example fits the joint model to data from paired, replicated eDNA
qPCR and seine sampling observations of endangered tidewater gobies
(*Eucyclogobius newberryi*) from a study by Schmelzle and Kinziger
(2016). The following variation of the joint model includes site-level
covariates that scale the sensitivity of eDNA sampling relative to
traditional sampling.
```{r example_1, message = FALSE, warning = FALSE, results = 'hide'}
library(eDNAjoint)
data(gobyData)
# run the joint model with two covariates
goby.fit <- jointModel(data = gobyData, cov = c('Filter_time','Salinity'),
family = 'poisson', p10priors = c(1,20), q = FALSE)
```
And then this model fit can be accessed to do things like summarize the
posterior distribution for the probability of a false positive
detection, $p_{10}$:
```{r example_2}
# summarize p10 posterior
jointSummarize(goby.fit$model, par = 'p10')
```
Or to find the number of eDNA samples and traditional survey samples
necessary to detect presence of the species at a given expected catch
rate:
```{r example_3}
# find the number of samples necessary to detect presence with 0.9 probability at the mean covariate values,
# if the expected catch rate (mu) is 0.1, 0.5, or 1 individuals/traditional survey unit.
detectionCalculate(goby.fit$model, mu = c(0.1,0.5,1),
cov.val = c(0,0), probability = 0.9)
```
## Vignette
You can find much more detailed examples of the functions in *eDNAjoint*
and the model underlying the package in the [package
vignette](https://ednajoint.netlify.app/).
## Code of Conduct
Please note that eDNAjoint is released with a [Contributor Code of
Conduct](https://ropensci.org/code-of-conduct/). By contributing to this
project you agree to abide by its terms.
## References
Keller, A.G., Grason, E.W., McDonald, P.S., Ramon-Laca, A., Kelly, R.P.
(2022). Tracking an invasion front with environmental DNA. *Ecological
Applications*. 32(4): e2561. <https://doi.org/10.1002/eap.2561>
Schmelzle, M.C. and Kinziger, A.P. (2016). Using occupancy modelling to
compare environmental DNA to traditional field methods for
regional-scale monitoring of an endangered aquatic species. *Molecular
Ecology Resources*. 16(4): 895-908.
<https://doi.org/10.1111/1755-0998.12501>