[adegenet-forum] problems with new("genlight")

Josquin Frederick Tibbits josquint at unimelb.edu.au
Wed Jul 24 04:46:51 CEST 2013


Hello Thibaut,

Great.  I found a workaround as well which was to redefine mclapply so it does not stop (deleted the stop line and the message) and it then just runs lapply.  This worked fine. 

> mclapply <- function (X, FUN, ..., mc.preschedule = TRUE, mc.set.seed = TRUE, 
+     mc.silent = FALSE, mc.cores = 1L, mc.cleanup = TRUE, mc.allow.recursive = TRUE) 
+ {
+     cores <- as.integer(mc.cores)
+     if (cores < 1L) 
+         stop("'mc.cores' must be >= 1")
+     if (cores > 1L) 
+  lapply(X, FUN, ...)
+ }

Josquin

________________________________________
From: Jombart, Thibaut [t.jombart at imperial.ac.uk]
Sent: Wednesday, July 24, 2013 12:40 AM
To: Josquin Frederick Tibbits; adegenet-forum at lists.r-forge.r-project.org
Subject: RE: problems with new("genlight")

Hello,

sorry about this, but there has been a change in the arguments. 'multicore' is now 'parallel' (the package multicore is being replaced by parallel).

I realize this does not appear in the documentation of the constructor. I'll try to amend that in the next release.

All the best
Thibaut


________________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Josquin Frederick Tibbits [josquint at unimelb.edu.au]
Sent: 23 July 2013 14:41
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] problems with new("genlight")

I have recently updated to R-3.0.1 and to adegenet 1.3-9 the adegenet scripts I was running successfully in R-3.0.0 adgenet 1.3-8 are now failing when calling the new("genlight") functions, if there are arguments. I would be happy to set mc.cores to 1 but can not seem to pass this argument successfully.  Help appreciated. Code is as follows:

> new("genlight")
 === S4 class genlight ===
 0 genotypes,  0 binary SNPs
> x <- new("genlight")
> x
 === S4 class genlight ===
 0 genotypes,  0 binary SNPs
### Clearly OK

> data.SNP[1:5, 1:5]
            10015_641 c10016_302 c10017_644 c10126_263 10140_297
001031                   0                   0                   2                   2                   0
001209                   2                   0                   0                   2                   2
001298                   2                   0                   2                   2                   0
001765                   2                   0                   2                   2                   0
001032                   2                   0                   2                   2                   0
> gl.ALL <- new("genlight", data.SNP, pop=data.annot[, 8], ploidy=2)
Error in mclapply(1:nrow(input$gen), function(i) new("SNPbin", as.integer(input$gen[i,  :
  'mc.cores' > 1 is not supported on Windows
> gl.ALL <- new("genlight", data.SNP, pop=data.annot[, 8], ploidy=2, multicore=FALSE)
Error in mclapply(1:nrow(input$gen), function(i) new("SNPbin", as.integer(input$gen[i,  :
  'mc.cores' > 1 is not supported on Windows
> gl.ALL <- new("genlight", data.SNP, pop=data.annot[, 8], ploidy=2, multicore=FALSE, mc.cores=1)
Error in mclapply(1:nrow(input$gen), function(i) new("SNPbin", as.integer(input$gen[i,  :
  'mc.cores' > 1 is not supported on Windows
> gl.ALL <- new("genlight", data.SNP, pop=data.annot[, 8], ploidy=2, mc.cores=1)
Error in mclapply(1:nrow(input$gen), function(i) new("SNPbin", as.integer(input$gen[i,  :
  'mc.cores' > 1 is not supported on Windows

## Even on the toy example I get
> dat <- list(toto=c(1,1,0,0), titi=c(NA,1,1,0), tata=c(NA,0,3, NA))
> x <- new("genlight", dat)
Error in mclapply(input$gen, function(e) new("SNPbin", e), mc.cores = n.cores,  :
  'mc.cores' > 1 is not supported on Windows


> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                           LC_TIME=English_United States.1252

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] adegenet_1.3-9 genalg_0.1.1   ade4_1.5-2

loaded via a namespace (and not attached):
[1] ape_3.0-9       grid_3.0.1      igraph_0.6.5-2  lattice_0.20-15 MASS_7.3-26     nlme_3.1-109    tools_3.0.1





More information about the adegenet-forum mailing list