Nevil Amos
2010-May-20 09:34 UTC
[R] Geneland error on unix: Error in MCMC(........ :, unused argument(s) (ploidy = 2, genotypes = geno)
I am receiving the above error ( full r session output below) the script runs OK in windows. and "genotypes" and "ploidy" are both correct arguments any suggestions would be most welcome Nevil Amos MERG/ACB Monash University School of Biological Sciences > library(Geneland) Loading required package: RandomFields Loading required package: fields Loading required package: spam Package 'spam' is loaded. Spam version 0.21-0 (2010-03-13). Type demo( spam) for some demos, help( Spam) for an overview of this package. Help for individual functions is optained by adding the suffix '.spam' to the function name, e.g. 'help(chol.spam)'. Attaching package: 'spam' The following object(s) are masked from 'package:base': backsolve, forwardsolve, norm Try help(fields) for an overview of this library fields web: http://www.image.ucar.edu/Software/Fields Loading required package: mapproj Loading required package: maps Loading required package: snow Loading required package: tcltk Loading Tcl/Tk interface ... done ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo o Geneland is loaded o o o o * Please * o o o o Register on o o http://www2.imm.dtu.dk/~gigu/Geneland/register.php o o o o See manual on o o http://www2.imm.dtu.dk/~gigu/Geneland/#Manual o o o o Type citation("Geneland") for a quick citation guide o o o o See http://www2.imm.dtu.dk/~gigu/Geneland/# o o for additional references o o o o This is Geneland-3.2.1 o o o ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Warning message: In fun(...) : no DISPLAY variable so Tk is not available > DIRLIST<-c("Adult_ALL NO_ANW/")#,"Adult_Or_ANW/","Adult_Females/","Adult_Males/") > for(d in DIRLIST){ + theWd<- paste("/nfs/monash/home/namos/Rwork/",d,sep="") + setwd(theWd) + SPP.CODES <-"EYR"#c("BT","EYR","FH","SPP","STP") + for (sp in SPP.CODES){ + path.sp<- paste(theWd,sp,"/",sep="") + dir.create(path.sp) + GENO.TABLE<-paste(theWd,sp,"geno",sep="") + XY.TABLE<-paste(theWd,sp,"xy",sep="") + MINPOP=1 + MAXPOP=25 + INITPOP=1 + NITS=500000 + THIN=NITS/1000 + nrun <- 10 + burnin <- 200 + geno<-noquote(read.table(GENO.TABLE)) + coord<-read.table(XY.TABLE) + + ## Loop for multiple runs + + for(irun in 1:nrun) + { + ## define path to MCMC directory + + path.mcmc <- paste(path.sp,irun,"/",sep="") + dir.create(path.mcmc) + MCMC(coordinates=coord, ploidy=2, genotypes=geno, varnpop=T, npopmax=MAXPOP, npopinit=MINPOP, spatial=T, freq.model="Correlated", nit=NITS, thinning=500, rate.max=nrow(geno), delta.coord=100, path.mcmc=path.mcmc) + ## MCMC postprocessing + PostProcessChain(coordinates=coord,path.mcmc=path.mcmc,genotypes=geno, nxdom=50,nydom=50,burnin=burnin) + } + ## Computing average posterior probability + + lpd <- rep(NA,nrun) + for(irun in 1:nrun) + { + path.lpd <- paste(path.mcmc,"log.posterior.density.txt",sep="") + lpd[irun] <- mean(scan(path.lpd)[-(1:burnin)]) + } + ## Runs sorted by decreasing average posterior probability: + order(lpd,decreasing=TRUE) + + #pdf("Number of pops.pdf",((210-10)/25.4),((297-10)/25.4)) + #theWd<-getwd() + ##setwd(theWd) + #par(mfrow = c(5, 2),cex=0.25) + #for(irun in 1:nrun) + # + #{ + # + ###Below is code form the Geneland Plotnpop function + # fileparam <- paste(path.mcmc, "parameters.txt", sep = "") + # param <- as.matrix(read.table(fileparam)) + # thinning <- as.numeric(param[param[, 1] == "thinning", 3]) + # filenpop <- paste(path.mcmc, "populations.numbers.txt", sep = "") + # npop <- scan(filenpop) + # sub <- -(1:burnin) + # + #plot((1:length(npop)) * thinning, npop, type = "l",ylab = "Number of classes", xlab = "Index of MCMC iteration Whole chain",main=paste(path.mcmc,"\n","Run:", irun, sep = " "), ylim = c(1, max(npop)+ 0.5)) + #hist(npop[sub], plot = TRUE, prob = TRUE, breaks = seq(0.5,max(npop) + 0.5, 1), xlab = paste("Nb. of pop. along the chain (after a burnin of ", burnin, "x", thinning, "i t.)", sep = ""), main = "Number of populations long the chain after burnin") + # + # + #} + #dev.off() + } + } Error in MCMC(coordinates = coord, ploidy = 2, genotypes = geno, varnpop = T, : unused argument(s) (ploidy = 2, genotypes = geno) Execution halted
Jombart, Thibaut
2010-May-20 09:48 UTC
[R] Geneland error on unix: Error in MCMC(........ :, unused argument(s) (ploidy = 2, genotypes = geno)
Hello, you may want to contact directly the maintainer of Geneland for that kind of issue. In any case, this post would be best suited for R-sig-genetics: https://stat.ethz.ch/mailman/listinfo/r-sig-genetics Best regards, Thibaut -- ###################################### Dr Thibaut JOMBART MRC Centre for Outbreak Analysis and Modelling Department of Infectious Disease Epidemiology Imperial College - Faculty of Medicine St Mary?s Campus Norfolk Place London W2 1PG United Kingdom Tel. : 0044 (0)20 7594 3658 t.jombart at imperial.ac.uk http://sites.google.com/site/thibautjombart/ http://adegenet.r-forge.r-project.org/ ________________________________________ From: Nevil Amos [nevil.amos at gmail.com] Sent: 20 May 2010 10:34 To: r-help at r-project.org; Jombart, Thibaut Subject: Geneland error on unix: Error in MCMC(........ :, unused argument(s) (ploidy = 2, genotypes = geno) I am receiving the above error ( full r session output below) the script runs OK in windows. and "genotypes" and "ploidy" are both correct arguments any suggestions would be most welcome Nevil Amos MERG/ACB Monash University School of Biological Sciences > library(Geneland) Loading required package: RandomFields Loading required package: fields Loading required package: spam Package 'spam' is loaded. Spam version 0.21-0 (2010-03-13). Type demo( spam) for some demos, help( Spam) for an overview of this package. Help for individual functions is optained by adding the suffix '.spam' to the function name, e.g. 'help(chol.spam)'. Attaching package: 'spam' The following object(s) are masked from 'package:base': backsolve, forwardsolve, norm Try help(fields) for an overview of this library fields web: http://www.image.ucar.edu/Software/Fields Loading required package: mapproj Loading required package: maps Loading required package: snow Loading required package: tcltk Loading Tcl/Tk interface ... done ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo o Geneland is loaded o o o o * Please * o o o o Register on o o http://www2.imm.dtu.dk/~gigu/Geneland/register.php o o o o See manual on o o http://www2.imm.dtu.dk/~gigu/Geneland/#Manual o o o o Type citation("Geneland") for a quick citation guide o o o o See http://www2.imm.dtu.dk/~gigu/Geneland/# o o for additional references o o o o This is Geneland-3.2.1 o o o ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Warning message: In fun(...) : no DISPLAY variable so Tk is not available > DIRLIST<-c("Adult_ALL NO_ANW/")#,"Adult_Or_ANW/","Adult_Females/","Adult_Males/") > for(d in DIRLIST){ + theWd<- paste("/nfs/monash/home/namos/Rwork/",d,sep="") + setwd(theWd) + SPP.CODES <-"EYR"#c("BT","EYR","FH","SPP","STP") + for (sp in SPP.CODES){ + path.sp<- paste(theWd,sp,"/",sep="") + dir.create(path.sp) + GENO.TABLE<-paste(theWd,sp,"geno",sep="") + XY.TABLE<-paste(theWd,sp,"xy",sep="") + MINPOP=1 + MAXPOP=25 + INITPOP=1 + NITS=500000 + THIN=NITS/1000 + nrun <- 10 + burnin <- 200 + geno<-noquote(read.table(GENO.TABLE)) + coord<-read.table(XY.TABLE) + + ## Loop for multiple runs + + for(irun in 1:nrun) + { + ## define path to MCMC directory + + path.mcmc <- paste(path.sp,irun,"/",sep="") + dir.create(path.mcmc) + MCMC(coordinates=coord, ploidy=2, genotypes=geno, varnpop=T, npopmax=MAXPOP, npopinit=MINPOP, spatial=T, freq.model="Correlated", nit=NITS, thinning=500, rate.max=nrow(geno), delta.coord=100, path.mcmc=path.mcmc) + ## MCMC postprocessing + PostProcessChain(coordinates=coord,path.mcmc=path.mcmc,genotypes=geno, nxdom=50,nydom=50,burnin=burnin) + } + ## Computing average posterior probability + + lpd <- rep(NA,nrun) + for(irun in 1:nrun) + { + path.lpd <- paste(path.mcmc,"log.posterior.density.txt",sep="") + lpd[irun] <- mean(scan(path.lpd)[-(1:burnin)]) + } + ## Runs sorted by decreasing average posterior probability: + order(lpd,decreasing=TRUE) + + #pdf("Number of pops.pdf",((210-10)/25.4),((297-10)/25.4)) + #theWd<-getwd() + ##setwd(theWd) + #par(mfrow = c(5, 2),cex=0.25) + #for(irun in 1:nrun) + # + #{ + # + ###Below is code form the Geneland Plotnpop function + # fileparam <- paste(path.mcmc, "parameters.txt", sep = "") + # param <- as.matrix(read.table(fileparam)) + # thinning <- as.numeric(param[param[, 1] == "thinning", 3]) + # filenpop <- paste(path.mcmc, "populations.numbers.txt", sep = "") + # npop <- scan(filenpop) + # sub <- -(1:burnin) + # + #plot((1:length(npop)) * thinning, npop, type = "l",ylab = "Number of classes", xlab = "Index of MCMC iteration Whole chain",main=paste(path.mcmc,"\n","Run:", irun, sep = " "), ylim = c(1, max(npop)+ 0.5)) + #hist(npop[sub], plot = TRUE, prob = TRUE, breaks = seq(0.5,max(npop) + 0.5, 1), xlab = paste("Nb. of pop. along the chain (after a burnin of ", burnin, "x", thinning, "i t.)", sep = ""), main = "Number of populations long the chain after burnin") + # + # + #} + #dev.off() + } + } Error in MCMC(coordinates = coord, ploidy = 2, genotypes = geno, varnpop = T, : unused argument(s) (ploidy = 2, genotypes = geno) Execution halted