<!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>
> Hello,<BR>
> 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 "repool" 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 "[" is called with argument "treatOther" set to TRUE (default).<BR>
> Thanks in advance<BR>
><BR>
> PCt <- read.structure("PC7Nov20074pop_spca.str", n.ind=151, n.loc=9, onerowperind=T,<BR>
> col.lab=1, col.pop=2, col.others=NULL, row.marknames=1, NA.char="-9", pop=pop,<BR>
> missing="mean", ask=F, quiet=F)<BR>
> PCxy <- read.table("PC7Nov2007xy_spca.txt", header=T)<BR>
> PCsex <- read.table("PC7Nov2007sex_spca.txt", header=T)<BR>
> PCs$other$xy <- PCxy #2 column list of x and y coordinates<BR>
> PCs$other$sex <- PCsex #1 column list of the sex of animals (M,F,U)<BR>
><BR>
> PCs<BR>
><BR>
> #####################<BR>
> ### Genind object ###<BR>
> #####################<BR>
> - genotypes of individuals -<BR>
><BR>
> S4 class: genind<BR>
> @call: read.structure(file = "PC7Nov20074pop_spca.str", n.ind = 151,<BR>
> n.loc = 9, onerowperind = T, col.lab = 1, col.pop = 2, col.others = NULL,<BR>
> row.marknames = 1, NA.char = "-9", pop = NULL, missing = "mean",<BR>
> ask = F, quiet = F)<BR>
><BR>
> @tab: 151 x 55 matrix of genotypes<BR>
><BR>
> @ind.names: vector of 151 individual names<BR>
> @loc.names: vector of 9 locus names<BR>
> @loc.nall: number of alleles per locus<BR>
> @loc.fac: locus factor for the 55 columns of @tab<BR>
> @all.names: list of 9 components yielding allele names for each locus<BR>
> @ploidy: 2<BR>
><BR>
> Optionnal contents:<BR>
> @pop: factor giving the population of each individual<BR>
> @pop.names: factor giving the population of each individual<BR>
><BR>
> @other: a list containing: xy sex<BR>
><BR>
> ###seems good so far<BR>
><BR>
> pop <- c("Central", "NorthEast", "NorthWest", "SouthCentral")<BR>
> pcs <- seppop(PCs)<BR>
> pcs<BR>
> ###everything looks fine except the $other slots which now say<BR>
> #@other: a list containing: elements without names<BR>
Yes, this is abnormal, but I think I remember fixing this in the devel version.<BR>
> ###and when I try to repool I get the following<BR>
><BR>
> pcttt <- repool(pctt$Central, pctt$SouthCentral, pctt$NorthEast)<BR>
> pcttt<BR>
><BR>
> ###everything looks fine except the $other slot which now say<BR>
> #@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 <- PCs@other<BR>
<BR>
<BR>
Best regards,<BR>
<BR>
Thibaut.<BR>
<BR>
><BR>
> Thanks<BR>
> Stephen<BR>
><BR>
><BR>
> Stephen D. Petersen, M.Sc. Ph.D.<BR>
> Visiting Fellow, Fisheries & Oceans Canada<BR>
> Winnipeg, MB<BR>
> E-mail:<BR>
> stephen.petersen@dfo-mpo.gc.ca<BR>
> stephenpetersen@trentu.ca<BR>
> spetersen@nrdpfc.ca<BR>
> <<A HREF="http://sites.google.com/site/stephendpetersen/">http://sites.google.com/site/stephendpetersen/</A>><BR>
> <<A HREF="http://people.trentu.ca/stephenpetersen/">http://people.trentu.ca/stephenpetersen/</A>><BR>
> <<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>><BR>
> _______________________________________________<BR>
> adegenet-forum mailing list<BR>
> adegenet-forum@lists.r-forge.r-project.org<BR>
> <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>
><BR>
><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’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>