You aren't fixing your initial values. By using fix_blength=1, you're telling codeml to use the M0 branch lengths as starting estimates, not fixed estimates. If you want to fix the branch lengths then you should use fix_blength=2. Note that this won't fix the substitution matrix parameters (i.e., omega, kappa)—just the branch lengths.
Anyway, the effect of changing initial omega varies depending on the codon model.
- In some cases, codeml uses the specified initial value as provided.
- I think this is the case for M0.
- However, if you set an impossible starting value (i.e., less than 0), then I think it gets re-set to some acceptable value.
- In some cases, codeml adds some random noise to the specified initial value.
- I think this is the case for M2a, where initial omega controls the w2 parameter.
- So, if you put initial omega as 2, codeml might start from 2.13 in one replicate run, 1.95 in another, etc, whereas if you put initial omega as 100 it would start from, e.g., 100.13, 99.95, etc.
- In some cases, setting initial omega doesn't have any effect.
- For example, the M7 model doesn't have an omega parameter.
- Finally, in some cases it might not be possible to vary the initial omega value because it needs to be fixed.
- This is the case for the Branch-site null model.
These are my recollections based on a check of the codeml source code from several years ago (hence, several updates ago). Perhaps someone can check the current codeml source code and report back with how initial omega settings affect each model.
Beyond varying omega, you have other options, though none is ideal:
- Instead of omega, you can always change initial kappa.
- This parameter is a part of all of the codeml codon models.
- My guess is that varying kappa will generally have less influence on likelihood optimization than varying omega for most models.
- You can use random starting branch lengths via fix_blength=-1.
- However, for large data sets and complex models, this will often be inefficient and, I suspect, potentially misleading.
- Random branch lengths are going to be really unrealistic and my hunch is that using them will increase the risk of climbing suboptimal peaks compared to your chances when using reasonable branch length estimates obtained from, say, the M0 model.
- Finally, you can use the in.codeml option to manually adjust whichever parameters or branch lengths you think are relevant for a given data set and model.