initialize() {
initializeSLiMModelType("nonWF");
defineConstant("L", 200000);
//Population carrying capacity; this is for
//population regulation in non-WF models
defineConstant("K", 1000);
initializeMutationType("m1", 0.5, "f", 0.0); //Autosome neutral mutations
initializeMutationType("m2", 0.5, "f", 0.0); //Sex chromosome neutral mutations
// Convert neutral mutations to substitutions
// to improve simulation performance:
m1.convertToSubstitution = T;
initializeMutationType("m3", 1, "f", 0.0); //Y-marker
initializeMutationType("m4", 1, "f", 0.0); //X chromosome neutral test mutation
initializeMutationType("m5", 1, "f", 0.0); //Autosomal neutral test mutation
initializeMutationType("m6", 0.5, "f", 0.0); //Autosome sexually antagonistic mutations
initializeMutationType("m7", 0.5, "f", 0.0); //Sex chromosome SA mutations
//m1.color = "green";
//m2.color = "blue";
//m3.color = "red";
//m4.color = "yellow";
//Autosome
initializeGenomicElementType("g1", c(m1, m6), c(1.0, 0.1));
//Sex chromosome
initializeGenomicElementType("g2", c(m2, m7), c(1.0, 0.1));
initializeGenomicElement(g1, 0, asInteger((L/2)-1)); //Autosome
initializeGenomicElement(g2, asInteger(L/2), L-1); //Sex chromosome
//Free recombination between chromosomes
rates = c(1e-8, 0.5, 1e-8);
ends = c(asInteger((L/2)-1), asInteger(L/2), L-1);
initializeRecombinationRate(rates, ends);
//Parameters
defineGlobal("MU", 1e-7);
initializeMutationRate(MU);
}
reproduction() {
//Draw random males and females
repfemales = subpop.sampleIndividuals(asInteger(K/2), replace = T, tag = 1);
repmales = subpop.sampleIndividuals(asInteger(K/2), replace = T, tag = 0);
//Mate randomly sampled pairs
for (i in seqLen(asInteger(K/2))) {
offspring = subpop.addCrossed(repfemales[i], repmales[i]);
//Sex determination
if (offspring.genome2.containsMarkerMutation(m3, L-1))
offspring.tag = 0; //male
else
offspring.tag = 1; //female
}
self.active = 0; //turn off reproduction ("big bang" style)
}
mutationEffect(m6) {
// Draw fitness effects from the Laplace DFE
maleEffect = rlaplace(-0.05, 0.04); //turns out this function doesn't exist.
//Post to slim-discuss.
femaleEffect = rlaplace(-0.05, 0.04);
// Define a custom fitness function that differentiates by sex
if (individual.tag == 0) {
return 1 + maleEffect;
} else {
return 1 + femaleEffect;
}
}
Is there another way I could model a distribution of deleterious and beneficial mutations that I can draw from separately in both sexes? Maybe by combining other distributions or modifying fitness in a different place? Open to any suggestions. Many thanks,
Mark Hibbins
To view this discussion on the web visit https://groups.google.com/d/msgid/slim-discuss/PH0PR10MB47276293A2BAF8199AB7D9C6A5FB2%40PH0PR10MB4727.namprd10.prod.outlook.com.