<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif"}
span.BalloonTextChar
        {font-family:"Tahoma","sans-serif"}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif"}
span.balloontextchar0
        {font-family:"Tahoma","sans-serif"}
span.emailstyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
span.balloontextchar00
        {font-family:"Tahoma","sans-serif"}
span.emailstyle23
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
span.EmailStyle25
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt;
        font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="EN-GB" link="blue" vlink="purple">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br>
<div><font size="2">Hi there, <br>
<br>
(please keep the forum posted)<br>
<br>
Easiest way is to subset the individuals you want to keep. genind objects can be subsetted like matrices, i.e. x[i,] where 'x' is your repooled genind and 'i' indicates individuals to keep.<br>
<br>
Cheers<br>
Thibaut<br>
<br>
</font>
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText"><br>
</div>
</span></font></div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF137334"><font face="Tahoma" color="#000000" size="2"><b>From:</b> Mark Coulson [Mark.Coulson.ic@uhi.ac.uk]<br>
<b>Sent:</b> 19 June 2015 12:51<br>
<b>To:</b> Jombart, Thibaut<br>
<b>Subject:</b> RE: supplementary individuals<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><a name="_MailEndCompose"><span style="color:#1F497D">Ok, so I did repool(A,B) and got a matrix with the correct dimensions. How do I extract the, say last 7 populations? I’ve used seppop on the combined dataframe now but obviously repool
 from here for the supplementary individuals will simply reverse the last action and still give me the wrong locus count.
</span></a></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">I have also tried the popsub from the poppr package but same result</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Mark</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"" lang="EN-US"> Jombart, Thibaut [mailto:t.jombart@imperial.ac.uk]
<br>
<b>Sent:</b> 19 June 2015 11:47<br>
<b>To:</b> Mark Coulson; adegenet-forum@lists.r-forge.r-project.org<br>
<b>Subject:</b> RE: supplementary individuals</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black"> </span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black">There is a function 'repool' to do what you need (see ?repool). If A and B are two geninds with different alleles, then it merges the datasets together to have
 matching alleles and dimensions.<br>
<br>
Dropping the locus is possible here indeed, but that's a potentially big loss of information if it is informative in the training set - this locus alone could define the most likely group assignment.<br>
<br>
Cheers<br>
Thibaut</span></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black"> </span></p>
</div>
</div>
</div>
</div>
<div>
<div class="MsoNormal" style="text-align:center" align="center"><span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black">
<hr size="2" width="100%" align="center">
</span></div>
<div id="divRpF342204">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black"> Mark Coulson [Mark.Coulson.ic@uhi.ac.uk]<br>
<b>Sent:</b> 19 June 2015 11:43<br>
<b>To:</b> Jombart, Thibaut<br>
<b>Subject:</b> RE: supplementary individuals</span><span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black"></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:#1F497D">Thanks Thibault! </span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Not sure what you mean about the repool. All individuals in the supplementary are fixed ‘0202’. My initial reaction was to simply drop this locus from both datasets and re-run the DAPC – what’s the easiest way
 to tell adegenet to omit a locus?</span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Best,</span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Mark</span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"></span></p>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black" lang="EN-US">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black" lang="EN-US"> Jombart, Thibaut [<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">mailto:t.jombart@imperial.ac.uk</a>]
<br>
<b>Sent:</b> 19 June 2015 11:41<br>
<b>To:</b> Mark Coulson; <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: supplementary individuals</span><span style="color:black"></span></p>
</div>
</div>
<p class="MsoNormal"><span style="color:black"> </span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black">Hi Mark<br>
<br>
I think you identified the problem. genind object keep only polymorphic sites. <br>
<br>
You would need to 'repool' your supplementary individuals to make sure loci/alleles match, and then just extract the relevant individuals for the prediction.<br>
<br>
Makes sense?<br>
<br>
Best<br>
Thibaut</span><span style="color:black"></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black"> </span><span style="color:black"></span></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black">               
<br>
==============================<br>
Dr Thibaut Jombart<br>
MRC Centre for Outbreak Analysis and Modelling<br>
Department of Infectious Disease Epidemiology<br>
Imperial College - School of Public Health<br>
Norfolk Place, London W2 1PG, UK<br>
Tel. : 0044 (0)20 7594 3658<br>
<a href="http://sites.google.com/site/thibautjombart/" target="_blank">http://sites.google.com/site/thibautjombart/</a><br>
<a href="http://sites.google.com/site/therepiproject/" target="_blank">http://sites.google.com/site/therepiproject/</a><br>
<a href="http://adegenet.r-forge.r-project.org/" target="_blank">http://adegenet.r-forge.r-project.org/</a><br>
Twitter: @thibautjombart</span><span style="color:black"></span></p>
</div>
</div>
</div>
</div>
<div>
<div class="MsoNormal" style="text-align:center" align="center"><span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black">
<hr size="2" width="100%" align="center">
</span></div>
<div id="divRpF790746">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"; color:black">
<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">
adegenet-forum-bounces@lists.r-forge.r-project.org</a> [adegenet-forum-bounces@lists.r-forge.r-project.org] on behalf of Mark Coulson [Mark.Coulson.ic@uhi.ac.uk]<br>
<b>Sent:</b> 19 June 2015 11:23<br>
<b>To:</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> [adegenet-forum] supplementary individuals</span><span style="color:black"></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:black">Hi Thibault,</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">I am trying to use the pred.sup function to assign ‘test’ individuals against my baseline data. Both baseline and supplementary individuals files load fine in adegenet but when I run the pred.sup function I get
 the following:</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:red">Error in predict.dapc(dapc1, newdata=sup):</span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:red">                Number of variables in newdata does not match original data.</span><span style="color:black"></span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">Looking at the dataframes, the baseline says it’s a matrix of 1800 x 70 (which I expect), however the supplementary says 69 for the latter(?). I have found that when  interrogating @loc.fac for the supplementary
 file, locus27 is only listed once, while all others are listed 2x. Perhaps a coincidence but this locus is the only one that is monomorphic  in the supplementary individuals but it is polymorphic in the baseline – would this have any effect?</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">Suggestions?</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">Thanks,</span></p>
<p class="MsoNormal"><span style="color:black">Mark</span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black">Inverness College UHI, a partner in the University of the Highlands and Islands
<a href="http://www.inverness.uhi.ac.uk" target="_blank">www.inverness.uhi.ac.uk</a> Board of Management of Inverness College (known as Inverness College UHI), Scottish Charity No SC021197.
</span><span style="color:black"></span></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black">Inverness College UHI, a partner in the University of the Highlands and Islands
<a href="http://www.inverness.uhi.ac.uk" target="_blank">www.inverness.uhi.ac.uk</a> Board of Management of Inverness College (known as Inverness College UHI), Scottish Charity No SC021197.
</span></p>
</div>
</div>
</div>
</div>
Inverness College UHI, a partner in the University of the Highlands and Islands www.inverness.uhi.ac.uk Board of Management of Inverness College (known as Inverness College UHI), Scottish Charity No SC021197.
</div>
</div>
</div>
</body>
</html>