Commit 98af51f9 authored by jfuser's avatar jfuser
Browse files

change name of some functions

regen man files
parent 4d053bb0
......@@ -15,8 +15,7 @@ Description: A description
License: GPL (>= 2) | file LICENSE
LazyData: TRUE
BuildVignettes: FALSE
VignetteBuilder: knitr
SystemRequirements: C++11, gsl, gdal
SystemRequirements: C++11, gsl, gdal >= 2.0.0
Depends:
methods,
utils,
......@@ -36,10 +35,6 @@ Imports:
splancs,
sf,
RCALI
Suggests:
knitr(>= 1.11),
rmarkdown(>= 0.8.1),
testthat(>= 1.0.0)
Collate:
'invlogit.R'
'logit.R'
......
......@@ -5,11 +5,11 @@ export(HLIRdynamics)
export(demo_landsepi)
export(invlogit)
export(logit)
export(modeleLandsLPI)
export(modeleLandsEPI)
export(multiN)
export(periodic_cov)
export(plot.evol.QR)
export(plot.land)
export(plotevolQR)
export(plotland)
import(MASS)
import(RCALI)
import(Rcpp)
......
......@@ -36,9 +36,11 @@
#' @importFrom grDevices dev.off graphics.off png tiff
#' @include multiN.R periodic_cov.R graphLand.R
#' @examples
#' ## Generate a landscape consisting in a mosaic of fields cultivated with a susceptible cultivar and two resistant cultivars in balanced proportions and high level of spatial aggregation
#' ## Generate a landscape consisting in a mosaic of fields cultivated with a susceptible cultivar
#' ## and two resistant cultivars in balanced proportions and high level of spatial aggregation
#' data(landscapeTEST)
#' AgriLand(landscapeTEST,filename="landscapeTEST",propSR=2/3,isolSR=3,propRR=1/2,isolRR=3,strat="MO",Nhote=3,nYears=30,Cmax0=2,Cmax1=2,graphOn=1)
#' AgriLand(landscapeTEST,filename="landscapeTEST",propSR=2/3,isolSR=3,
#' propRR=1/2,isolRR=3,strat="MO",Nhote=3,nYears=30,Cmax0=2,Cmax1=2,seed=12345,graphOn=1)
#' @export
AgriLand <- function(landscape,filename="landscapeTEST",propSR,isolSR,propRR,isolRR,strat,Nhote,nYears,Cmax0,Cmax1,seed,graphOn){
set.seed(seed)
......@@ -126,8 +128,8 @@ if (graphOn) {
legend.hab <- c("Susceptible","Resistant 1 + Resistant 2")
if (strat=="PY")
legend.hab <- c("Susceptible","Resistant 1+2")
png(file=paste("landscape.png",sep=""),width=1000,height=1000)
plot.land(landscape, col.hab[habitat1+1], dens.hab[habitat1+1], angle.hab[habitat1+1], col.hab, dens.hab, angle.hab, title.hab, subtitle.hab, legend.hab)
png(filename="landscape.png",width=1000,height=1000)
plotland(landscape, col.hab[habitat1+1], dens.hab[habitat1+1], angle.hab[habitat1+1], col.hab, dens.hab, angle.hab, title.hab, subtitle.hab, legend.hab)
dev.off()
}
return(list(shapefilename=paste0(filename,".gpkg"),layername_hab="habitat",layername_res="results",rotation=as.integer(rotation$habitat),Cmax0=Cmax0,Cmax1=Cmax1,propRR=propRR,strat=strat))
......
......@@ -433,7 +433,7 @@ if (graphOn==1) {
if (nYears==1) {
## Dynamic of the host (H, L, I, R)
tiff(file=paste(pathRES,"/DYNhost.tiff",sep=""),width=180,height=110,units='mm',compression='lzw',res=300)
tiff(filename=paste(pathRES,"/DYNhost.tiff",sep=""),width=180,height=110,units='mm',compression='lzw',res=300)
par(xpd=NA, mar=c(4,4,0,9))
plot(0,0, type="n", xaxt="n", yaxt="n", bty="n", xlim=c(1,nTS), ylim=c(0,1), ylab="", xlab="")
hab <- habitat[,rotation[1]]
......@@ -451,7 +451,7 @@ if (graphOn==1) {
dev.off()
} else {
## Dynamic of Healthy hosts (H)
tiff(file=paste(pathRES,"/DYNhost_H.tiff",sep=""),width=180,height=110,units='mm',compression='lzw',res=300)
tiff(filename=paste(pathRES,"/DYNhost_H.tiff",sep=""),width=180,height=110,units='mm',compression='lzw',res=300)
par(xpd=NA, mar=c(4,4,0,9))
plot(0,0, type="n", xaxt="n", yaxt="n", bty="n", xlim=c(1,nTS), ylim=c(0,1), ylab="", xlab="")
# for (i in 1:3){
......@@ -475,7 +475,7 @@ if (graphOn==1) {
dev.off()
## Dynamic of Diseased hosts (I+R)
tiff(file=paste(pathRES,"/DYNhost_IR.tiff",sep=""),width=180,height=110,units='mm',compression='lzw',res=300)
tiff(filename=paste(pathRES,"/DYNhost_IR.tiff",sep=""),width=180,height=110,units='mm',compression='lzw',res=300)
par(xpd=NA, mar=c(4,4,0,9))
plot(0,0, type="n", xaxt="n", yaxt="n", bty="n", xlim=c(1,nTS), ylim=c(0,1), ylab="", xlab="")
# for (i in 1:3){
......@@ -518,14 +518,14 @@ if (graphOn==1) {
}
D_freq[trait] <- which(I_aggrProp[[trait]][1,]<0.95)[1] - 1 ## last time-step the 1st pathogen is above 0.95
if (graphOn==1)
plot.evol.QR(pathRES,nIncr,trait,I_aggrProp[[trait]],D_freq[trait],nTS,nYears,nTSpY)
plotevolQR(pathRES,nIncr,trait,I_aggrProp[[trait]],D_freq[trait],nTS,nYears,nTSpY)
}
D_freq[9] <- which(I_pathoProp[Npatho,]>0.05)[1] - 1 ## durability relative to the superpathogen
## Graphic with curves (for qualitative resistance)
if (sum(adapt_vect[1:4])>0) {
COL <- c("#FF5555","#4F94CD","darkolivegreen4","#CD950C","black") ## colors: red, blue, green, orange, black
tiff(file=paste(pathRES,"/EVOLpatho_curve.tiff",sep=""),width=180,height=110,units='mm',compression='lzw',res=300)
tiff(filename=paste(pathRES,"/EVOLpatho_curve.tiff",sep=""),width=180,height=110,units='mm',compression='lzw',res=300)
par(xpd=FALSE, mar=c(4,4,0,9))
idIG <- (1:4)[as.logical(adapt_vect[1:4])]
plot(0,0, type="n", xlim=c(1, nTS), bty="n", las=1, ylim=c(0,1), xaxt="n", xlab="", ylab="Frequency of infective genotypes")
......@@ -571,7 +571,7 @@ if (graphOn==1) {
if (nYears>1) {
## GLA
tiff(file=paste(pathRES, "/GLAabs.tiff",sep=""), width=180, height=110, units='mm', compression='lzw', res=300)
tiff(filename=paste(pathRES, "/GLAabs.tiff",sep=""), width=180, height=110, units='mm', compression='lzw', res=300)
# m <- matrix(c(rep(1,5),2),6,1) # matrix(c(rep(1,5),3,rep(2,5),3),6,2)
# layout(m)
# par(xpd=F, cex=.9,mar=c(5,4.1,4.1,2.1))
......@@ -608,7 +608,7 @@ if (graphOn==1) {
#
dev.off()
tiff(file=paste(pathRES, "/GLArel.tiff",sep=""), width=180, height=110, units='mm', compression='lzw', res=300)
tiff(filename=paste(pathRES, "/GLArel.tiff",sep=""), width=180, height=110, units='mm', compression='lzw', res=300)
par(xpd=NA, cex=.9,mar=c(4,4,0,9))
plot(0, 0, type="l", bty="n", lwd=2, xlim=c(1,nYears), ylim=c(0,1), xaxt="n", yaxt="n"
# , main="Relative green leaf area (GLAr)"
......@@ -628,7 +628,7 @@ if (graphOn==1) {
dev.off()
## AUDPC
tiff(file=paste(pathRES, "/AUDPC.tiff",sep=""), width=180, height=110, units='mm', compression='lzw', res=300)
tiff(filename=paste(pathRES, "/AUDPC.tiff",sep=""), width=180, height=110, units='mm', compression='lzw', res=300)
par(xpd=NA, cex=.9,mar=c(4,4,0,9))
plot(0,0, type="n", bty="n", xlim=c(1, nYears), ylim=c(0, audpc100S), xaxt="n", yaxt="n"
# , main="AUDPC"
......@@ -665,7 +665,7 @@ if (graphOn==1) {
title.H <- "Proportion of healty hosts"
title.IR <- "Proportion of diseased hosts"
invlogitbound <- 6
intvls <- sort(c(0, invlogit(seq(-invlogitbound,invlogitbound,l=nCol-2)), 1), dec=FALSE) ## intervals to define coloration
intvls <- sort(c(0, invlogit(seq(-invlogitbound,invlogitbound,l=nCol-2)), 1), decreasing=FALSE) ## intervals to define coloration
# colMap <- heat.colors(nCol, alpha=.3) ## color for each interval (alpha = transparency)
# plot(1:nCol~rep(0,nCol),col=colMap, pch=15, cex=3)
dens.H <- c(0,8,15)
......@@ -692,10 +692,10 @@ if (graphOn==1) {
intvlsH <- findInterval(propH, intvls)
intvlsIR <- findInterval(propI + propR, intvls)
png(file=paste(pathRES, "/HLIR_",sprintf("%02d",y),"-",sprintf("%03d",d),".png",sep=""),width=2000,height=1000)
png(filename=paste(pathRES, "/HLIR_",sprintf("%02d",y),"-",sprintf("%03d",d),".png",sep=""),width=2000,height=1000)
par(mfrow=c(1,2), cex=2, xpd=NA, mar=c(9.5,5,4,2))
## Map dynamic of healthy hosts
# plot.land(landscape, GREEN[intvlsH], dens.H[hab], angle.H[hab], GREEN, dens.H, angle.H, title.H, subtitle.H, legend.hab, legend.H, "H/K")
# plotland(landscape, GREEN[intvlsH], dens.H[hab], angle.H[hab], GREEN, dens.H, angle.H, title.H, subtitle.H, legend.hab, legend.H, "H/K")
## moving AUDPC
plot(0,0, type="n", bty="n", xlim=c(1, nYears), ylim=c(0, audpc100S), xaxt="n", yaxt="n"
......@@ -721,7 +721,7 @@ if (graphOn==1) {
, lty=c(1:Nhote,4), lwd=2, pch=PCH[c(1:Nhote,4)], pt.cex=c(rep(1,Nhote),1.5), col=c(rep("black",Nhote), COL.tot), seg.len=2.5)
## Map dynamic of diseased hosts
plot.land(trans.landscape_tmp, RED[intvlsIR], dens.H[hab], angle.H[hab], RED, dens.H, angle.H, title.IR, subtitle.H, legend.hab, legend.H, "(I+R)/K")
plotland(trans.landscape_tmp, RED[intvlsIR], dens.H[hab], angle.H[hab], RED, dens.H, angle.H, title.IR, subtitle.H, legend.hab, legend.H, "(I+R)/K")
dev.off()
} ## for d
} ## for y
......
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' @title Modele Lands LPI
#' @name modeleLandsLPI
#' @title Modele Lands EPI
#' @name modeleLandsEPI
#' @description Stochastic, spatially-explicit, demo-genetic model simulating the spread and evolution of a pathogen in a heterogeneous landscape.
#' @param times list of simulation parameters (number of years, number of time-steps per year)
#' @param landscape landscape generated through AgriLand
......@@ -35,10 +35,8 @@
#' @return A set of binary files is generated for every year of simulation and every compartment
#' (H: healthy hosts, Hjuv: juvenile healthy hosts, L: latently infected hosts, I: infectious hosts, R: removed hosts, S: propagules).
#' Each file indicates for every time-step the number of individuals in each field, and when appropriate for each cultivar and pathotype)
#' @examples
#' demo_landsepi()
#' @export
modeleLandsLPI <- function(times, landscape, dispersal, inits, val_seed, hostP, epiP, evolP) {
invisible(.Call('_landsepi_modeleLandsLPI', PACKAGE = 'landsepi', times, landscape, dispersal, inits, val_seed, hostP, epiP, evolP))
modeleLandsEPI <- function(times, landscape, dispersal, inits, val_seed, hostP, epiP, evolP) {
invisible(.Call('_landsepi_modeleLandsEPI', PACKAGE = 'landsepi', times, landscape, dispersal, inits, val_seed, hostP, epiP, evolP))
}
#library(RCALI) ## function readpoly2
#library(fields) ## function Exponential
#library(MASS) ## function mvnorm
#library(Matrix) ## function nearPD to convert a covariance matrix in a positive-definite matrix
#library(splancs) ## function polymap
#library(rgdal)
#library(raster)
#library(sp)
#library(rgeos)
#library(maptools)
#library(fields)
#library(sf)
#' Run demo landepi
#' @title demo_landsepi
#' @description Run a simulated example of mosaic deployment strategy of two resistant cultivars in balanced proportions and high level of spatial aggregation.
......@@ -20,6 +7,7 @@
demo_landsepi <- function(){
seed=12345
set.seed(seed)
#outputs
pathRES <- getwd()
graphOn <- 1
......@@ -94,7 +82,7 @@ demo_landsepi <- function(){
PI0 <- 5e-4
#run the model!
modeleLandsLPI(paramT,
modeleLandsEPI(paramT,
landscape,
dispersal=list(dispP=dispP,dispH=dispH),
inits=list(C_0=C_0, PI0=PI0),
......
#' @title Plotting the landscape
#' @name plot.land
#' @name plotland
#' @description Plot a landscape with colors or hatched lines on fields
#' @param landscape a spatialpolygon object containing field coordinates
#' @param COL vector containing the color of each field
......@@ -18,11 +18,12 @@
#' @examples
#' ## Draw a landscape with various colours
#' data(landscapeTEST)
#' plot.land(landscapeTEST, COL=1:length(landscapeTEST), DENS=rep(0,length(landscapeTEST)), ANGLE=rep(30,length(landscapeTEST)))
#' plotland(landscapeTEST, COL=1:length(landscapeTEST),
#' DENS=rep(0,length(landscapeTEST)), ANGLE=rep(30,length(landscapeTEST)))
#' @include RcppExports.R logit.R invlogit.R
# @S3method plot land
#' @export
plot.land <- function(landscape, COL=rep(0,length(landscape)), DENS=rep(0,length(landscape)), ANGLE=rep(30,length(landscape))
plotland <- function(landscape, COL=rep(0,length(landscape)), DENS=rep(0,length(landscape)), ANGLE=rep(30,length(landscape))
, COL.LEG=unique(COL), DENS.LEG=unique(DENS), ANGLE.LEG=unique(ANGLE)
, TITLE="", SUBTITLE="", LEGEND1=rep("", length(COL.LEG)), LEGEND2=rep("", length(COL.LEG)), TITLE.LEG2="", XMAX=2000, YMAX=2000) {
par(cex=2, xpd=NA, bg="white", mar=c(5,4,4,2))
......
......@@ -4,14 +4,14 @@
#
#' @encoding UTF-8
#' @title Biological Risk Assessment for epidemology
#' @title
#' @description A spatio-temporal exposure-hazard model for assessing biological risk and impact.
#' The model is based on stochastic geometry for describing the landscape and the exposed individuals,
#' a dispersal kernel for the dissemination of contaminants and an ecotoxicological equation.
#' @aliases briskaRepi-package briskaRepi
#'
#' @author Loup Rimbaud \email{loup.rimbaud@csiro.au}
#' @author Julien Papaix \email{julien.papaix@inra.fr}
#' @author Loup Rimbaud \email{loup.rimbaud@@csiro.au}
#' @author Julien Papaix \email{julien.papaix@@inra.fr}
#' @author Jean-Francois Rey \email{jean-francois.rey@@inra.fr}
#'
#' Maintainer: Jean-Francois REY \email{jean-francois.rey@@inra.fr}
......
#' @title Ploting pathotype frequencies
#' @name plot.evol.QR
#' @name plotevolQR
#' @description Plot the dynamic of pathotype frequencies in a tiff file.
#' @param pathRES the path of the repository where the graphic will be generated
#' @param nIncr number of pathotypes
......@@ -13,9 +13,9 @@
#' freqMatrix <- matrix(0, nrow=2, ncol=100)
#' freqMatrix[2,26:100] <- (26:100)/100
#' freqMatrix[1,] <- 1-freqMatrix[2,]
#' plot.evol.QR(getwd(), nIncr=2, trait=1, freqMatrix, D=25, nTS=100,nYears=10,nTSpY=10)
#' plotevolQR(getwd(), nIncr=2, trait=1, freqMatrix, D=25, nTS=100,nYears=10,nTSpY=10)
#' @export
plot.evol.QR <- function(pathRES, nIncr,trait, I_aggrProp, D, nTS,nYears,nTSpY) {
plotevolQR <- function(pathRES, nIncr,trait, I_aggrProp, D, nTS,nYears,nTSpY) {
COL.grey <- gray(0:150/150)
COL.grey <- COL.grey[length(COL.grey):1]
TITLE <- "Aggressiveness trait"
......@@ -25,7 +25,7 @@ plot.evol.QR <- function(pathRES, nIncr,trait, I_aggrProp, D, nTS,nYears,nTSpY)
LABELS <- c("\nNot infective","\nInfective")
}
tiff(file=paste(pathRES,"/EVOLpatho_", names(D), ".tiff",sep=""),width=100,height=100,units='mm',compression='lzw',res=300)
tiff(filename=paste(pathRES,"/EVOLpatho_", names(D), ".tiff",sep=""),width=100,height=100,units='mm',compression='lzw',res=300)
par(xpd=F, mar=c(4,4,2,2))
image(x=1:nIncr, y=1:nTS, z=I_aggrProp, col=COL.grey, ylab="", xlab="Phenotype", main=paste(TITLE,names(D)), axes=F, zlim=c(0,1), ylim=c(1,nTS+1))
box()
......
# landsepi R package
## before build and install
## Descriptions
## Authors
* CSIRO [[https://www.csiro.au]]
* INRA [[https://www.inra.fr]]
* Loup Rimbaud [[loup.rimbaud@csiro.au]]
* Julien Papaix [[julien.papaix@inra.fr]]
* Jean-Francois Rey [[jean-francois.rey@inra.fr]]
## License
The package landsepi is under GNU GPL V2.
See LICENSE file.
## R package
### Dependencies
The package for compiling needs g++, gsl dev library and gdal dev library >= 2.0.0 .
Under Linux OS:
```bash
sudo apt-get install g++ libgsl-dev libgdal-dev
```
Under Windows use the zip.
> You can install Rtools and get gdal sources and compile it under Windows.
R packages dependencies :
* Rcpp
* sp
* rgdal
* Matrix
* MASS
* rgeos
* maptools
* fields
* splancs
* sf
* RCALI
To install :
```r
install.packages(c("Rcpp","sp","rgdal","Matrix","MASS","rgeos","maptools","fields","splancs","sf","RCALI"))
```
### Install landsepi
To install the last version :
```bash
# linux
R CMD INSTALL landsepi_*.*.*.tar.gz
# windows
R CMD INSTALL landsepi_*.*.*.zip
```
## Development
### Before build and install
open R :
......@@ -11,7 +74,7 @@ Rcpp::compileAttribute(pkg=".")
roxygen2::roxygenize('.', roclets=c('rd', 'namespace'))
```
## build and install
### build and install
```bash
R CMD build .
......@@ -19,56 +82,18 @@ R CMD check --as-cran landsepi_*.*.*.tar.gz
R CMD INSTALL landsepi_*.*.*tar.gz
```
for development :
For debug mode :
```
R CMD INSTALL landsepi_*.*.*.tar.gz --with-keep.source --configure-args="--enable-debug=yes"
```
### Tests
No unit test add yet.
You can play the demo:
```r
library(landsepi)
demo_landsepi()
```
#### old notes
NOTE:
The landscapes are those generated by Julien (5 landscapes of about 155 polygons).
Connectivity matrices are computed using RCALI, before running the model
######## commande_1shot.h ######
this is the script which call all other scripts of the model:
- definition of the parameters
- for each of the following steps, a template script is copied and model parameters are replaced by their value:
1 #### allocation.R
allocation of the cultivars (or 'habitats') to every field of the landscape, using a multivariate distribution
the habitats are written in a text file
Also write a text file for crop rotations, indicating for every year if the landscape is in configuration 1 or 2
2 #### model_evol.c
demo-genetic model simulating the spread of a multi-strain pathogen in a multi-host landscape
Spatially-explicit, stochastic, SEIR-like model (see article for details)
The main function is 'dynepi', which simulates the different epidemiological and evolutionary processes every season
(introduction, contamination, infection, latent period, sporulation, mutation and dispersal of the pathogen and host growth)
At the end of every year, write binary files (H, S, L, I, R) containing the number of individuals in each state
--> use memory.c
memory allocation for objects up to 8 dimensions
--> use initialisation.c
initialisation of all matrices and tables
--> use functions.c
simple mathematical functions (e.g. sum of the rows of a matrix, sigmoid function, trade-off relationship)
--> use printReadWrite.c
functions to read tables, print them in the console and write in files
3 #### output.R
compute all the outputs (e.g. AUDPC, GLA [green leaf area], durability) of the simulations from files H, S, L, I, R
and make graphics of the outputs, and maps of the landscape
--> use graphLand.R
functions to make maps of the landscape with colors/hatch in polygons
......@@ -57,7 +57,9 @@ seasons over which a given cultivar is grown before being rotated;
(iv) Pyramiding: all candidate fields are cultivated with RC12, a resistant cultivar carrying both resistance sources.
}
\examples{
## Generate a landscape consisting in a mosaic of fields cultivated with a susceptible cultivar and two resistant cultivars in balanced proportions and high level of spatial aggregation
## Generate a landscape consisting in a mosaic of fields cultivated with a susceptible cultivar
## and two resistant cultivars in balanced proportions and high level of spatial aggregation
data(landscapeTEST)
AgriLand(landscapeTEST,filename="landscapeTEST",propSR=2/3,isolSR=3,propRR=1/2,isolRR=3,strat="MO",Nhote=3,nYears=30,Cmax0=2,Cmax1=2,graphOn=1)
AgriLand(landscapeTEST,filename="landscapeTEST",propSR=2/3,isolSR=3,
propRR=1/2,isolRR=3,strat="MO",Nhote=3,nYears=30,Cmax0=2,Cmax1=2,seed=12345,graphOn=1)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/HLIRdynamics.R
\name{HLIRdynamics}
\alias{HLIRdynamics}
\title{Generation of model outputs}
\usage{
HLIRdynamics(pathRES, graphOn, times, landscape, hostP, epiP, evolP,
th_break = 50000, nMapPY = 0)
}
\arguments{
\item{pathRES}{path of the repository where outputs will be generated}
\item{graphOn}{if graphics of the outputs must be generated}
\item{times}{list of simulation parameters (number of years, number of time-steps per year)}
\item{landscape}{agricultural landscape generated through AgriLand}
\item{hostP}{list of host parameters (number of cultivars, growth rate of the susceptible cultivar, reproduction rate of the susceptible cultivar,
growth rate of resistant cultivars, reproduction rate of resistant cultivars, death rate, number of possible resistance sources (8)
, resistance formula, parameters of the sigmoid invasion function: kappa, sigma and s)}
\item{epiP}{list of pathogen parameters (probability to survive the off-season, infection rate
, reproduction rate, average latent period duration, variance of the latent period, average infectious period duration
, variance of the infectious period duration, parameters of the sigmoid contamination function: kappa, sigma, s)}
\item{evolP}{list of evolution parameters (cost of infectivity, cost of aggressiveness, mutation rate, efficiency of major
resistance genes, efficiency of quantitative resistance, trade-off strength, number of increments of quantitative
resistance erosion, adaptation formula)}
\item{th_break}{threshold (number of infections) above which mutant pathogen are unlikely to go extinct, used to
characterise resistance breakdown}
\item{nMapPY}{number of epidemic maps per year to generate}
}
\value{
A set of text files containing all outputs of the simulations: durability, AUDPC, GLA. A set of graphics of host and pathogen dynamics, AUDPC, GLA, and epidemic
maps can also be generated.
}
\description{
Generate epidemiological and evolutionary outputs from model simulations.
}
\details{
Evolutionary outputs. Durability of qualitative resistance: For a given major gene, several computations are
performed: (d1) time to first appearance of a pathogen mutant; (d2) time to first true infection of a resistant host by such mutants; and
(d3) time when the number of infections of resistant hosts by these mutants reaches a threshold above which mutant pathogens are unlikely to go extinct.
Erosion of quantitative resistance: pathogen adaptation to quantitative resistance is gradual, so the three measures described above are computed for every step
towards complete erosion of resistance (i.e. nAgw-1 levels). Durability of a deployment strategy: a simulation run is divided into three periods:
(1) the initial short-term period when all resistance sources are at their highest potential; (2) a transitory period during which a given deployment strategy
is only partially effective; and (3) a longer-term period when all the resistances have been overcome or completely eroded.
To assess the end of the short-term period, the time to establishment (durability measure (d3)) is computed for every major gene, and every quantitative trait
at the first level of erosion (agw(p)=2). The minimal value of these measures, denoted by D1, delimitates short-term and transitory periods.
Similarly, the time to establishment is computed for every major gene, and for every quantitative trait at the highest level of erosion (agw(p)=nAgw).
The maximal value of these measures, termed D2, delimits transitory and long-term periods.
Epidemiological outputs. The epidemiological impact of pathogen spread is evaluated by two different measures: Green Leaf Area (GLA) and
Area Under Disease Progress Curve (AUDPC). The GLA represents the average number of productive hosts per time step and per surface unit. The AUDPC
is the average proportion of diseased hosts relative to the carrying capacity and represents disease severity.
Global epidemiological control: The GLA and AUDPC of every cultivar as well as the whole landscape are averaged across the whole simulation run,
to measure the global epidemiological performance of a deployment strategy. Short-term epidemiological control: The average GLA and AUDPC of the susceptible
cultivar is computed on whole cropping seasons from the beginning of the simulation until the end of the season preceding year before D1.
Epidemiological control during the transitory period: The average GLA and AUDPC of the susceptible cultivar is computed on whole seasons from the
beginning of the season following year after D1 to the end of the season year before preceding D2. Long-term epidemiological control:
The average GLA and AUDPC of the whole landscape is computed on whole seasons from the beginning of the season followingyear after D2 to the end of the simulation.
}
\examples{
demo_landsepi()
}
......@@ -3,11 +3,9 @@
\docType{data}
\title{
Host dispersal data for testing.
%% ~~ data name/kind ... ~~
}
\description{
A vectorised dispersal matrix of the host.
%% ~~ A concise (1-5 lines) description of the dataset. ~~
}
\usage{data("disp")}
\format{
......@@ -16,18 +14,9 @@
}
\details{
In this example, the host is a cultivated plant: seeds are harvested and do not disperse. Thus the dispersal matrix is the identity matrix.
%% ~~ If necessary, more details than the __description__ above ~~
}
\source{
TEST_dispH.txt
%% ~~ reference to a publication or URL from which the data were obtained ~~
}
\references{
%% ~~ possibly secondary sources and usages ~~
}
\examples{
data(disp)
summary(dispH)
## maybe str(dispH) ; plot(dispH) ...
}
\keyword{datasets}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/invlogit.R
\name{invlogit}
\alias{invlogit}
\title{Inverse logit function}
\usage{
invlogit(x)
}
\arguments{
\item{x}{a numeric object}
}
\value{
An object of the same type as x containing the invlogits of the input values.
}
\description{
Given a numeric object return the invlogit of the values. Missing values (NAs) are allowed.
}
\details{
The invlogit is defined by exp(x) / (1+exp(x)). Values in x of -Inf or Inf return invlogits of 0 or 1 respectively. Any NAs in the input will also be NAs in the output.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/logit.R
\name{logit}
\alias{logit}
\title{Logit function}
\usage{
logit(x)
}
\arguments{
\item{x}{a numeric object containing values between 0 and 1}
}
\value{
An object of the same type as x containing the logits of the input values.
}
\description{
Given a numeric object return the logit of the values. Missing values (NAs) are allowed.
}
\details{
The logit is defined by log(x/(1-x)). Values in x of 0 or 1 return logits of -Inf or Inf respectively. Any NAs in the input will also be NAs in the output.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{modeleLandsLPI}
\alias{modeleLandsLPI}
\title{Modele Lands LPI}
\name{modeleLandsEPI}
\alias{modeleLandsEPI}
\title{Modele Lands EPI}
\usage{
modeleLandsLPI(times, landscape, dispersal, inits, val_seed, hostP, epiP, evolP)
modeleLandsEPI(times, landscape, dispersal, inits, val_seed, hostP, epiP, evolP)
}
\arguments{
\item{times}{list of simulation parameters (number of years, number of time-steps per year)}
......@@ -53,6 +53,3 @@ to the pathogen. A wide array of deployment strategies can be simulated: mosaics
to pathogens that do not carry these genes. Similarly, a gain in pathogen aggressiveness on quantitatively resistant hosts
is penalised by a decreased aggressiveness on susceptible hosts, leading to a trade-off.
}
\examples{
demo_landsepi()
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multiN.R
\name{multiN}
\alias{multiN}
\title{Allocation of cultivars}
\usage{
multiN(d, area, aggreg, prop)
}
\arguments{
\item{d}{a matrix of the pairwise distances between the centroids of the fields of the landscape.}