doesGmapCombine | R Documentation |
Test the gmap aggregation scheme against a landscape to see if cells with genetic samples are being combined
doesGmapCombine(gmap, landscape)
gmap |
data frame that maps forward time populations to genetic populations (from |
landscape |
the landscape object used in the forward simulation |
Avoid combining cells with two separate genetic samples during cell aggregation
Returns a logical (TRUE or FALSE) indicating whether the aggregation scheme specified by gmap would combine two cells with genetic samples. Combining genetic samples can result in problems during subsequent coalescent simulations. If FALSE, no issues are expected.
getpophist2.cells
, make.gmap
, pophist.aggregate
, runFSC_step_agg3
library(holoSimCell)
parms <- drawParms(control = system.file("extdata/ashpaper","Ash_priors.csv",package="holoSimCell"))
load(file=paste0(system.file(package="holoSimCell"),"/extdata/landscapes/",pollenPulls[[1]]$file))
refpops <- pollenPulls[[1]]$refs
avgCellsz <- mean(c(res(landscape$sumrast)))
ph = getpophist2.cells(h = landscape$details$ncells, xdim = landscape$details$x.dim, ydim = landscape$details$y.dim,
landscape=landscape,
refs=refpops,
refsz=parms$ref_Ne,
lambda=parms$lambda,
mix=parms$mix,
shortscale=parms$shortscale*avgCellsz,
shortshape=parms$shortshape,
longmean=parms$longmean*avgCellsz,
ysz=res(landscape$sumrast)[2],
xsz=res(landscape$sumrast)[1],
K = parms$Ne)
gmap=make.gmap(ph$pophist,
xnum=2, #number of cells to aggregate in x-direction
ynum=2) #number of aggregate in the y-direction
doesGmapCombine(gmap, landscape)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.