[adegenet-commits] r1121 - pkg/vignettes www

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 8 15:19:07 CEST 2013


Author: jombart
Date: 2013-05-08 15:19:07 +0200 (Wed, 08 May 2013)
New Revision: 1121

Modified:
   pkg/vignettes/adegenet-dapc.tex
   www/literature.html
Log:
+1ref

Modified: pkg/vignettes/adegenet-dapc.tex
===================================================================
--- pkg/vignettes/adegenet-dapc.tex	2013-04-30 09:59:19 UTC (rev 1120)
+++ pkg/vignettes/adegenet-dapc.tex	2013-05-08 13:19:07 UTC (rev 1121)
@@ -21,7 +21,7 @@
 
 
 \newcommand{\code}[1]{{{\tt #1}}}
-\title{A tutorial for Discriminant Analysis of Principal Components (DAPC) using \textit{adegenet} 1.3-0}
+\title{A tutorial for Discriminant Analysis of Principal Components (DAPC) using \textit{adegenet} 1.3-7}
 \author{Thibaut Jombart}
 \date{\today}
 
@@ -204,12 +204,12 @@
 We specify that we want to evaluate up to $k=40$ groups (\texttt{max.n.clust=40}):
 \begin{Schunk}
 \begin{Sinput}
-> grp <- find.clusters(x, max.n.clust = 40)
+> grp <- find.clusters(x, max.n.clust=40)
 \end{Sinput}
 \end{Schunk}
 
 \begin{center}
-  \includegraphics[width=.7\textwidth]{figs/findclust-pca.pdf}
+  \includegraphics[width=.7\textwidth]{findclust-pca.pdf}
 \end{center}
 
 \noindent
@@ -221,7 +221,7 @@
 
 Then, the function displays a graph of BIC values for increasing values of $k$:
 \begin{center}
-  \includegraphics[width=.7\textwidth]{figs/findclust-bic.pdf}
+  \includegraphics[width=.7\textwidth]{findclust-bic.pdf}
 \end{center}
 
 \noindent This graph shows a clear decrease of BIC until $k=6$ clusters, after which BIC increases.
@@ -254,14 +254,14 @@
 \end{Sinput}
 \begin{Soutput}
 001 002 003 004 005 006 007 008 009 010 
-  1   1   1   5   1   1   1   1   1   1 
+  6   6   6   2   6   6   6   6   6   6 
 Levels: 1 2 3 4 5 6
 \end{Soutput}
 \begin{Sinput}
 > grp$size
 \end{Sinput}
 \begin{Soutput}
-[1]  98  97 102  99 105  99
+[1]  97 105 102  99  99  98
 \end{Soutput}
 \end{Schunk}
 
@@ -276,19 +276,18 @@
 \end{Sinput}
 \begin{Soutput}
       1   2   3   4   5   6
-  1  97   0   0   0   3   0
-  2   0   0   0  99   1   0
-  3   0   2   0   0   0  98
+  1   0   3   0   0   0  97
+  2   0   1   0   0  99   0
+  3   2   0   0  98   0   0
   4   0   0 100   0   0   0
-  5   1  95   2   0   2   0
-  6   0   0   0   0  99   1
+  5  95   2   2   0   0   1
+  6   0  99   0   1   0   0
 \end{Soutput}
 \begin{Sinput}
-> table.value(table(pop(x), grp$grp), col.lab = paste("inf", 1:6), 
-+     row.lab = paste("ori", 1:6))
+> table.value(table(pop(x), grp$grp), col.lab=paste("inf", 1:6), row.lab=paste("ori", 1:6))
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-006}
+\includegraphics{dapc-006}
 
 \noindent
 Rows correspond to actual groups ("ori''), while columns correspond to inferred groups ("inf'').
@@ -313,7 +312,7 @@
 better, more efficient summaries of the data than others.
 For instance, in the following case:
 \begin{center}
-  \includegraphics[width=.7\textwidth]{figs/findclust-noclearcut.pdf}
+  \includegraphics[width=.7\textwidth]{findclust-noclearcut.pdf}
 \end{center}
 
 \noindent , the concept of "true $k$" is fairly hypothetical. This does not mean that clutering
@@ -384,7 +383,7 @@
 probabilities returned by the method (see section below about the stability of membership probabilities).
 
 \begin{center}
-  \includegraphics[width=.7\textwidth]{figs/findclust-pca.pdf}
+  \includegraphics[width=.7\textwidth]{findclust-pca.pdf}
 \end{center}
 
 \noindent The bottomline is therefore retaining a few PCs without sacrificing too much information.
@@ -394,7 +393,7 @@
 Then, the method displays a barplot of eigenvalues for the discriminant analysis, asking for a
 number of discriminant functions to retain (unless argument \texttt{n.da} is provided).
 \begin{center}
-  \includegraphics[width=.7\textwidth]{figs/eigen-dapc.pdf}
+  \includegraphics[width=.7\textwidth]{eigen-dapc.pdf}
 \end{center}
 
 For small number of clusters, all eigenvalues can be retained since all discriminant functions can
@@ -409,9 +408,9 @@
 > dapc1
 \end{Sinput}
 \begin{Soutput}
-	#########################################
+	#################################################
 	# Discriminant Analysis of Principal Components #
-	#########################################
+	#################################################
 class: dapc
 $call: dapc.genind(x = x, pop = grp$grp, n.pca = 40, n.da = 100)
 
@@ -452,7 +451,7 @@
 > scatter(dapc1)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-010}
+\includegraphics{dapc-010}
 
 \noindent The obtained graph represents the individuals as dots and the groups as inertia
 ellipses. Eigenvalues of the analysis are displayed in inset. These graphs are fairly easy to
@@ -481,33 +480,31 @@
 
 \begin{Schunk}
 \begin{Sinput}
-> scatter(dapc1, posi.da = "bottomright", bg = "white", pch = 17:22)
+> scatter(dapc1, posi.da="bottomright", bg="white", pch=17:22)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-011}
+\includegraphics{dapc-011}
 
 \noindent This is still not entirely satisfying: we need to define other colors more visible over a white
 background, and we can remove the segments linking the points to their ellipses:
 \begin{Schunk}
 \begin{Sinput}
-> myCol <- c("darkblue", "purple", "green", "orange", "red", "blue")
-> scatter(dapc1, posi.da = "bottomright", bg = "white", pch = 17:22, 
-+     cstar = 0, col = myCol, scree.pca = TRUE, posi.pca = "bottomleft")
+> myCol <- c("darkblue","purple","green","orange","red","blue")
+> scatter(dapc1, posi.da="bottomright",  bg="white", pch=17:22, cstar=0, col=myCol, scree.pca=TRUE, posi.pca="bottomleft")
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-012}
+\includegraphics{dapc-012}
 
 \noindent Another possibility is remove the labels within the ellipses and add a legend to the
 plot. We also use the same symbol for all individuals, but use bigger dots and transparent colours
 to have a better feel for the density of individuals on the factorial plane.
 \begin{Schunk}
 \begin{Sinput}
-> scatter(dapc1, scree.da = FALSE, bg = "white", pch = 20, cell = 0, 
-+     cstar = 0, col = myCol, solid = 0.4, cex = 3, clab = 0, leg = TRUE, 
-+     txt.leg = paste("Cluster", 1:6))
+> scatter(dapc1, scree.da=FALSE, bg="white", pch=20,  cell=0, cstar=0, col=myCol, solid=.4,
++         cex=3,clab=0, leg=TRUE, txt.leg=paste("Cluster",1:6))
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-013}
+\includegraphics{dapc-013}
 
 We can also add a minimum spanning tree based on the (squared) distances between populations within the
 entire space.
@@ -519,27 +516,22 @@
 using \texttt{scree.pca=TRUE}).
 \begin{Schunk}
 \begin{Sinput}
-> scatter(dapc1, ratio.pca = 0.3, bg = "white", pch = 20, cell = 0, 
-+     cstar = 0, col = myCol, solid = 0.4, cex = 3, clab = 0, mstree = TRUE, 
-+     scree.da = FALSE, posi.pca = "bottomright", leg = TRUE, txt.leg = paste("Cluster", 
-+         1:6))
-> par(xpd = TRUE)
-> points(dapc1$grp.coord[, 1], dapc1$grp.coord[, 2], pch = 4, cex = 3, 
-+     lwd = 8, col = "black")
-> points(dapc1$grp.coord[, 1], dapc1$grp.coord[, 2], pch = 4, cex = 3, 
-+     lwd = 2, col = myCol)
-> myInset <- function() {
+> scatter(dapc1, ratio.pca=0.3, bg="white", pch=20,  cell=0, cstar=0, col=myCol, solid=.4,
++         cex=3, clab=0, mstree=TRUE, scree.da=FALSE,
++         posi.pca="bottomright", leg=TRUE, txt.leg=paste("Cluster",1:6))
+> par(xpd=TRUE)
+> points(dapc1$grp.coord[,1], dapc1$grp.coord[,2], pch=4, cex=3, lwd=8, col="black")
+> points(dapc1$grp.coord[,1], dapc1$grp.coord[,2], pch=4, cex=3, lwd=2, col=myCol)
+> myInset <- function(){
 +     temp <- dapc1$pca.eig
-+     temp <- 100 * cumsum(temp)/sum(temp)
-+     plot(temp, col = rep(c("black", "lightgrey"), c(dapc1$n.pca, 
-+         1000)), ylim = c(0, 100), xlab = "PCA axis", ylab = "Cumulated variance (%)", 
-+         cex = 1, pch = 20, type = "h", lwd = 2)
++     temp <- 100* cumsum(temp)/sum(temp)
++     plot(temp, col=rep(c("black","lightgrey"), c(dapc1$n.pca,1000)), ylim=c(0,100),
++          xlab="PCA axis", ylab="Cumulated variance (%)", cex=1, pch=20, type="h", lwd=2)
 + }
-> add.scatter(myInset(), posi = "bottomright", inset = c(-0.03, 
-+     -0.01), ratio = 0.28, bg = transp("white"))
+> add.scatter(myInset(), posi="bottomright", inset=c(-0.03,-0.01), ratio=.28, bg=transp("white"))
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-014}
+\includegraphics{dapc-014}
 
 
 Lastly, note that \texttt{scatter} can also represent a single discriminant function, which is
@@ -548,11 +540,10 @@
 different colors for different groups:
 \begin{Schunk}
 \begin{Sinput}
-> scatter(dapc1, 1, 1, col = myCol, bg = "white", scree.da = FALSE, 
-+     legend = TRUE, solid = 0.4)
+> scatter(dapc1,1,1, col=myCol, bg="white", scree.da=FALSE, legend=TRUE, solid=.4)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-015}
+\includegraphics{dapc-015}
 
 
 
@@ -604,7 +595,7 @@
 \end{Soutput}
 \begin{Sinput}
 > pop(H3N2) <- H3N2$other$epid
-> dapc.flu <- dapc(H3N2, n.pca = 30, n.da = 10)
+> dapc.flu <- dapc(H3N2, n.pca=30,n.da=10)
 \end{Sinput}
 \end{Schunk}
 
@@ -612,22 +603,20 @@
 second one shows the originality of 2006 strains.
 \begin{Schunk}
 \begin{Sinput}
-> myPal <- colorRampPalette(c("blue", "gold", "red"))
-> scatter(dapc.flu, col = transp(myPal(6)), scree.da = FALSE, cell = 1.5, 
-+     cex = 2, bg = "white", cstar = 0)
+> myPal <- colorRampPalette(c("blue","gold","red"))
+> scatter(dapc.flu, col=transp(myPal(6)), scree.da=FALSE, cell=1.5, cex=2, bg="white",cstar=0)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-017}
+\includegraphics{dapc-017}
 
 We can assess which alleles most highlight the originality of 2006 using \texttt{loadingplot}:
 \begin{Schunk}
 \begin{Sinput}
 > set.seed(4)
-> contrib <- loadingplot(dapc.flu$var.contr, axis = 2, thres = 0.07, 
-+     lab.jitter = 1)
+> contrib <- loadingplot(dapc.flu$var.contr, axis=2, thres=.07, lab.jitter=1)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-018}
+\includegraphics{dapc-018}
 
 \noindent \texttt{temp} is a list invisibly returned by \texttt{loadingplot} which contains the most
 contributing alleles (i.e., contributions above a given threshold -- argument \texttt{threshold}).
@@ -638,10 +627,8 @@
 > temp <- seploc(H3N2)
 > snp906 <- truenames(temp[["906"]])$tab
 > snp399 <- truenames(temp[["399"]])$tab
-> freq906 <- apply(snp906, 2, function(e) tapply(e, pop(H3N2), 
-+     mean, na.rm = TRUE))
-> freq399 <- apply(snp399, 2, function(e) tapply(e, pop(H3N2), 
-+     mean, na.rm = TRUE))
+> freq906 <- apply(snp906, 2, function(e) tapply(e, pop(H3N2), mean, na.rm=TRUE))
+> freq399 <- apply(snp399, 2, function(e) tapply(e, pop(H3N2), mean, na.rm=TRUE))
 > freq906
 \end{Sinput}
 \begin{Soutput}
@@ -666,16 +653,14 @@
 2006 0.357142857 0.6428571
 \end{Soutput}
 \begin{Sinput}
-> par(mfrow = c(1, 2), mar = c(5.1, 4.1, 4.1, 0.1), las = 3)
-> matplot(freq906, pch = c("a", "c"), type = "b", xlab = "year", 
-+     ylab = "allele frequency", xaxt = "n", cex = 1.5, main = "SNP # 906")
-> axis(side = 1, at = 1:6, lab = 2001:2006)
-> matplot(freq399, pch = c("c", "t"), type = "b", xlab = "year", 
-+     ylab = "allele frequency", xaxt = "n", cex = 1.5, main = "SNP # 399")
-> axis(side = 1, at = 1:6, lab = 2001:2006)
+> par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,.1),las=3)
+> matplot(freq906, pch=c("a","c"), type="b",xlab="year",ylab="allele frequency", xaxt="n", cex=1.5, main="SNP # 906")
+> axis(side=1, at=1:6, lab=2001:2006)
+> matplot(freq399, pch=c("c","t"), type="b", xlab="year",ylab="allele frequency", xaxt="n", cex=1.5, main="SNP # 399")
+> axis(side=1, at=1:6, lab=2001:2006)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-019}
+\includegraphics{dapc-019}
 
 In both cases, a new allele appeared in 2005 at a very low frequency, and reached high or even dominant frequencies a
 year later.
@@ -714,16 +699,16 @@
 [1] 600   6
 \end{Soutput}
 \begin{Sinput}
-> round(head(dapc1$posterior), 3)
+> round(head(dapc1$posterior),3)
 \end{Sinput}
 \begin{Soutput}
-        1 2 3 4     5 6
-001 1.000 0 0 0 0.000 0
-002 1.000 0 0 0 0.000 0
-003 1.000 0 0 0 0.000 0
-004 0.016 0 0 0 0.984 0
-005 1.000 0 0 0 0.000 0
-006 1.000 0 0 0 0.000 0
+    1     2 3 4 5     6
+001 0 0.000 0 0 0 1.000
+002 0 0.000 0 0 0 1.000
+003 0 0.000 0 0 0 1.000
+004 0 0.984 0 0 0 0.016
+005 0 0.000 0 0 0 1.000
+006 0 0.000 0 0 0 1.000
 \end{Soutput}
 \end{Schunk}
 Each row corresponds to an individual, each column to a group.
@@ -744,17 +729,17 @@
 
 $assign.per.pop
         1         2         3         4         5         6 
-1.0000000 1.0000000 0.9901961 1.0000000 0.9904762 1.0000000 
+1.0000000 0.9904762 0.9901961 1.0000000 1.0000000 1.0000000 
 
 $prior.grp.size
 
   1   2   3   4   5   6 
- 98  97 102  99 105  99 
+ 97 105 102  99  99  98 
 
 $post.grp.size
 
   1   2   3   4   5   6 
- 99  97 101  99 105  99 
+ 97 105 101  99  99  99 
 \end{Soutput}
 \end{Schunk}
 The slot \texttt{assign.per.pop} indicates the proportions of successful reassignment (based on
@@ -766,10 +751,10 @@
 options); here, we choose to represent only the first 50 individuals to make the figure readable:
 \begin{Schunk}
 \begin{Sinput}
-> assignplot(dapc1, subset = 1:50)
+> assignplot(dapc1, subset=1:50)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-022}
+\includegraphics{dapc-022}
 
 \noindent
 This figure is the simple graphical translation of the \texttt{posterior} table above. Heat colors
@@ -787,27 +772,25 @@
 We can plot information of all individuals to have a global picture of the clusters composition.
 \begin{Schunk}
 \begin{Sinput}
-> compoplot(dapc1, posi = "bottomright", txt.leg = paste("Cluster", 
-+     1:6), lab = "", ncol = 1, xlab = "individuals")
+> compoplot(dapc1, posi="bottomright", txt.leg=paste("Cluster", 1:6), lab="", ncol=1, xlab="individuals")
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-023}
+\includegraphics{dapc-023}
 
 \noindent We can also have a closer look at a subset of individuals; for instance, for the first 50 individuals:
 \begin{Schunk}
 \begin{Sinput}
-> compoplot(dapc1, subset = 1:50, posi = "bottomright", txt.leg = paste("Cluster", 
-+     1:6), lab = "", ncol = 2, xlab = "individuals")
+> compoplot(dapc1, subset=1:50, posi="bottomright", txt.leg=paste("Cluster", 1:6), lab="", ncol=2, xlab="individuals")
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-024}
+\includegraphics{dapc-024}
 
 Obviously, we can use the power of R to lead our investigation further. For instance, which are the
 most 'admixed' individuals?
 Let us consider as admixed individuals having no more than 90\% of probability of membership in a single cluster:
 \begin{Schunk}
 \begin{Sinput}
-> temp <- which(apply(dapc1$posterior, 1, function(e) all(e < 0.9)))
+> temp <- which(apply(dapc1$posterior,1, function(e) all(e<0.9)))
 > temp
 \end{Sinput}
 \begin{Soutput}
@@ -815,11 +798,10 @@
  21  47 243 280 
 \end{Soutput}
 \begin{Sinput}
-> compoplot(dapc1, subset = temp, posi = "bottomright", txt.leg = paste("Cluster", 
-+     1:6), ncol = 2)
+> compoplot(dapc1, subset=temp, posi="bottomright", txt.leg=paste("Cluster", 1:6),  ncol=2)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-025}
+\includegraphics{dapc-025}
 
 
 
@@ -881,18 +863,16 @@
 @other: a list containing: coun  breed  spe 
 \end{Soutput}
 \begin{Sinput}
-> temp <- summary(dapc(microbov, n.da = 100, n.pca = 3))$assign.per.pop * 
-+     100
+> temp <- summary(dapc(microbov, n.da=100, n.pca=3))$assign.per.pop*100
 \end{Sinput}
 \end{Schunk}
 \begin{Schunk}
 \begin{Sinput}
-> par(mar = c(4.5, 7.5, 1, 1))
-> barplot(temp, xlab = "% of reassignment to actual breed", horiz = TRUE, 
-+     las = 1)
+> par(mar=c(4.5,7.5,1,1))
+> barplot(temp, xlab="% of reassignment to actual breed", horiz=TRUE, las=1)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-027}
+\includegraphics{dapc-027}
 
 \noindent
 We can see that some breeds are well discriminated (e.g. Zebu, Lagunaire,  > 90\%) while others are
@@ -901,18 +881,16 @@
 We repeat the analysis, this time keeping 300 PCs:
 \begin{Schunk}
 \begin{Sinput}
-> temp <- summary(dapc(microbov, n.da = 100, n.pca = 300))$assign.per.pop * 
-+     100
+> temp <- summary(dapc(microbov, n.da=100, n.pca=300))$assign.per.pop*100
 \end{Sinput}
 \end{Schunk}
 \begin{Schunk}
 \begin{Sinput}
-> par(mar = c(4.5, 7.5, 1, 1))
-> barplot(temp, xlab = "% of reassignment to actual breed", horiz = TRUE, 
-+     las = 1)
+> par(mar=c(4.5,7.5,1,1))
+> barplot(temp, xlab="% of reassignment to actual breed", horiz=TRUE, las=1)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-029}
+\includegraphics{dapc-029}
 
 \noindent We now obtain almost 100\% of discrimination for all groups.
 Is this result satisfying? Actually not.
@@ -923,18 +901,16 @@
 \begin{Sinput}
 > x <- microbov
 > pop(x) <- sample(pop(x))
-> temp <- summary(dapc(x, n.da = 100, n.pca = 300))$assign.per.pop * 
-+     100
+> temp <- summary(dapc(x, n.da=100, n.pca=300))$assign.per.pop*100
 \end{Sinput}
 \end{Schunk}
 \begin{Schunk}
 \begin{Sinput}
-> par(mar = c(4.5, 7.5, 1, 1))
-> barplot(temp, xlab = "% of reassignment to actual breed", horiz = TRUE, 
-+     las = 1)
+> par(mar=c(4.5,7.5,1,1))
+> barplot(temp, xlab="% of reassignment to actual breed", horiz=TRUE, las=1)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-031}
+\includegraphics{dapc-031}
 
 \noindent
 Groups have been randomised, and yet we still get very good discrimination.
@@ -955,7 +931,7 @@
 groups, and computing $a$-scores for each group, as well as the average $a$-score:
 \begin{Schunk}
 \begin{Sinput}
-> dapc2 <- dapc(microbov, n.da = 100, n.pca = 10)
+> dapc2 <- dapc(microbov, n.da=100, n.pca=10)
 > temp <- a.score(dapc2)
 > names(temp)
 \end{Sinput}
@@ -963,7 +939,7 @@
 [1] "tab"       "pop.score" "mean"     
 \end{Soutput}
 \begin{Sinput}
-> temp$tab[1:5, 1:5]
+> temp$tab[1:5,1:5]
 \end{Sinput}
 \begin{Soutput}
       Borgou Zebu Lagunaire     NDama Somba
@@ -995,7 +971,7 @@
 The number of retained PCs can be chosen so as to optimize the $a$-score; this is achived by \texttt{optim.a.score}:
 \begin{Schunk}
 \begin{Sinput}
-> dapc2 <- dapc(microbov, n.da = 100, n.pca = 50)
+> dapc2 <- dapc(microbov, n.da=100, n.pca=50)
 \end{Sinput}
 \end{Schunk}
 \begin{Schunk}
@@ -1004,7 +980,7 @@
 \end{Sinput}
 \end{Schunk}
 \begin{center}
-  \includegraphics[width=.7\textwidth]{figs/ascore.pdf}
+  \includegraphics[width=.7\textwidth]{ascore.pdf}
 \end{center}
 
 
@@ -1019,23 +995,23 @@
 We perform the analysis with 20 PCs retained, and then map the membership probabilities as before:
 \begin{Schunk}
 \begin{Sinput}
-> dapc3 <- dapc(microbov, n.da = 100, n.pca = 20)
+> dapc3 <- dapc(microbov, n.da=100, n.pca=20)
 > myCol <- rainbow(15)
 \end{Sinput}
 \end{Schunk}
 \begin{Schunk}
 \begin{Sinput}
-> par(mar = c(5.1, 4.1, 1.1, 1.1), xpd = TRUE)
-> compoplot(dapc3, lab = "", posi = list(x = 12, y = -0.01), cleg = 0.7)
+> par(mar=c(5.1,4.1,1.1,1.1), xpd=TRUE)
+> compoplot(dapc3, lab="", posi=list(x=12,y=-.01), cleg=.7)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-036}
+\includegraphics{dapc-036}
 
 And as before, we can investigate further admixed individuals, which we arbitrarily define as those
 having no more than 0.5 probability of membership to any group:
 \begin{Schunk}
 \begin{Sinput}
-> temp <- which(apply(dapc3$posterior, 1, function(e) all(e < 0.5)))
+> temp <- which(apply(dapc3$posterior,1, function(e) all(e<0.5)))
 > temp
 \end{Sinput}
 \begin{Soutput}
@@ -1052,12 +1028,11 @@
 \end{Soutput}
 \begin{Sinput}
 > lab <- pop(microbov)
-> par(mar = c(8, 4, 5, 1), xpd = TRUE)
-> compoplot(dapc3, subset = temp, cleg = 0.6, posi = list(x = 0, 
-+     y = 1.2), lab = lab)
+> par(mar=c(8,4,5,1), xpd=TRUE)
+> compoplot(dapc3, subset=temp, cleg=.6, posi=list(x=0,y=1.2),lab=lab)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-037}
+\includegraphics{dapc-037}
 
 \noindent Admixture appears to be the strongest between a few breeds (Blonde d'Aquitaine, Bretonne Pie-Noire,
 Limousine and Gascone). Some features are fairly surprising; for instance, the last individual is
@@ -1102,8 +1077,7 @@
 \begin{Sinput}
 > data(microbov)
 > set.seed(2)
-> kept.id <- unlist(tapply(1:nInd(microbov), pop(microbov), function(e) sample(e, 
-+     20, replace = FALSE)))
+> kept.id <- unlist(tapply(1:nInd(microbov), pop(microbov), function(e) sample(e, 20,replace=FALSE)))
 > x <- microbov[kept.id]
 > x.sup <- microbov[-kept.id]
 > nInd(x)
@@ -1126,8 +1100,8 @@
 supplementary individuals:
 \begin{Schunk}
 \begin{Sinput}
-> dapc4 <- dapc(x, n.pca = 20, n.da = 15)
-> pred.sup <- predict.dapc(dapc4, newdata = x.sup)
+> dapc4 <- dapc(x,n.pca=20,n.da=15)
+> pred.sup <- predict.dapc(dapc4, newdata=x.sup)
 > names(pred.sup)
 \end{Sinput}
 \begin{Soutput}
@@ -1141,7 +1115,7 @@
 15 Levels: Borgou Zebu Lagunaire NDama Somba Aubrac ... Salers
 \end{Soutput}
 \begin{Sinput}
-> pred.sup$ind.scores[1:5, 1:3]
+> pred.sup$ind.scores[1:5,1:3]
 \end{Sinput}
 \begin{Soutput}
           LD1       LD2        LD3
@@ -1152,7 +1126,7 @@
 005 -4.718570 -0.200391 -0.9196541
 \end{Soutput}
 \begin{Sinput}
-> round(pred.sup$posterior[1:5, 1:5], 3)
+> round(pred.sup$posterior[1:5, 1:5],3)
 \end{Sinput}
 \begin{Soutput}
     Borgou  Zebu Lagunaire NDama Somba
@@ -1173,26 +1147,23 @@
 \begin{Schunk}
 \begin{Sinput}
 > col <- rainbow(length(levels(pop(x))))
-> col.points <- transp(col[as.integer(pop(x))], 0.2)
-> scatter(dapc4, col = col, bg = "white", scree.da = 0, pch = "", 
-+     cstar = 0, clab = 0, xlim = c(-10, 10), legend = TRUE)
-> par(xpd = TRUE)
-> points(dapc4$ind.coord[, 1], dapc4$ind.coord[, 2], pch = 20, 
-+     col = col.points, cex = 5)
+> col.points <- transp(col[as.integer(pop(x))],.2)
+> scatter(dapc4, col=col, bg="white", scree.da=0, pch="", cstar=0, clab=0, xlim=c(-10,10), legend=TRUE)
+> par(xpd=TRUE)
+> points(dapc4$ind.coord[,1], dapc4$ind.coord[,2], pch=20, col=col.points, cex=5)
 > col.sup <- col[as.integer(pop(x.sup))]
-> points(pred.sup$ind.scores[, 1], pred.sup$ind.scores[, 2], pch = 15, 
-+     col = transp(col.sup, 0.7), cex = 2)
-> add.scatter.eig(dapc4$eig, 15, 1, 2, posi = "bottomright", inset = 0.02)
+> points(pred.sup$ind.scores[,1], pred.sup$ind.scores[,2], pch=15, col=transp(col.sup,.7), cex=2)
+> add.scatter.eig(dapc4$eig,15,1,2, posi="bottomright", inset=.02)
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-040}
+\includegraphics{dapc-040}
 
 \noindent Light dots and ellipses correspond to the original analysis, while more solid squares indicate
 supplementary individuals.
 Results are fairly satisfying:
 \begin{Schunk}
 \begin{Sinput}
-> mean(as.character(pred.sup$assign) == as.character(pop(x.sup)))
+> mean(as.character(pred.sup$assign)==as.character(pop(x.sup)))
 \end{Sinput}
 \begin{Soutput}
 [1] 0.7549505
@@ -1204,10 +1175,10 @@
 table of the actual cluster \textit{vs} the inferred one:
 \begin{Schunk}
 \begin{Sinput}
-> table.value(table(pred.sup$assign, pop(x.sup)), col.lab = levels(pop(x.sup)))
+> table.value(table(pred.sup$assign, pop(x.sup)), col.lab=levels(pop(x.sup)))
 \end{Sinput}
 \end{Schunk}
-\includegraphics{figs/dapc-042}
+\includegraphics{dapc-042}
 
 \noindent Columns correspond to actual clusters of the supplementary individuals, while rows
 correspond to inferred clusters.

Modified: www/literature.html
===================================================================
--- www/literature.html	2013-04-30 09:59:19 UTC (rev 1120)
+++ www/literature.html	2013-05-08 13:19:07 UTC (rev 1121)
@@ -63,6 +63,7 @@
 
 
 
+
         the bublisher's website</a><span style="color: rgb(0, 153, 0);">]</span>
       <br style="color: rgb(0, 153, 0);">
       <br>
@@ -95,6 +96,7 @@
 
 
 
+
         abstract</a>]<br>
       <br>
       - the paper presenting the <span style="font-style: italic;">spatial
@@ -112,6 +114,7 @@
 
 
 
+
         principal component analysis</span> (<span style="font-style:
         italic;">sPCA</span>, function <span style="font-family:
         monospace; color: rgb(255, 0, 0);">spca</span>), global and
@@ -132,6 +135,7 @@
 
 
 
+
       cryptic spatial patterns in genetic variability by a new
       multivariate method.  <span style="font-style: italic;">Heredity</span>
       <span style="font-weight: bold;">101</span>: 92-103. doi:
@@ -153,6 +157,7 @@
 
 
 
+
         abstract</a>]<br>
     </div>
     <br>
@@ -176,6 +181,7 @@
 
 
 
+
       simulations of genealoies of haplotypes (<span style="font-family:
         monospace; color: rgb(255, 0, 0);">haploGen</span>):<br>
       <b>Jombart T, </b>Eggo RM, Dodd PJ, Balloux F (2010)
@@ -199,6 +205,7 @@
 
 
 
+
         of Principal Components</span> (<span style="font-style:
         italic;">DAPC</span>, functions <span style="font-family:
         monospace;"><span style="color: rgb(255, 0, 0);">find.clusters</span>
@@ -230,6 +237,7 @@
 
 
 
+
         Behaviour</i><i></i><span style="font-weight: bold;">76</span>:
       87-95.<br>
       <br>
@@ -250,6 +258,7 @@
 
 
 
+
           Genomics</span></span><span class="citation-publication-date"></span><span
         style="font-weight: bold;" class="citation-volume">9</span><span
         class="citation-issue"></span>: 256.<br>
@@ -285,6 +294,7 @@
 
 
 
+
             marmota</span>.</span><span style="font-style: italic;">Molecular
 
 
@@ -299,6 +309,7 @@
 
 
 
+
           Ecology</span> <span style="font-weight: bold;">18</span>:
         1491-1503.<br>
         <br>
@@ -352,6 +363,7 @@
 
 
 
+
           australis</i> in North America. <span style="font-style:
           italic;">Biological Invasions</span>. doi:
         10.1007/s10530-010-9699-6.<br>
@@ -509,6 +521,7 @@
 
 
 
+
           Oct 6. [Epub ahead of print]<br>
         </p>
         <p class="auth_list">[24] SANTOS, H., BURBAN, C., ROUSSELET, J.,
@@ -527,6 +540,7 @@
 
 
 
+
             pityocampa</em>, Lepidoptera, Notodontidae). <span
             style="font-style: italic;">Journal of Evolutionary Biology</span>,
           no. doi: 10.1111/j.1420-9101.2010.02147.x<br>
@@ -550,6 +564,7 @@
 
 
 
+
             Vol. Sci. Pap. ICCAT</span>, 65(3): 988-995</p>
         <p class="intro">[26] <span class="citation_author">Vandewoestijne
 
@@ -566,6 +581,7 @@
 
 
 
+
             S, </span> <span class="citation_author">Van Dyck H, </span>
           <span class="citation_date">2010</span> <span
             class="citation_article_title">Population Genetic
@@ -585,6 +601,7 @@
 
 
 
+
             ONE</span><span class="citation_issue">5(11):</span> <span
             class="citation_start_page">e13810.</span> <span
             class="citation_doi">doi:10.1371/journal.pone.0013810<br>
@@ -615,6 +632,7 @@
 
 
 
+
           </span><span class="doi"><span class="label">DOI:</span> <span
               class="value">10.1007/s10329-010-0232-4<br>
             </span></span></p>
@@ -682,6 +700,7 @@
 
 
 
+
             tetradactylum</em>: Polynemidae). Molecular Ecology,
           20: no. doi: 10.1111/j.1365-294X.2011.05097.x<br>
         </p>
@@ -707,6 +726,7 @@
 
 
 
+
               neoformans</i> Variety <i>grubii</i> Multilocus Sequence
             Types from Thailand Are Consistent with an Ancestral African
             Origin.</span> <span class="citation_journal_title">PLoS
@@ -964,6 +984,7 @@
 
 
 
+
         10.1007/s10709-012-9640-2<br>
         <br>
         [76] Samantha Baldwin, Meeghan Pither-Joyce, Kathryn Wright,
@@ -1608,8 +1629,13 @@
         divergence in Atlantic cod. Molecular Ecology, 22: 2653–2667.
         doi: 10.1111/mec.12284<br>
         <br>
+        [186] Costantini F, Carlesi L, Abbiati M (2013) Quantifying
+        Spatial Genetic Structuring in Mesophotic Populations of the
+        Precious Coral Corallium rubrum. PLoS ONE 8(4): e61546.
+        doi:10.1371/journal.pone.0061546<br>
         <br>
         <br>
+        <br>
         <p></p>
         <p class="intro">* adegenet not or wrongly cited, but actually
           used in the paper. <br>



More information about the adegenet-commits mailing list