An R package to create input files for and analyze output files from Nemo.
Nemo is an individual-based forward-time simulation program created and maintained by Fred Guillaume. The latest release is available for download here.
This package is meant to aid in writing input files for Nemo, particularly when dealing with large landscapes consisting of many patches that require large range-wide matrices for specifying dispersal distances or distances within which breeding can happen from a focal patch. See additions to the Nemo code documented here for some of the capabilities that this package is meant to deal with. Future updates will include functions for analyzing stat file outputs and other output files.
The package can be installed using devtools, which itself can be installed from CRAN with
install.packages("devtools")
Once devtools is installed, run
library(devtools)
install_github("kjgilbert/aNEMOne")
library(aNEMOne)
and the package will be installed and open.
An example script shows how this package's functions may be used to produce a .ini input file for Nemo.
The main function make.input
takes all of the parameters that would normally appear in your input file with some defaults already set. See ?make.input
for details. This function really provides no advantage unless you use the additional functions to create large matrices and kernels that can now be automatically inserted into the input file without worry about copy and paste or bracket errors.
-
make.delet.input
does the same as above except has deleterious loci instead of neutral loci. -
make.nemo.input
makes inputs with deleterious loci and a quantitative trait for the newest release of Nemo, v2.3.46, and hence has no breeding window functionality.
-
See
?patch.cap
for details on making an array of patch capacities. Currently only two different K's may be set across the landscape, but more may easily be added, so feel free to request so. This function also works for male and female specific carrying capacities as well as temporally set capacities. -
See
?make.kernel.and.matrix
for details on making connectivity matrices and probability kernels for dispersal and breeding windows. The function returns the array for the kernel and prints the connectivity matrix to file.
-
See
?make.landscape
for details on making the landscape of phenotypic optima for Nemo'sselection_local_optima
input parameter. The function returns the mean optimum value for the first column of landscape patches, visualizes the landscape, and write to file the matrix to be fed in for input. -
See
?step.landscape
for details on making a stepwise gradient landscape of phenotypic optima for Nemo'sselection_local_optima
input parameter. The function returns the optimum value for the first column of landscape patches, visualizes the landscape, and write to file the matrix to be fed in for input. -
See
?changing.landscape
for details on how to combine landscapes of two types or steepnesses.
Useful for running analyses on Westgrid or other similar Grid Engine clusters
-
make.pbs
creates a PBS file for the provided .ini file. It is important that GrexLine.txt, MiddleLine.txt, and LastLine.txt are in the same directory as the .ini file (and the same holds for multi.pbs below). -
multi.pbs
creates PBS files for all .ini files in a directory.
Useful for running analyses on Ubelix or other similar slurm clusters
forthcoming
-
dist.delet.effects
Plots histograms of the effect sizes of deleterious mutations from a .del file. -
delet.muts.over.landscape
Plots heat maps of the numbers of homozygous, heterozygous, or total mutations over the landscape from a .del file. -
sim.results.pop
Plots the desired summary statistics from the output .stat file over all generations specified for saving data. -
fit.results.landscape
Plots heat maps of total fitness, or fitness for just the quantitative trait or just deleterious mutations, across the landscape from a .fit file.
For sanity's sake, remember that the latest version of roxygen2 is not compatible for its method of creating .Rd documentation files. Current version is using roxygen2 v4.1.0, installed via install_version("roxygen2", version = "4.1.0", repos = "http://cran.us.r-project.org")
. I think it is most likely just me that has not kept up with the latest R package development tools.