[adegenet-commits] r1071 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 8 19:05:08 CET 2013


Author: jombart
Date: 2013-02-08 19:05:08 +0100 (Fri, 08 Feb 2013)
New Revision: 1071

Modified:
   pkg/R/import.R
Log:
fixed an issue in fasta2genlight when there was no SNPs

Modified: pkg/R/import.R
===================================================================
--- pkg/R/import.R	2013-02-06 10:51:39 UTC (rev 1070)
+++ pkg/R/import.R	2013-02-08 18:05:08 UTC (rev 1071)
@@ -1111,6 +1111,10 @@
     ## POOL <- lapply(POOL, setdiff, "-")
     nb.alleles <- sapply(POOL, length)
     snp.posi <- nb.alleles==2
+    if(all(!snp.posi)){
+        warning("No polymorphism in the alignment - returning empty object")
+        return(new("genlight"))
+    }
     sec.all <- unlist(lapply(POOL[snp.posi], function(e) e[2]))
 
 



More information about the adegenet-commits mailing list