<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Thanks Thibaut, this make sense. </p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Best,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">- Jarrett</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Thibaut Jombart <thibautjombart@gmail.com><br>
<b>Sent:</b> Wednesday, August 22, 2018 7:27:24 AM<br>
<b>To:</b> Jarrett Phillips<br>
<b>Cc:</b> adegenet-forum@lists.r-forge.r-project.org<br>
<b>Subject:</b> Re: [adegenet-forum] Nucleotide substitution model used by haploGen()/SeqTrack()</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div dir="ltr">I am not sure I understand the question. Each haplotype is, by definition, one sequence. I assume we are talking about the number of descendants for a given haplotype in the simulation. If so, you are right, the number of descendants is determined
 by the function 'repro', which defaults to: 
<div>function(){rpois(1,1.5)}</div>
<div><br>
</div>
<div>Then for each descendant:</div>
<div>- the time of evolution since the ancestral sequence is determined</div>
<div>- transitions and transversions are determined</div>
<div>- resulting sequences are output</div>
<div><br>
</div>
<div>Does it make sense?</div>
<div>Best</div>
<div>Thibaut</div>
<div><br>
</div>
<div>
<div><br>
</div>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr">On Mon, 20 Aug 2018 at 19:53, Jarrett Phillips <<a href="mailto:jphill01@uoguelph.ca">jphill01@uoguelph.ca</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_-5103179448802765504divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Thanks for the reply Thibaut.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I am actually just looking to generate some DNA sequences according to a given model of nucleotide substitution. </p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I opened a GitHub issue for the adegenet repository a few weeks ago, which was handled by Emmanuel Paradis, expressing my interest in being able to simulate DNA sequences without having to specify a phylogenetic tree
 as input. As I understand, the majority of R packages require a tree in order to simulate DNA sequences along branches. </p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">haploGen/seqTrack appears to be the only such R function that generates DNA sequences automatically, given a pre-specified mutation rate of transitions. </p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I do have a followup question, as I am tweaking your implemented code to handle other evolutionary models:</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">How exactly is the number of DNA sequences to be contained in each haplotype specified? Is this done with the repro() function in haploGen? That is, is the number of DNA sequences for each haplotype generated according
 to a </p>
<p style="margin-top:0; margin-bottom:0">Poisson(lambda = 1.5) distribution?</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thanks. </p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">- Jarrett</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
</div>
<hr style="display:inline-block; width:98%">
<div id="x_m_-5103179448802765504divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Thibaut Jombart <<a href="mailto:thibautjombart@gmail.com" target="_blank">thibautjombart@gmail.com</a>><br>
<b>Sent:</b> Monday, August 20, 2018 9:27:30 AM<br>
<b>To:</b> Jarrett Phillips<br>
<b>Cc:</b> <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">
adegenet-forum@lists.r-forge.r-project.org</a><br>
<b>Subject:</b> Re: [adegenet-forum] Nucleotide substitution model used by haploGen()/SeqTrack()</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi Jarrett
<div><br>
</div>
<div>if this is something you want to use for reconstructing transmission trees, I would recommend using a more advanced method such as outbreaker2 (<a href="http://www.repidemicsconsortium.org/outbreaker2/" target="_blank">http://www.repidemicsconsortium.org/outbreaker2/</a>)
 as SeqTrack was a very crude first pass at that problem. </div>
<div><br>
</div>
<div>As for the substitution model, in outbreak reconstruction is usually doesn't matter. But if you are doing phylogenetic reconstruction then I would use the usual ML / likelihood ratio tests to compare different models in phangorn. AIC / BIC should hopefully
 give similar results.</div>
<div><br>
</div>
<div>Best</div>
<div>Thibaut <br clear="all">
<div>
<div dir="ltr" class="x_m_-5103179448802765504x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div><font face="arial, helvetica, sans-serif" size="1"><br>
--<br>
Dr Thibaut Jombart<br>
Senior Lecturer in Genetic Analysis, Imperial College London</font></div>
<div><font face="arial, helvetica, sans-serif" size="1">Associate Professor in Outbreak Analytics, London School of Hygiene and Tropical Medicine<br>
Head of RECON: <a href="http://repidemicsconsortium.org" target="_blank">repidemicsconsortium.org</a></font></div>
<div><font face="arial, helvetica, sans-serif" size="1"><a href="https://thibautjombart.netlify.com" target="_blank" style="letter-spacing:0.2px">https://thibautjombart.netlify.com</a><br>
</font></div>
<div><font face="arial, helvetica, sans-serif" size="1">Twitter: @TeebzR<br>
+44(0)20 7594 3658</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
<br>
<div class="x_m_-5103179448802765504x_gmail_quote">
<div dir="ltr">On Fri, 17 Aug 2018 at 14:16, Jarrett Phillips <<a href="mailto:jphill01@uoguelph.ca" target="_blank">jphill01@uoguelph.ca</a>> wrote:<br>
</div>
<blockquote class="x_m_-5103179448802765504x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_-5103179448802765504x_m_-2728614225183633074divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
My inquiry concerns seqTrack(), which employs haploGen() to simulate a haplotype genealogy through time. </div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
haploGen() generates DNA sequences under a Kimura-2-Parameter substitution model with equal base frequencies and differing transition/transversion rates.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
<b>My question is</b>: how can we be certain that the sequences really do conform to a K2P model? Since these are simulated data, it would be difficult to choose the most parsimonious model based on the BIC (using MEGA software for instance), as one is required
 to select the appropriate codon table (e.g., standard vs. mitochondrial), to ensure proper placement of STOP codons. </div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
Trying this approach for each of standard and mitochondrial codon tables seems to give conflicting results as to the best substitution model.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
<br>
</div>
<p></p>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
<font size="3"><span style="font-size:12pt">Could someone shed some light on this? I would appreciate</span></font><font size="3"><span style="font-size:12pt"> any insight one might be able to </span></font><font size="3"><span style="font-size:12pt">offer.</span></font></div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
<font size="3"><span style="font-size:12pt"><br>
</span></font></div>
<div style="font-family:Calibri,Helvetica,sans-serif; margin-top:0px; margin-bottom:0px">
Thanks.</div>
</div>
</div>
_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a></blockquote>
</div>
</div>
</div>
</div>
_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a></blockquote>
</div>
</div>
</body>
</html>