Introduction

Here you will find basic instructions to create input files and begin simulating with cdmetapopR.

First, install cdmetapopR and its dependencies using install.packages() or by downloading the package from the Github page and installing from the archive file.

install.packages("cdmetapopR")

CDMetaPOP can simulate complex systems but you can get started with a simple template. This platform and tutorial are meant to help you get acquainted with the basic inputs and functions without having to deal with changing too many parameters at once. It will help you build the basic files needed to run CDMetaPOP and give you some tips along the way.

The basic files you need to run CDMetaPOP are:

  1. classVars.csv: defines parameters driven by the size/stage or age of individuals.

  2. patchVars.csv: defines parameters driven by variation in space (i.e. patches or sites).

  3. popVars.csv: defines parameters that apply to the entire population, and can contain parameters for multiple runs.

  4. runVars.csv: defines the basic meta-parameters of your simulation. These parameters apply to all species, and can contain parameters for multiple runs.

Next, let’s start with a suggestion on the directory structure for your input files.

Your working directory (in this case './data') should contain your runVars.csv file, and may contain subdirectories to house other input files. For example:

./data/
├── runVars.csv
├── popvars/
│   └── popVars.csv
├── patchvars/
│   └── patchVars.csv
├── classvars/
│   └── classVars.csv
├── genes/
│   └── allelefrequencies.csv
├── cdmats/
│   ├── cdmat1.csv
│   ├── cdmat2.csv
│   └── cdmat3.csv
└── otherfiles/
    ├── correlation_matrix1.csv
    └── correlation_matrix2.csv

Click on the links below to navigate to the shinyApps that will help you define the parameters for your first run and make sure to save the resulting input files following the suggestion above, or in a way that makes sense for your simulations.

Remember to ALWAYS download your work from the PREVIEW TAB before closing the shinyApp

We suggest preparing your files in the order given (starting with classVars), as the runVars.csv requires defining the popVars.csv, which in turn requires defining the patchVars.csv, which requires defining the classVars.csv files. However, you may wish to start with the runVars.csv file, and filling in the file names later.

Additional input files may include distance matrices to guide individual movement, a correlation matrix, and genetic files to initialize population genetic structure. But once you have the basic input files mentioned above you can start your basic simulations and get acquainted with the potential insights you can gain about your species in both space and time with CDMetaPOP.

Once your input files are ready, proceed to the next step:

➡️ Go to Run CDMetaPOP

For more detailed instructions you can refer to the CDMetaPOP user manual and several publications:

  1. Manual.

  2. Landguth EL, Bearlin A, Day C, Dunham J (2017) CDmetaPOP: an individual-based, eco-evolutionary model for spatially-explicit simulation of landscape demogenetics. Methods in Ecology and Evolution. 8, 4-11, doi: 10.1111/2041-210X.12608

  3. Check out the multispecies version too: Day CC, Landguth EL, Simmons R, Bearlin A (2023) CDMetaPOP 2: a multispecies, eco-evolutionary simulation framework for landscape demogenetics and connectivity. Ecography https://doi.org/10.1111/ecog.06566

  4. New disease model coming up soon - Stay tuned!