[adegenet-commits] r708 - in www: . files/patches

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 5 15:34:24 CET 2010


Author: jombart
Date: 2010-11-05 15:34:24 +0100 (Fri, 05 Nov 2010)
New Revision: 708

Added:
   www/files/patches/makefreq.R
Modified:
   www/download.html
   www/news.html
Log:
updated site.


Modified: www/download.html
===================================================================
--- www/download.html	2010-11-05 14:28:00 UTC (rev 707)
+++ www/download.html	2010-11-05 14:34:24 UTC (rev 708)
@@ -18,15 +18,15 @@
 <img alt="" src="images/bullet.png" style="width: 10px; height: 10px;">
 The
 <span style="font-weight: bold;">current stable version</span>
-(adegenet_1.2-7)
+(adegenet_1.2-8)
 is available as:<br>
-- <a href="files/adegenet_1.2-7.tar.gz">linux/unix sources</a><br>
-- <a href="files/adegenet_1.2-7.tgz">MacOS X binary</a><br>
-- <a href="files/adegenet_1.2-7.zip">Windows binary</a><br>
+- <a href="files/adegenet_1.2-8.tar.gz">linux/unix sources</a><br>
+- MacOS X binary (to come)<br>
+- <a href="files/adegenet_1.2-8.zip">Windows binary</a><br>
 <br>
 <img alt="" src="images/bullet.png" style="width: 10px; height: 10px;">
 The
-<span style="font-weight: bold;">devel version</span> (adegenet_1.2-8)
+<span style="font-weight: bold;">devel version</span> (adegenet_1.2-9)
 is also available
 from <a href="https://r-forge.r-project.org/scm/?group_id=120"
  target="_top">R-Forge's
@@ -47,14 +47,25 @@
 use
 a
 patch.<br>
+<a href="files/patches/makefreq.R"><span style="font-family: monospace;">makefreq.R</span></a>:
+(for
+adegenet_1.2-8 or lower) fixes a an issue occuring when trying to
+compute frequences in data consisting in a single monomorphic locus.<br>
 <a href="files/patches/export.R"><span style="font-family: monospace;">export.R</span></a>:
-fixes issues in data conversion from adegenet to hierfstat
+(for
+adegenet_1.2-7 or lower) fixes issues in data conversion from adegenet
+to hierfstat
 (genind2hierfstat); also fixes <span style="font-family: monospace;">fstat</span>
 function.<br>
 <br>
 <img alt="" src="images/bullet.png" style="width: 10px; height: 10px;">
 <span style="font-weight: bold;">Older
 versions</span>:<br>
+adegenet_1.2-7<br>
+- <a href="files/adegenet_1.2-7.tar.gz">linux/unix sources</a><br>
+- <a href="files/adegenet_1.2-7.tgz">MacOS X binary</a><br>
+- <a href="files/adegenet_1.2-7.zip">Windows binary</a><br>
+<br>
 adegenet_1.2-6<br>
 - <a href="files/adegenet_1.2-6.tar.gz">linux/unix sources</a><br>
 - <a href="files/adegenet_1.2-6.tgz">MacOS X binary</a><br>

Added: www/files/patches/makefreq.R
===================================================================
--- www/files/patches/makefreq.R	                        (rev 0)
+++ www/files/patches/makefreq.R	2010-11-05 14:34:24 UTC (rev 708)
@@ -0,0 +1,59 @@
+####################
+# Function makefreq
+####################
+makefreq <- function(x,quiet=FALSE,missing=NA,truenames=TRUE){
+
+  if(!is.genpop(x)) stop("x is not a valid genpop object")
+  ##if(x at type=="PA") stop("frequencies not computable for presence/asbence data")
+  checkType(x)
+
+  if(!quiet) cat("\n Finding allelic frequencies from a genpop object... \n")
+
+  f1 <- function(v){
+    if(all(is.na(v)) || sum(v,na.rm=TRUE)==0) return(rep(NA,length(v)))
+    return(v/(sum(v,na.rm=TRUE)))
+  }
+
+  res <- list()
+
+  tabcount <- x at tab
+
+  eff.pop <- t(apply(tabcount,1,function(r) tapply(r,x at loc.fac,sum,na.rm=TRUE)))
+  if(nLoc(x)==1){ # fix for nloc==1
+      eff.pop <- t(eff.pop)
+  }
+
+  # tabfreq is a pop x loci table of allelic frequencies
+  tabfreq <- t(apply(tabcount,1,function(r) unlist(tapply(r,x at loc.fac,f1))))
+  if(length(x at loc.nall)==1 && x at loc.nall[1]==1) tabfreq <- t(tabfreq) # matrix is transposed by apply if there's a single allele
+  colnames(tabfreq) <- colnames(x at tab)
+
+  # NA treatment
+  # NA can be kept as is, or replaced 0 or by the mean frequency of the allele.
+  if(!is.na(missing)){
+    if(missing==0) tabfreq[is.na(tabfreq)] <- 0
+    if(toupper(missing)=="MEAN") {
+      moy <- apply(tabfreq,2,function(c) mean(c,na.rm=TRUE))
+      for(j in 1:ncol(tabfreq)) {tabfreq[,j][is.na(tabfreq[,j])] <- moy[j]}
+    }
+  }
+
+  if(!quiet) cat("\n...done.\n\n")
+
+  res$tab <- tabfreq
+  res$nobs <- eff.pop
+  res$call <- match.call()
+
+  ## handle truenames
+  if(truenames){
+      temp <- rep(x at loc.names,x at loc.nall)
+      colnames(res$tab) <- paste(temp,unlist(x at all.names),sep=".")
+      rownames(res$tab) <- x at pop.names
+
+      colnames(res$nobs) <- x at loc.names
+      rownames(res$nobs) <- x at pop.names
+  }
+
+  return(res)
+} #end makefreq
+

Modified: www/news.html
===================================================================
--- www/news.html	2010-11-05 14:28:00 UTC (rev 707)
+++ www/news.html	2010-11-05 14:34:24 UTC (rev 708)
@@ -18,7 +18,7 @@
  style="font-weight: bold;"></span><br>
 <span style="font-weight: bold;"></span>Current
 stable version of <span style="color: rgb(255, 0, 0);">adegenet is
-1.2-7 </span>for R.2.12.0.<br>
+1.2-8 </span>for R.2.12.0.<br>
 You can install the devel version from <a
  href="https://r-forge.r-project.org/scm/?group_id=120">R-Forge</a>.<br>
 See the current <a
@@ -27,9 +27,32 @@
 all modifications.<br>
 <br>
 <br>
-<span style="font-weight: bold;">29/10/2010 </span><span
+<span style="font-weight: bold;">05/11/2010 </span><span
  style="font-weight: bold;"></span><img
  style="width: 80px; height: 37px;" alt="" src="images/new.png"><br>
+<big>New adegenet version (<span style="color: rgb(255, 0, 0);">1.2-8</span>)
+has
+been
+released
+for
+R-2.12.0!</big><span style="color: rgb(255, 0, 0);"><span
+ style="color: rgb(0, 0, 0);">
+This release </span></span><span style="color: rgb(255, 0, 0);"><span
+ style="color: rgb(0, 0, 0);">fixes a bug in exports from adegenet to
+hierfstat (function <span
+ style="color: rgb(255, 0, 0); font-family: monospace;">genind2hierfstat</span>),
+which lead to wrong <span
+ style="font-family: monospace; color: rgb(255, 0, 0);">fstat</span>
+computations in some cases. See the </span></span><span
+ style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"></span></span><a
+ href="http://cran.r-project.org/web/packages/adegenet/ChangeLog">ChangeLog</a><span
+ style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"></span></span><span
+ style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">
+file for details.</span></span><br>
+<br>
+<br>
+<span style="font-weight: bold;">29/10/2010 </span><span
+ style="font-weight: bold;"></span><br>
 <big>New adegenet version (<span style="color: rgb(255, 0, 0);">1.2-7</span>)
 has
 been
@@ -192,7 +215,8 @@
 been
 updated
 at
-the same time as the package
+the
+same time as the package
 release!<br>
 <br>
 <br>
@@ -213,7 +237,8 @@
 many
 new
 things
-and corrects a few bugs
+and
+corrects a few bugs
 (see </span></span><a href="files/ChangeLog">ChangeLog</a><span
  style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">
 file). Amongst the biggest news, <span style="font-weight: bold;">several
@@ -230,8 +255,8 @@
 diversity
 using
 RGB
-scale, and a <span
- style="font-family: monospace; color: rgb(255, 0, 0);">loadingplot</span>,
+scale,
+and a <span style="font-family: monospace; color: rgb(255, 0, 0);">loadingplot</span>,
 which
 can
 be
@@ -239,7 +264,8 @@
 to
 assess
 the
-most structuring alleles and loci in an
+most
+structuring alleles and loci in an
 analysis.&nbsp; A new georeferenced genetic dataset is also available
 (dataset <span style="color: rgb(255, 0, 0); font-family: monospace;">rupica</span>).
 And...
@@ -263,7 +289,8 @@
 few
 bugs
 arising
-in version 1.2-0 (see </span></span><a href="files/ChangeLog">ChangeLog</a><span
+in
+version 1.2-0 (see </span></span><a href="files/ChangeLog">ChangeLog</a><span
  style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">
 file), especially an issue with the detection of NAs. Documentation was
 also improved (have a look at <span
@@ -287,7 +314,8 @@
 levels
 of
 ploidy
-and adds some new
+and
+adds some new
 features (see </span></span><a href="files/ChangeLog">ChangeLog</a><span
  style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">
 file):<br>
@@ -328,7 +356,8 @@
 bugs
 and
 adds
-some new features (see </span></span><a href="files/ChangeLog">ChangeLog</a><span
+some
+new features (see </span></span><a href="files/ChangeLog">ChangeLog</a><span
  style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">
 file):<br>
 &nbsp;&nbsp;&nbsp; - </span><span style="font-family: monospace;">genind2df</span></span>
@@ -364,7 +393,8 @@
 devel
 version
 of
-adegenet. It computes the <span style="color: rgb(255, 0, 0);">proportion
+adegenet.
+It computes the <span style="color: rgb(255, 0, 0);">proportion
 of
 shared alleles</span>
 among a set of genotypes.<br>
@@ -387,7 +417,8 @@
 bugs
 and
 adds
-some new features:<br>
+some
+new features:<br>
 &nbsp;&nbsp;&nbsp; - <span style="font-family: monospace;"></span></span></span><span
  style="text-decoration: underline;">I/O:</span> <span
  style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);"><span



More information about the adegenet-commits mailing list