New Open Source Tool for Plant Pest and Pathogen Spread Modeling

Vaclav (Vashek) Petras, Chris Jones, Anna Petrasova, Devon Gaydos, Kellyn P. Montgomery & Ross K. Meentemeyer

NCSU GeoForAll Lab and Landscape Dynamics Group
at the Center for Geospatial Analytics,
North Carolina State University

NCGIS 2019 Winston-Salem
Feb 27 - Mar 1, 2019

Motivation

  • Plant diseases and pests threaten production of food and plant-based materials.
  • NCSU CGA & USDA APHIS investigating the spread of pests and pathogens.

This work was made possible, in part, by a Cooperative Agreement from the United States Department of Agriculture’s Animal and Plant Health Inspection Service (APHIS). It may not necessarily express the views of APHIS.

Research

  • Sampling and other field work
  • Modeling
  • Software for modeling of the spread
  • Using the model for management
  • Open source
  • Open science

PoPS Model

Pest or Pathogen Spread Model

  • Spread of pests and pathogens over a landscape (spatially explicit)
  • Open source
  • Various ways of using it
  • Already in use
  • Actively developed
PoPS logo

Mechanics

Generating dispersers (spores or insect)

Mechanics

Spreading the dispersers

Mechanics

Establishment of the dispersers

Scenarios and Model Result

Spatial distribution of infected or infested hosts and spatial management input

Parts and Interfaces

  • C++ Library
  • R Package
  • GRASS GIS Module
  • Tangible Landscape Application

C++ Library

  • Using C++ for performance reasons
    • R was too slow
    • R with Rcpp implementation was too slow
      • Rcpp: Seamless R and C++ Integration
  • Using C++11

github.com/ncsu-landscape-dynamics/PoPS

C++

  • What-if descriptions of languages:
    • Python: What if everything was a dictionary?
    • R: What if everything was of a different type?
    • C++: What if we added everything to one language?
    • C++11: What if we didn't know when to stop?
  • C++11 aims at being more convenient and friendlier to beginners
// creating simulation object
Raster<int> infected = {{5, 0},
                        {0, 0}};
int ew_res = 30;
int ns_res = 30;
Simulation<Raster<int>, Raster<double>>
    simulation(42, infected, ew_res, ns_res);

R Package

  • Rcpp for accessing the C++ library from R
  • statistical functions
  • functions to implement calibration
  • preprocessing, postprocessing, visualization functions

github.com/ncsu-landscape-dynamics/rpops

R Package: Usage

host_file <- system.file(..., "host.tif", ...)
# ...

data <- pops(
    infected_file, host_file, ...
    reproductive_rate = 1.0,
    ...
    start_time = 2001, end_time = 2005)

Install:

install.packages("devtools")
library(devtools)
devtools::install_github("ncsu-landscape-dynamics/rpops")
library(PoPS)

GRASS GIS Module

  • GRASS GIS interface to the C++ library written in C++
  • various user interface in GRASS GIS
  • tools for spatial analysis
  • preprocessing, postprocessing, visualization tools
  • published in GRASS GIS Addons repository
    • g.extension r.pops.spread

github.com/ncsu-landscape-dynamics/r.pops.spread

GRASS GIS Module: GUI

Graphical user interface for PoPS

GRASS GIS Module: Python

Python interface for PoPS in GRASS GIS
import grass.script as gs

gs.run_command('r.import', input='host.tif', ...)
# ...

gs.run_command('r.spread.sod', species='host', ...
               moisture_file='moistures.txt',
               temperature_file='temperatures.txt',
               start_time=2005, end_time=2010,
               rtype='cauchy', wind='NE', random_seed=42)

GRASS GIS Module: Command line

Command line (Bash) interface for PoPS in GRASS GIS
r.import input=host.tif ...
# ...

r.spread.sod species=lide lvtree=all infected=infected_2005 \
    moist_file=moistures.txt \
    temp_file=temperatures.txt \
    output=spread_sod start_time=2005 end_time=2010 \
    rtype=cauchy wind=NE rseed=4

Tangible Landscape Application

Low-barrier interface to the model

Sudden Oak Death Management Workshop, Oregon, 2017

Open Science

  • open source
    • availability
    • model is open source (C++ core)
    • dependencies are open source (R or GRASS GIS)
    • integrations are open source (R and GRASS GIS interfaces)
    • GNU GPL >=2

Image credit: Open Science Logo v2, CC BY-SA 3.0 Greg Emmerich

Open Science

  • opportunities
    • available early (since the experimental phase, i.e. pre-release)
    • more applications of the model in research and management
    • open collaboration on improving the model
    • easier collaboration within our institution

Image credit: Open Science Logo v2, CC BY-SA 3.0 Greg Emmerich

Open Science

  • review
    • the model can be scrutinized (more than the traditional peer-review)
    • review can be performed by anybody (not just by scientists)

Image credit: Open Science Logo v2, CC BY-SA 3.0 Greg Emmerich

Coming Soon

  • Release 1.0.0
  • DOI
  • Tools for calibration and validation

PoPS logo

Slides: ncsu-landscape-dynamics.github.io/pops-talk

Official collaboration: geospatial.ncsu.edu/engage

Twitter: vaclavpetras
GitHub: wenzeslaus
GitLab: vpetras

Come to see the NCSU Center for Geospatial Analytics booth!