1 early() {
sim.addSubpop("p1", 50);
sim.addSubpop("p2", 50);
p1.setSpatialBounds(c(0.0, 0.0, 1198, 1046));
p2.setSpatialBounds(c(0.0, 0.0, 1198, 1046));
mapImage = Image("./map.png");
map = p1.defineSpatialMap("world", "xy", (1.0) - mapImage.floatK, valueRange=c(0.0, 1.0) , colors=c("black", "white"));
p2.addSpatialMap(map);
defineConstant("MAP", map);
for (ind in p1.individuals) {
px = runif(1, 900, 940);
py = runif(1, 50, 90);
p = (c(px, py));
ind.setSpatialPosition(p);}
for (ind in p2.individuals) {
px = runif(1, 450, 500);
py = runif(1, 990, 1110);
p = (c(px, py));
ind.setSpatialPosition(p);}
}
--
SLiM forward genetic simulation: http://messerlab.org/slim/
---
You received this message because you are subscribed to the Google Groups "slim-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slim-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/slim-discuss/f432d8c5-4226-4762-9bb8-84a76ff575a7n%40googlegroups.com.
Hi Ben,
Sure, here is the script and the map. With this code I don't get errors but two different maps, one with p1 and one with p2, instead of one with both populations.
best,Giada
From: Ben Haller <bha...@mac.com>
Sent: Thursday, June 13, 2024 7:42 AM
To: Padovani, Giada <gi.pa...@ufl.edu>
Cc: slim-discuss <slim-d...@googlegroups.com>
Subject: Re: same SpatialMap for two subpopulations[External Email]
To view this discussion on the web visit https://groups.google.com/d/msgid/slim-discuss/SA1PR22MB5217154C9181BB354F578946F5C12%40SA1PR22MB5217.namprd22.prod.outlook.com.