<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [adegenet-forum] seppop/repool question</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Dear Stephen,<BR>
<BR>
thanks for your post.<BR>
&gt; Hello,<BR>
&gt; I am trying to separate populations and repool them but I am getting an error which I think is due to the information I have stored in the $other slots. Below are the steps I took and the error that was returned. The question ultimately is why do I loose my $other information when I seppop and repool?<BR>
Well, separating genotypes into populations and then repooling the whole data is straightforward only for the genetic information. Since there could be anything inside the @other slot, it is difficult to know how to &quot;repool&quot; that information, and repool's current behaviour is indeed to discard this information. Another option might be to add non-empty @other slots of objects as components of the new (i.e. output of repool) @other slot, but that would not provide the same @other as before using 'seppop' anyway.<BR>
<BR>
When using seppop only, things are a bit different, since when items in the @other match individuals (in genind) or population in genpop), it makes sense to subset these items when subsetting individuals. This subsetting is done provided length or nrow of items match nrow(x@tab), and when &quot;[&quot; is called with argument &quot;treatOther&quot; set to TRUE (default).<BR>
&gt;&nbsp; Thanks in advance<BR>
&gt;<BR>
&gt; PCt &lt;- read.structure(&quot;PC7Nov20074pop_spca.str&quot;, n.ind=151, n.loc=9,&nbsp; onerowperind=T,<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; col.lab=1, col.pop=2, col.others=NULL, row.marknames=1, NA.char=&quot;-9&quot;, pop=pop,<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; missing=&quot;mean&quot;, ask=F, quiet=F)<BR>
&gt; PCxy &lt;- read.table(&quot;PC7Nov2007xy_spca.txt&quot;, header=T)<BR>
&gt; PCsex &lt;- read.table(&quot;PC7Nov2007sex_spca.txt&quot;, header=T)<BR>
&gt; PCs$other$xy &lt;- PCxy #2 column list of x and y coordinates<BR>
&gt; PCs$other$sex &lt;- PCsex #1 column list of the sex of animals (M,F,U)<BR>
&gt;<BR>
&gt; PCs<BR>
&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp; #####################<BR>
&gt;&nbsp;&nbsp;&nbsp; ### Genind object ###<BR>
&gt;&nbsp;&nbsp;&nbsp; #####################<BR>
&gt; - genotypes of individuals -<BR>
&gt;<BR>
&gt; S4 class:&nbsp; genind<BR>
&gt; @call: read.structure(file = &quot;PC7Nov20074pop_spca.str&quot;, n.ind = 151,<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; n.loc = 9, onerowperind = T, col.lab = 1, col.pop = 2, col.others = NULL,<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; row.marknames = 1, NA.char = &quot;-9&quot;, pop = NULL, missing = &quot;mean&quot;,<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; ask = F, quiet = F)<BR>
&gt;<BR>
&gt; @tab:&nbsp; 151 x 55 matrix of genotypes<BR>
&gt;<BR>
&gt; @ind.names: vector of&nbsp; 151 individual names<BR>
&gt; @loc.names: vector of&nbsp; 9 locus names<BR>
&gt; @loc.nall: number of alleles per locus<BR>
&gt; @loc.fac: locus factor for the&nbsp; 55 columns of @tab<BR>
&gt; @all.names: list of&nbsp; 9 components yielding allele names for each locus<BR>
&gt; @ploidy:&nbsp; 2<BR>
&gt;<BR>
&gt; Optionnal contents:<BR>
&gt; @pop:&nbsp; factor giving the population of each individual<BR>
&gt; @pop.names:&nbsp; factor giving the population of each individual<BR>
&gt;<BR>
&gt; @other: a list containing: xy&nbsp; sex<BR>
&gt;<BR>
&gt; ###seems good so far<BR>
&gt;<BR>
&gt; pop &lt;- c(&quot;Central&quot;, &quot;NorthEast&quot;, &quot;NorthWest&quot;, &quot;SouthCentral&quot;)<BR>
&gt; pcs &lt;- seppop(PCs)<BR>
&gt; pcs<BR>
&gt; ###everything looks fine except the $other slots which now say<BR>
&gt; #@other: a list containing: elements without names<BR>
Yes, this is abnormal, but I think I remember fixing this in the devel version.<BR>
&gt; ###and when I try to repool I get the following<BR>
&gt;<BR>
&gt; pcttt &lt;- repool(pctt$Central, pctt$SouthCentral, pctt$NorthEast)<BR>
&gt; pcttt<BR>
&gt;<BR>
&gt; ###everything looks fine except the $other slot which now say<BR>
&gt; #@other: - empty -<BR>
Yes, this is normal since it is difficult (in general, impossible) to know how to repool that kind of information. The most straightforward way to proceed is I guess to re-assign the other slot:<BR>
pcttt@other &lt;- PCs@other<BR>
<BR>
<BR>
Best regards,<BR>
<BR>
Thibaut.<BR>
<BR>
&gt;<BR>
&gt; Thanks<BR>
&gt; Stephen<BR>
&gt;<BR>
&gt;<BR>
&gt; Stephen D. Petersen, M.Sc. Ph.D.<BR>
&gt; Visiting Fellow, Fisheries &amp; Oceans Canada<BR>
&gt; Winnipeg, MB<BR>
&gt; E-mail:<BR>
&gt; stephen.petersen@dfo-mpo.gc.ca<BR>
&gt; stephenpetersen@trentu.ca<BR>
&gt; spetersen@nrdpfc.ca<BR>
&gt; &lt;<A HREF="http://sites.google.com/site/stephendpetersen/">http://sites.google.com/site/stephendpetersen/</A>&gt;<BR>
&gt; &lt;<A HREF="http://people.trentu.ca/stephenpetersen/">http://people.trentu.ca/stephenpetersen/</A>&gt;<BR>
&gt; &lt;<A HREF="http://ace.acadiau.ca/science/biol/Stephen/stephen_dp_home.htm">http://ace.acadiau.ca/science/biol/Stephen/stephen_dp_home.htm</A>&gt;<BR>
&gt; _______________________________________________<BR>
&gt; adegenet-forum mailing list<BR>
&gt; adegenet-forum@lists.r-forge.r-project.org<BR>
&gt; <A HREF="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</A><BR>
&gt;<BR>
&gt;<BR>
<BR>
<BR>
--<BR>
######################################<BR>
Dr Thibaut JOMBART<BR>
MRC Centre for Outbreak Analysis and Modelling<BR>
Department of Infectious Disease Epidemiology<BR>
Imperial College - Faculty of Medicine<BR>
St Mary&#146;s Campus<BR>
Norfolk Place<BR>
London W2 1PG<BR>
United Kingdom<BR>
Tel. : 0044 (0)20 7594 3658<BR>
t.jombart@imperial.ac.uk<BR>
<A HREF="http://biomserv.univ-lyon1.fr/%7Ejombart/">http://biomserv.univ-lyon1.fr/%7Ejombart/</A><BR>
<A HREF="http://adegenet.r-forge.r-project.org/">http://adegenet.r-forge.r-project.org/</A><BR>
</FONT>
</P>

</BODY>
</HTML>