role-model / roleR

R package implementing the RoLE model
https://role-model.github.io/roleR
GNU General Public License v3.0
1 stars 2 forks source link

new msprime error (oh joy!) #131

Closed ajrominger closed 1 year ago

ajrominger commented 1 year ago

Well fudge.

To reproduce this error you'll need to check-out the conda-fix branch and build the package from that branch (or install from that branch with remotes)

Once you've got the version of roleR from the conda-fix branch installed you can try running this:

# conda set-up
cl <- reticulate::conda_list()
condaenv_name <- "r-reticulate"

if(!(condaenv_name %in% cl$name)) {
    reticulate::conda_create("r-reticulate")
}

reticulate::use_condaenv(condaenv_name)

# if these packages aren't installed you'll have to do that first
msprime <- reticulate::import("msprime")
newick <- reticulate::import("newick")
collections <- reticulate::import("collections")

# now we can run the roleR code
library(roleR)

p <- roleParams(dispersal_prob = 0.5, alpha = 5000, individuals_local = 1000, 
                niter = 15000, niterTimestep = 5000)

m <- runRole(roleModel(p))

That last line trows an error:

Error: ValueError: Position values not strictly increasing at indexes [1]

No idea what that means! The traceback indicates it's coming from the ancestry simulation in msprime (I think):

Error: ValueError: Position values not strictly increasing at indexes [1]
12.
stop(structure(list(message = "ValueError: Position values not strictly increasing at indexes [1]\n",
call = NULL, cppstack = structure(list(file = "", line = -1L,
stack = c("1 reticulate.so 0x000000010ba717de _ZN4Rcpp9exceptionC2EPKcb + 222",
"2 reticulate.so 0x000000010ba79665 _ZN4Rcpp4stopERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 53", ...
11.
__init__ at intervals.py#77
10.
uniform at intervals.py#450
9.
_parse_rate_map at ancestry.py#683
8.
_parse_sim_ancestry at ancestry.py#861
7.
sim_ancestry at ancestry.py#1207
6.
py_msprime_simulate at role_msprime.py#104
5.
py_msprime_simulate(J_m, J, curtime, metaTree, metaAbund, localAbund,
spAbundHarmMean, localTDiv, alpha, sequence_length, mu, verbose = FALSE) at sim_seqs.R#47
4.
sim_seqs(m) at runRole.R#66
3.
.local(x)
2.
runRole(roleModel(p)) at runRole.R#29
1.
runRole(roleModel(p))
ajrominger commented 1 year ago

fixed by conda-fix 046e75e thanks to @isaacovercast who adds "this might be the first issue i ever closed without touching a keyboard"