Answers.Body: <p><strong>Question</strong> I suspect this question is about the phylogenetics of methylation and the approach the investigator is proposing would be the last approach to use.</p>
  
  <p><strong>Summary</strong>
  The approaches to assess the phylogenetics of methylation in order of preference are:</p>
  
  <ul>
  <li>dN/dS between CpG sites and non-CpG sites, </li>
  <li>An explicit molecular clock between CpG sites and non-CpG sites</li>
  <li>A likelihood ration test (LRT) based on a null distribution of mutations generated by a Monte Carlo algorithm </li>
  </ul>
  
  <p><strong>Background/Rationale</strong>
  The approaches you are using have been around for a long while and generate the random distribution of mutations for a given phylogeny. Its phylogenetics in reverse and the technique is known as Monte Carlo, you start with a randomised probability and send it through a parameterised model to predict the amino acid/nucleotide. Thus it is ML(max likelihood), Bayesian, "phylogenetic-HMM" in reverse. It is used within likelihood ratio test calculations. The model is determined by a standard ML, Bayesian phylogeny algorithm, i.e. its circular mathematics because there is no independent means of calculating the mutation behaviour, so the precise context you are using this for needs to be carefully considered.</p>
  
  <p><strong>Packages</strong> There are lots of packages that do this type of Monte Carlo simulation, SOWHat being a good one (LRT) and you generate a large number of replicate data sets (100 or 1000). The one of the base algorithms is "seq-gen", although PAML may have implemented this.</p>
  
  <p><strong>Considerations</strong> To use this style of approach you need to carefully consider your question. The "mutation simulations" when analysed via a phylogenetic program will produce the same parameters that you initially set and trees of basically the same length. If you are using this to generate a null distribution for a phylogenetics test these approaches are useful, you then compare the observed likelihood against the null distribution. If you are using it to work out whether the mutation rate at CpG sites is higher than at other sites, its one approach amongst a number of alternatives. </p>
  
  <p><strong>Drawbacks</strong> Calculating a de novo null distribution of the mutation rate is computationally very expensive and therefore tends to the last calculation performed. It will address a single hypothesis, usually regarding topology.</p>
  
  <p><strong>Crux of the problem</strong> To really do what (I think) you want to do you need an independent measure of mutation and mutational behaviour and its not trivial to achieve. You would have to consider it like a machine learning calculation, with a formal training set, I don't know whether such an approach has been implemented. </p>
  
  <p><strong>Strengths/Summary</strong> In summary, Monte Carlo phylogenetics simulation has a limited application because of circularity of the calculation, BUT, BUT, BUT what I have omitted is when it is appropriate it is a very powerful test indeed.</p>
  
  <hr>
  
  <p><strong>Points of interest</strong> I do like the population dynamic simulations within Beast, this certainly "a priori" and its potential IMO needs further exploration. However, I don't think you looking at how molecular epidemiology might impact the mutational behaviour methylation. I have not looked at Indelible, but looks interesting.</p>
  
  <p>I was going to talk about "processor war simulations" but its probably off-topic.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-02T11:25:35.780Z
Answers.Text: Thanks for your response. My question is not so much about phylogenetics of methylation. What I need essentially is a null distribution for neutral mutations. MCMC or maximum likelihood helps a lot given that there is a model :) But I am not aware of a non-time revesible model accounting for sequence context and indels.
Answers.UserDisplayName: Iakov Davydov
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-02T11:32:40.780Z
Answers.Text: I don't know what "sequence context" is but non-reversibility of mutations (and by inference time) is Beast, all other ML or Bayes (MCMCMC) algorithms have a symmetrical mutation matrices. MCMC in Bayes is different from the Monte Carlo used for nucleotide simulation. To honest the lack of clarity in the question is of concern, so I can't help any further.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-02T11:56:02.060Z
Answers.Text: In classical phylogenetic models a probability of mutation at position N depends only on the nucleotide at that position and some measure of time. What I mean by sequence context here is the fact that probability of mutation will also depend on nucleotides and mutations at positions N-M..N+M. We have a wealth of empirical evidence that there is [such a dependency](https://doi.org/10.1038/ng.3292). But not many models accounting for it (such as [this one](https://doi.org/10.1093/molbev/msh039)).
  I will try to clarify the question and to give some background information there.
Answers.UserDisplayName: Iakov Davydov
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-02T12:13:32.160Z
Answers.Text: So do I, but I bet you can't name the mechanism.  Anyway Nick Goldman did this years ago, its not new
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-29T10:56:20.643Z
Answers.LastActivityDate: 2019-04-29T12:54:56.010Z
Answers.LastEditDate: 2019-04-29T12:54:56.010Z
Answers.UserDisplayName: M__
Body: <p>There are many features affecting mutation probabilities, e.g. CpG mutations are 10-fold more likely than other types of mutations.</p>
  
  <p>Is there a model (preferably with software) which can take two aligned genomic regions, <strong>estimate</strong> parameters of the neutral mutation procces and then <strong>simulate</strong> mutations for another region? Obviously, there are models like HKY and GTR, but they are somewhat simplistic and do not take the context into account.</p>
  
  <p>One model I found is <a href="https://doi.org/10.1093/bioinformatics/bth917" rel="nofollow noreferrer">this</a>, but it seems that there is no software implementing the model. Is there something more recent?</p>
  
  <p>I am also looking for software which can account for <strong>indels</strong>.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-08T10:26:41.840Z
Comments.Text: How good the simulation must be? Should it include that in transcription factors and translated genes are less mutated aside from CpG and indels transverstions...? (I am not aware of any software, but I think that with a single reference any tool will have problems estimating good parameters)
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-08T10:31:34.290Z
Comments.Text: @Llopis the idea is to use it on all the regions with very weak selection (e.g. intergenic non-functional), only to account for mutations process, not selection, which of course affects genes and regulatory elements.
Comments.UserDisplayName: Iakov Davydov
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-08T12:30:42.727Z
Comments.Text: I'm not sure these tools allow parameter estimation from the data, but I've heard good things about Indelible https://academic.oup.com/mbe/article/26/8/1879/980884 and Evolver https://www.drive5.com/evolver/EvolverUserGuide.pdf
Comments.UserDisplayName: Chris_Rands
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-19T10:39:54.077Z
Comments.Text: Does this help:
  https://www.biorxiv.org/content/early/2017/11/22/223297 New synthetic-diploid benchmark for accurate variant calling evaluation
Comments.UserDisplayName: Dan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-28T23:19:44.520Z
Comments.Text: FoldX is the state of the art method for mutation modelling (cited by countless papers).  It does not do exactly what you want without extra work though.
Comments.UserDisplayName: Aalawlx
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-04T21:38:42.177Z
Comments.Text: The [MMOS](http://mmos.ch/) company developing [Citizen science](https://en.wikipedia.org/wiki/Citizen_science) solutions for these kind of tasks.
Comments.UserDisplayName: eapo
Tags: <phylogenetics><phylogeny><mutations><nucleotide-models>
Title: State of the art mutation simulation software
ThreadText: # State of the art mutation simulation software
  
  (Asked by: username_0 on 2017-12-08)
  
  There are many features affecting mutation probabilities, e.g. CpG mutations are 10-fold more likely than other types of mutations.
  
  Is there a model (preferably with software) which can take two aligned genomic regions, **estimate** parameters of the neutral mutation procces and then **simulate** mutations for another region? Obviously, there are models like HKY and GTR, but they are somewhat simplistic and do not take the context into account.
  
  One model I found is [this](https://doi.org/10.1093/bioinformatics/bth917), but it seems that there is no software implementing the model. Is there something more recent?
  
  I am also looking for software which can account for **indels**.
  
  **Tags:** phylogenetics, phylogeny, mutations, nucleotide-models
  
  > **Comments:**
  > **username_1**: How good the simulation must be? Should it include that in transcription factors and translated genes are less mutated aside from CpG and indels transverstions...? (I am not aware of any software, but I think that with a single reference any tool will have problems estimating good parameters)  
  > **username_0**: @Llopis the idea is to use it on all the regions with very weak selection (e.g. intergenic non-functional), only to account for mutations process, not selection, which of course affects genes and regulatory elements.  
  > **username_2**: I'm not sure these tools allow parameter estimation from the data, but I've heard good things about Indelible https://academic.oup.com/mbe/article/26/8/1879/980884 and Evolver https://www.drive5.com/evolver/EvolverUserGuide.pdf  
  > **username_3**: Does this help: https://www.biorxiv.org/content/early/2017/11/22/223297 New synthetic-diploid benchmark for accurate variant calling evaluation  
  > **username_4**: FoldX is the state of the art method for mutation modelling (cited by countless papers).  It does not do exactly what you want without extra work though.  
  > **username_5**: The [MMOS](http://mmos.ch/) company developing [Citizen science](https://en.wikipedia.org/wiki/Citizen_science) solutions for these kind of tasks.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_6 on 2019-04-29. Score: 2
  
  **Question** I suspect this question is about the phylogenetics of methylation and the approach the investigator is proposing would be the last approach to use.
  
  **Summary**
  The approaches to assess the phylogenetics of methylation in order of preference are:
  
  * dN/dS between CpG sites and non-CpG sites,
  * An explicit molecular clock between CpG sites and non-CpG sites
  * A likelihood ration test (LRT) based on a null distribution of mutations generated by a Monte Carlo algorithm
  
  **Background/Rationale**
  The approaches you are using have been around for a long while and generate the random distribution of mutations for a given phylogeny. Its phylogenetics in reverse and the technique is known as Monte Carlo, you start with a randomised probability and send it through a parameterised model to predict the amino acid/nucleotide. Thus it is ML(max likelihood), Bayesian, "phylogenetic-HMM" in reverse. It is used within likelihood ratio test calculations. The model is determined by a standard ML, Bayesian phylogeny algorithm, i.e. its circular mathematics because there is no independent means of calculating the mutation behaviour, so the precise context you are using this for needs to be carefully considered.
  
  **Packages** There are lots of packages that do this type of Monte Carlo simulation, SOWHat being a good one (LRT) and you generate a large number of replicate data sets (100 or 1000). The one of the base algorithms is "seq-gen", although PAML may have implemented this.
  
  **Considerations** To use this style of approach you need to carefully consider your question. The "mutation simulations" when analysed via a phylogenetic program will produce the same parameters that you initially set and trees of basically the same length. If you are using this to generate a null distribution for a phylogenetics test these approaches are useful, you then compare the observed likelihood against the null distribution. If you are using it to work out whether the mutation rate at CpG sites is higher than at other sites, its one approach amongst a number of alternatives.
  
  **Drawbacks** Calculating a de novo null distribution of the mutation rate is computationally very expensive and therefore tends to the last calculation performed. It will address a single hypothesis, usually regarding topology.
  
  **Crux of the problem** To really do what (I think) you want to do you need an independent measure of mutation and mutational behaviour and its not trivial to achieve. You would have to consider it like a machine learning calculation, with a formal training set, I don't know whether such an approach has been implemented.
  
  **Strengths/Summary** In summary, Monte Carlo phylogenetics simulation has a limited application because of circularity of the calculation, BUT, BUT, BUT what I have omitted is when it is appropriate it is a very powerful test indeed.
  
  ---
  
  **Points of interest** I do like the population dynamic simulations within Beast, this certainly "a priori" and its potential IMO needs further exploration. However, I don't think you looking at how molecular epidemiology might impact the mutational behaviour methylation. I have not looked at Indelible, but looks interesting.
  
  I was going to talk about "processor war simulations" but its probably off-topic.
  
  > **Comments:**
  > **username_0**: Thanks for your response. My question is not so much about phylogenetics of methylation. What I need essentially is a null distribution for neutral mutations. MCMC or maximum likelihood helps a lot given that there is a model :) But I am not aware of a non-time revesible model accounting for sequence context and indels.  
  > **username_6**: I don't know what "sequence context" is but non-reversibility of mutations (and by inference time) is Beast, all other ML or Bayes (MCMCMC) algorithms have a symmetrical mutation matrices. MCMC in Bayes is different from the Monte Carlo used for nucleotide simulation. To honest the lack of clarity in the question is of concern, so I can't help any further.  
  > **username_0**: In classical phylogenetic models a probability of mutation at position N depends only on the nucleotide at that position and some measure of time. What I mean by sequence context here is the fact that probability of mutation will also depend on nucleotides and mutations at positions N-M..N+M. We have a wealth of empirical evidence that there is [such a dependency](https://doi.org/10.1038/ng.3292). But not many models accounting for it (such as [this one](https://doi.org/10.1093/molbev/msh039)). I will try to clarify the question and to give some background information there.  
  > **username_6**: So do I, but I bet you can't name the mechanism.  Anyway Nick Goldman did this years ago, its not new  
  
  ---
  
  