[adegenet-commits] r762 - pkg/R www
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Jan 15 15:53:54 CET 2011
Author: jombart
Date: 2011-01-15 15:53:53 +0100 (Sat, 15 Jan 2011)
New Revision: 762
Modified:
pkg/R/SNPbin.R
pkg/R/glFunctions.R
www/literature.html
Log:
Fixed a few stupid long operations in genlight constructor (& replaced with &&)
Added one ref.
Modified: pkg/R/SNPbin.R
===================================================================
--- pkg/R/SNPbin.R 2011-01-14 15:09:12 UTC (rev 761)
+++ pkg/R/SNPbin.R 2011-01-15 14:53:53 UTC (rev 762)
@@ -147,7 +147,7 @@
## HANDLE INPUT$GEN ##
if(!is.null(input$gen)){
## input$gen is a list of SNPbin ##
- if(is.list(input$gen) & all(sapply(input$gen, class)=="SNPbin")){
+ if(is.list(input$gen) && all(sapply(input$gen, class)=="SNPbin")){
## check nb of loci in each SNPbin
if(length(unique(sapply(input$gen, nLoc)))>1) {
warning("SNPbin objects have different numbers of loci")
@@ -174,13 +174,13 @@
}
}
}
- input$gen <- lapply(1:nrow(input$gen), function(i) as.integer(input$gen[i,]))
-
+ ##input$gen <- lapply(1:nrow(input$gen), function(i) as.integer(input$gen[i,]))
+ x at gen <- lapply(1:nrow(input$gen), function(i) new("SNPbin", as.integer(input$gen[i,])) )
}
## input$gen is a list of integers/numeric ##
- if(is.list(input$gen) & all(sapply(input$gen, class) %in% c("integer","numeric"))){
+ if(is.list(input$gen) && all(sapply(input$gen, class) %in% c("integer","numeric"))){
## check length consistency
lengthvec <- sapply(input$gen, length)
Modified: pkg/R/glFunctions.R
===================================================================
--- pkg/R/glFunctions.R 2011-01-14 15:09:12 UTC (rev 761)
+++ pkg/R/glFunctions.R 2011-01-15 14:53:53 UTC (rev 762)
@@ -359,7 +359,7 @@
## all(round(abs(toto$loadings), 10)==round(abs(titi$c1), 10)) # MUST BE TRUE
-## test with NAs
+## TEST WITH NAS ##
## M <- matrix(sample(c(0,1, NA), 1e5, replace=TRUE, prob=c(.495,.495,.01)), nrow=100)
## rownames(M) <- paste("ind", 1:100)
@@ -369,3 +369,14 @@
## round(cor(toto$scores),10) # must be diag(1,4)
## round(t(toto$loadings) %*% toto$loadings,10) # must be diag(1,4)
+
+
+## LARGE SCALE TEST ##
+## perform glPca
+## M <- matrix(sample(c(0,1), 200*1e6, replace=TRUE), nrow=200)
+## x <- new("genlight",M) # too slow, check what's fucked up
+## toto <- glPca(x, nf=4)
+
+## round(cor(toto$scores),10) # must be diag(1,4)
+## round(t(toto$loadings) %*% toto$loadings,10) # must be diag(1,4)
+
Modified: www/literature.html
===================================================================
--- www/literature.html 2011-01-14 15:09:12 UTC (rev 761)
+++ www/literature.html 2011-01-15 14:53:53 UTC (rev 762)
@@ -370,7 +370,14 @@
David Glenn Smith.(2011) The effect of SNP discovery method and sample
size on estimation of population genetic data for Chinese and Indian
rhesus macaques (<i>Macaca mulatta</i>). Primates: <span
- class="doi"><span class="label">DOI:</span> <span class="value">10.1007/s10329-010-0232-4</span></span></p>
+ class="doi"><span class="label">DOI:</span> <span class="value">10.1007/s10329-010-0232-4<br>
+</span></span></p>
+<p class="authors">[29] HELYAR, S. J., HEMMER-HANSEN, J., BEKKEVOLD,
+D., TAYLOR, M. I., OGDEN, R., LIMBORG, M. T., CARIANI, A., MAES, G. E.,
+DIOPERE, E., CARVALHO, G. R. and NIELSEN, E. E. , Application of SNPs
+for population genetics of nonmodel organisms: new opportunities and
+challenges. Molecular Ecology Resources, no.
+doi: 10.1111/j.1755-0998.2010.02943.x</p>
<p class="auth_list"><br>
<br>
</p>
More information about the adegenet-commits
mailing list