Comments (1)
How to combine multiple EEMS runs (for the same African elephant dataset)
library(dplyr,warn.conflicts=FALSE) ## Useful package for manipulating data frames
library(rEEMSplots) ## Defines eems.plots, which visualizes EEMS results
There are results from running EEMS once with four different densities: nDemes = 360, 540, 900, 1200
.
eems.output = list.dirs("./elephants",recursive = FALSE) ## Show thesubdirectories in ./elephants/
eems.output
## [1] "./elephants/V3b-nohyb-nIndiv1124-nDemes1200-chain1"
## [2] "./elephants/V3b-nohyb-nIndiv1124-nDemes360-chain1"
## [3] "./elephants/V3b-nohyb-nIndiv1124-nDemes540-chain1"
## [4] "./elephants/V3b-nohyb-nIndiv1124-nDemes900-chain1"
Let's look at the results separately for each of the four runs. First generate the figures by calling eems.plots
.
for (run in seq(4)) {
eems.plots(mcmcpath = eems.output[run],
plotpath = eems.output[run],
longlat = TRUE,
add.grid = TRUE,
add.demes = TRUE)
}
In each plot, I have added the population grid to illustrate that the density is different but the surfaces are qualitatively similar. Still, with higher density, the effective barrier to migration -- the area in dark brown that curves through the habitat -- gets to be estimated more precisely. (By this I mean that it is wider in some places and thinner in others.)
Next, let's combine combine the four results. Remember that eems.output
is a list of four EEMS output directories.
## mcmcpath can be (ideally, will be) a list of multiple EEMS runs to average
combined.mcmcpath = eems.output
## plotpath should be one string (not a list of strings) for the averaged results
combined.plotpath = "./elephants/V3b-nohyb-nIndiv1124-combined-results"
eems.plots(mcmcpath = combined.mcmcpath,
plotpath = combined.plotpath,
longlat = TRUE)
That is, eems.plots
works with one or mulitple EEMS output directories. The estimated migration rates (and diversity rates -- not shown above) are averaged to produce a surface/contour plot that often smoother and, more importantly, averages the effects of different population grids. [In practice, I run the program several times for a few different grids.]
While it is straightforward to combine the migration and diversity contour plots for multiple grids/runs, the diagnostic scatter plots are not so easy to combine. Recall that there is a diagnostic scatter plot that shows the observed and fitted dissimilarities between demes.
Between-demes dissimilarities for nDemes = 360:
There is also a diagnost scatter plot that shows the observed and fitted dissimilarities within demes. Within-demes dissimilarities for nDemes = 360
However, as the density varies and the population grid changes, the demes change as well -- most obviously, the number of demes but also their location. This means that the points in the between-demes scatter plot for nDemes = 360
do not correspond to the points in the between-demes scatter plot for nDemes = 540
.
So if mcmcpath
contains results for different population grids, eems.plots
does not generate diagnostic plots by default. Instead it plots two different population grids. These contain no information but "explain" why there are no scatter plots.
from eems.
Related Issues (20)
- Error building EEMS in a Mac HOT 1
- eems compatibility with eigen and boost HOT 4
- Cropping issue with ggplot maps HOT 11
- Problems to run bed2diffs HOT 2
- Error in .coord file
- Problem compiling plinkio library for bed2diffs HOT 4
- Segmentation fault
- Question about CPU usage for runeems_snps
- Error in .coord file HOT 2
- How to extract value based on coordinate HOT 2
- eems with ngsDist matrix (dealing with missing data, invariant sites, uneven nSites)
- Error while plotting map in make_eems_plots
- the option '--params' is required but missing
- How to improve the acceptance rate of "mBirthDeath"?
- Error: disimilarity matrix is not a full rank matrix HOT 3
- ModuleNotFoundError: No module named 'parameters'
- Error compiling runeems_snps - no sudo permissions
- Package ‘rgeos’ has retired HOT 1
- Error compiling runeems_sats HOT 1
- Error: Check that the dissimilarity matrix is a square nIndiv-by-nIndiv matrix. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eems.