Hi David. OK, so. Regarding your first question, on the output of information about mutations, I think what you want to do is:
1. Get the vector of mutations you're interested in (from sim.mutations, or whatever other way you like); let's call that vector "muts"
2. Call sim.mutationFrequencies(pX, muts) for each subpopulation pX that you're interested in, and output the results of each call somewhere
3. Call
muts.id to get the mutation identifiers, and output those somewhere
Now you have the frequencies and the mutation identifiers, and they correspond one-to-one, so you can match them up – this frequency is for this mutation ID. And that lets you also cross-correlate the information with the output of outputFull() or outputFixedMutations(), if you wish, using the mutation identifiers as a lookup key.
Regarding your second question, on convertToSubstitution=F, if you're not seeing any effect in your model, that might perhaps be because the mutations you're looking at have not, in fact, fixed? Remember that mutations have to fix population-wide, not just in a single subpopulation, before they are considered "fixed" by SLiM. If they never reach population-level fixation, the value of that flag will make no difference.
So, just as example, if we look at a simplified version of the model we were discussing in the other thread:
initialize() {
initializeMutationRate(1e-7);
initializeMutationType("m1", 0.5, "f", 0.1);
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, 99999);
initializeRecombinationRate(1e-8);
}
1 { sim.addSubpop("p1", 10000); }
1000 late() { sim.outputFixedMutations(); }
This printed out a list of about 100 fixed mutations at the end, in the run I did. If I add a call to set convertToSubstitution to F for m1, changing it to:
initialize() {
initializeMutationRate(1e-7);
initializeMutationType("m1", 0.5, "f", 0.1);
m1.convertToSubstitution = F;
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, 99999);
initializeRecombinationRate(1e-8);
}
1 { sim.addSubpop("p1", 10000); }
1000 late() { sim.outputFixedMutations(); }
Now this model prints out no fixed mutations at the end, because SLiM has been told not to detect/substitute fixed m1 mutations. It also runs more slowly (since all mutations are kept as segregating in the population), and it looks a bit different in SLiM since more and more mutations build up at a frequency of 1 in the chromosome view. If you wanted to output information on these mutations, you would use outputFull() (or your own custom output code, of course).
So, if you've got a model in which this flag does not seem to be working properly, please supply the full code for that model and I'll see if I can clarify what's going on. I hope this helps!
Cheers,
-B.