  DNA-based biodiversity surveys involve collecting physical samples from
survey sites and assaying the contents in the laboratory to detect species via
their diagnostic DNA sequences. DNA-based surveys are increasingly being
adopted for biodiversity monitoring. The most commonly employed method is
metabarcoding, which combines PCR with high-throughput DNA sequencing to
amplify and then read `DNA barcode' sequences. This process generates count
data indicating the number of times each DNA barcode was read. However,
DNA-based data are noisy and error-prone, with several sources of variation. In
this paper, we present a unifying modelling framework for DNA-based data
allowing for all key sources of variation and error in the data-generating
process. The model can estimate within-species biomass changes across sites and
link those changes to environmental covariates, while accounting for species
and sites correlation. Inference is performed using MCMC, where we employ Gibbs
or Metropolis-Hastings updates with Laplace approximations. We also implement a
re-parameterisation scheme, appropriate for crossed-effects models, leading to
improved mixing, and an adaptive approach for updating latent variables,
reducing computation time. We discuss study design and present theoretical and
simulation results to guide decisions on replication at different stages and on
the use of quality control methods. We demonstrate the new framework on a
dataset of Malaise-trap samples. We quantify the effects of elevation and
distance-to-road on each species, infer species correlations, and produce maps
identifying areas of high biodiversity, which can be used to rank areas by
conservation value. We estimate the level of noise between sites and within
sample replicates, and the probabilities of error at the PCR stage, which are
close to zero for most species considered, validating the employed laboratory
processing.
