Dear Tom,<div><br></div><div>the 'x' object provided in the example code corresponds to the genlight object and not to the factor specifying the pops, you just have to load the txt file of names and convert it to a factor then use </div>
<div><br></div><div>pop(your_genlight_obejct) <- your_factor_of_names #I_am_quite_sure :-)</div><div><br></div><div>Ciao</div><div><br></div><div>Valeria<br><br><div class="gmail_quote">On 24 August 2012 18:58, Tom Devitt <span dir="ltr"><<a href="mailto:tommydevitt@gmail.com" target="_blank">tommydevitt@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Thanks for your reply, Thibaut.<div><br></div><div>But how do I do this if I have a separate text file of population names corresponding to the individuals listed in the FASTA file? I can load the file of population names using read.table, but then I'm not sure how to use the pop argument from there.</div>
<div><br></div><div>When I tried:</div><div><br></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(0,52,255)"><span style="color:#942193">> </span>x <-("~/path/file.txt")</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(0,52,255)"><span style="color:#942193">> </span>pop(x)</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(0,52,255)">
<br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><font face="Helvetica" size="3">I get: </font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">
<font face="Helvetica" size="3"><br></font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(255,38,0)">Error in function (classes, fdef, mtable) : </div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(255,38,0)"> unable to find an inherited method for function "pop", for signature "character"</div>
</div><div><br></div><div>Sorry, just learning R . . .</div><div class="im"><div><br></div><div><div><br><div><div>On Aug 24, 2012, at 8:54 AM, Jombart, Thibaut wrote:</div><br><blockquote type="cite"><div>Hello, <br><br>
you need to use 'pop(x) <- ...' to change or set population information; for instance, using simulated data:<br><br><blockquote type="cite">x <- glSim(10,100)<br></blockquote><blockquote type="cite">pop(x)<br>
</blockquote> [1] A A A A A B B B B B<br>Levels: A B<br><blockquote type="cite">pop(x) <- rep(1:2, c(2,8))<br></blockquote><blockquote type="cite">pop(x)<br></blockquote> [1] 1 1 2 2 2 2 2 2 2 2<br>Levels: 1 2<br><br>Cheers<br>
<br>Thibaut<br><br><br>________________________________________<br>From: <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a>] on behalf of Tom Devitt [<a href="mailto:tommydevitt@gmail.com" target="_blank">tommydevitt@gmail.com</a>]<br>
Sent: 24 August 2012 13:25<br>To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>Subject: [adegenet-forum] pop argument<br><br>Could someone please help me understand how to include population information using the pop argument for a genlight object? I've used the read.DNA argument to input my data (FASTA format) and then the fasta2genlight argument to extract SNPs. I don't know how to specify individual population assignments using the pop argument. Thanks for your help.<br>
<br>(Sorry if this is a repost - I tried sending this message a couple days ago, but am not sure it posted to the forum.)<br>_______________________________________________<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" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br></div></blockquote></div><br></div></div>
</div></div><br>_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">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" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br></blockquote></div><br></div>