Closed cruzan-lab closed 11 months ago
Hoping for a response soon.
The documentation says
although less used because of potentially a large number of keys, this operator can act on multiple loci
which means if you have loci=[0, 1]
or loci=sim.ALL_AVAIL
, you are supposed to list all combination of genotypes, which is certainly a bad idea for a large number of loci.
For your case,
sim.MlSelector([
sim.MapSelector(loci=x, fitness={(0,0):1, (0,1):1, (1,1):.8}) for x in range(pop.totNumLoci())],
mode = sim.ADDITIVE)
looks easy enough to specify a list of MapSelector
using list comprehension.
With two loci each with two alleles. In preOps I'm using:
or
both of these generates an error message saying that fitness is not defined (it's defined for both homozygotes but not for heterozygotes). If I use:
then it works just fine. I'm trying to apply the same fitness levels to a large number of loci. There must be some additioanl trick to get "sim.ALL_AVAIL" to work. Please let me know what it is. Thanks Mitch