[Genabel-commits] r949 - pkg/GenABEL/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Aug 30 11:43:00 CEST 2012
Author: yurii
Date: 2012-08-30 11:43:00 +0200 (Thu, 30 Aug 2012)
New Revision: 949
Modified:
pkg/GenABEL/R/checkPackageVersionOnCRAN.R
pkg/GenABEL/R/mlreg.R
pkg/GenABEL/R/mlreg.p.R
pkg/GenABEL/R/mmscore.R
pkg/GenABEL/R/npsubtreated.R
pkg/GenABEL/R/polygenic.R
pkg/GenABEL/R/polygenic_hglm.R
Log:
fixing partial arguments match + changing default timeout for version checks to 5 sec
Modified: pkg/GenABEL/R/checkPackageVersionOnCRAN.R
===================================================================
--- pkg/GenABEL/R/checkPackageVersionOnCRAN.R 2012-08-30 09:26:00 UTC (rev 948)
+++ pkg/GenABEL/R/checkPackageVersionOnCRAN.R 2012-08-30 09:43:00 UTC (rev 949)
@@ -23,7 +23,8 @@
#'
#' @author Yurii Aulchenko
#'
-checkPackageVersionOnCRAN <- function(packageName,baseUrlCRAN="http://cran.r-project.org/web/packages/", timeout = 10)
+checkPackageVersionOnCRAN <- function(packageName,baseUrlCRAN="http://cran.r-project.org/web/packages/",
+ timeout = 5)
{
# change default timout
svtmo <- options("timeout")
Modified: pkg/GenABEL/R/mlreg.R
===================================================================
--- pkg/GenABEL/R/mlreg.R 2012-08-30 09:26:00 UTC (rev 948)
+++ pkg/GenABEL/R/mlreg.R 2012-08-30 09:43:00 UTC (rev 949)
@@ -101,9 +101,9 @@
se.effB <- chi2$sebeta
chi2.1df <- (chi2$beta/chi2$sebeta)^2
#out$lambda <- estlambda(out$chi2.1df,plot=F,prop=propPs)
- P1df <- pchisq(chi2.1df,1,lower=F)
- lambda <- estlambda(chi2.1df,plot=F,prop=propPs)
- Pc1df <- pchisq(chi2.1df/lambda$est,1,lower=F)
+ P1df <- pchisq(chi2.1df,1,lower.tail=F)
+ lambda <- estlambda(chi2.1df,plot=F,proportion=propPs)
+ Pc1df <- pchisq(chi2.1df/lambda$est,1,lower.tail=F)
#out$call <- match.call()
#out$trait.type <- posttypes[ttype]
#class(out) <- "scan.gwaa"
Modified: pkg/GenABEL/R/mlreg.p.R
===================================================================
--- pkg/GenABEL/R/mlreg.p.R 2012-08-30 09:26:00 UTC (rev 948)
+++ pkg/GenABEL/R/mlreg.p.R 2012-08-30 09:43:00 UTC (rev 949)
@@ -91,7 +91,9 @@
rownames(chi2) <- gtdata at snpnames
chi2[abs(chi2+999.9)<1.e-6] <- NA
chi2.1df <- (chi2$beta/chi2$sebeta)^2
- out <- data.frame(snpnames=gtdata at snpnames,chromosome=gtdata at chromosome,map=gtdata at map,N=chi2$N,effB=chi2$beta,se.effB=chi2$sebeta,chi2.1df=chi2.1df,P1df=pchisq(chi2.1df,1,lower=F),stringsAsFactors = FALSE)
+ out <- data.frame(snpnames=gtdata at snpnames,chromosome=gtdata at chromosome,map=gtdata at map,
+ N=chi2$N,effB=chi2$beta,se.effB=chi2$sebeta,chi2.1df=chi2.1df,
+ P1df=pchisq(chi2.1df,1,lower.tail=F),stringsAsFactors = FALSE)
# class(out) <- "scan.gwaa"
out
}
Modified: pkg/GenABEL/R/mmscore.R
===================================================================
--- pkg/GenABEL/R/mmscore.R 2012-08-30 09:26:00 UTC (rev 948)
+++ pkg/GenABEL/R/mmscore.R 2012-08-30 09:43:00 UTC (rev 949)
@@ -72,7 +72,7 @@
lambda$se <- NA
} else {
if (lenn<100) warning("Number of observations < 100, Lambda estimate is unreliable")
- lambda <- estlambda(chi2.1df,plot=FALSE,prop=propPs)
+ lambda <- estlambda(chi2.1df,plot=FALSE,proportion=propPs)
if (lambda$estimate<1.0 && clambda==TRUE) {
warning("Lambda estimated < 1, set to 1")
lambda$estimate <- 1.0
@@ -122,9 +122,9 @@
Pc1df <- pr.c1df/times
# out$Pc1df <- replace(out$Pc1df,(out$Pc1df==0),1/(1+times))
} else {
- P1df <- pchisq(chi2.1df,1,lower=F)
-# out$P2df <- pchisq(chi2.2df,actdf,lower=F)
- Pc1df <- pchisq(chi2.c1df,1,lower=F)
+ P1df <- pchisq(chi2.1df,1,lower.tail=F)
+# out$P2df <- pchisq(chi2.2df,actdf,lower.tail=F)
+ Pc1df <- pchisq(chi2.c1df,1,lower.tail=F)
}
#out$lambda <- lambda
#out$effB <- effB #*var(h2object$residualY,na.rm=T)
Modified: pkg/GenABEL/R/npsubtreated.R
===================================================================
--- pkg/GenABEL/R/npsubtreated.R 2012-08-30 09:26:00 UTC (rev 948)
+++ pkg/GenABEL/R/npsubtreated.R 2012-08-30 09:43:00 UTC (rev 949)
@@ -12,7 +12,7 @@
if (increase) x1$y.obs <- (-1)*x1$y.obs
- ord <- sort.int(x1$y.obs,dec=T,index=T)$ix
+ ord <- sort.int(x1$y.obs,decreasing=T,index.return=T)$ix
x1 <- x1[ord,]
subtr <- mean(x1$y.obs)
x1$y.1 <- x1$y.obs - subtr
Modified: pkg/GenABEL/R/polygenic.R
===================================================================
--- pkg/GenABEL/R/polygenic.R 2012-08-30 09:26:00 UTC (rev 948)
+++ pkg/GenABEL/R/polygenic.R 2012-08-30 09:43:00 UTC (rev 949)
@@ -280,9 +280,9 @@
tmp <- t(relmat)
relmat[upper.tri(relmat)] <- tmp[upper.tri(tmp)]
rm(tmp);gc()
- if (llfun=="polylik") eigres <- eigen(ginv(relmat),symm=TRUE)
+ if (llfun=="polylik") eigres <- eigen(ginv(relmat),symmetric=TRUE)
else if (llfun=="polylik_eigen") {
- eigres <- eigen(relmat,symm=TRUE)
+ eigres <- eigen(relmat,symmetric=TRUE)
if (any(eigres$values<0)) {
#eigres$values <- abs(eigres$values)
warning("some eigenvalues <=0, taking ABS for det; try option llfun='polylik'")
@@ -362,7 +362,7 @@
#
# iSigma <- ginv(h2*relmat + (1-h2)*diag(x=1,ncol=length(y),nrow=length(y)))
# start new
- if (llfun=="polylik") eigres <- eigen(relmat,symm=TRUE) # ensure eigres contain eigen of RelMat (not Inv(RelMat))
+ if (llfun=="polylik") eigres <- eigen(relmat,symmetric=TRUE) # ensure eigres contain eigen of RelMat (not Inv(RelMat))
es <- (eigres$value*h2+1.-h2)*parsave[npar]*sdy*sdy
iSigma <- (eigres$vec) %*% diag(1./es,ncol=length(es)) %*% t(eigres$vec)
# END new
@@ -479,7 +479,7 @@
if (fglschecks && missing(fixh2)) {
ginvsig <- iSigma # already computed it in FGLS checks
} else {
- if (llfun=="polylik") eigres <- eigen(relmat,symm=TRUE) # ensure eigres contain eigen of RelMat (not Inv(RelMat))
+ if (llfun=="polylik") eigres <- eigen(relmat,symmetric=TRUE) # ensure eigres contain eigen of RelMat (not Inv(RelMat))
es <- tvar*(eigres$value*h2+1.-h2)
#print(es[1:5])
#print(eigres$vec[1:5,1:5])
Modified: pkg/GenABEL/R/polygenic_hglm.R
===================================================================
--- pkg/GenABEL/R/polygenic_hglm.R 2012-08-30 09:26:00 UTC (rev 948)
+++ pkg/GenABEL/R/polygenic_hglm.R 2012-08-30 09:43:00 UTC (rev 949)
@@ -166,7 +166,7 @@
#out$ProfLogLik <- res_hglm$ProfLogLik
logdetSigma <- sum(log(eigen(Sigma, only.values = TRUE)$values))
- temp <- determinant(t(desmat)%*%out$InvSigma%*%desmat, log = TRUE)
+ temp <- determinant(t(desmat)%*%out$InvSigma%*%desmat, logarithm = TRUE)
out$ProfLogLik <- as.numeric(- .5*logdetSigma
- .5*t(out$residualY[mids])%*%out$InvSigma%*%out$residualY[mids]
- .5*temp$modulus*temp$sign)
More information about the Genabel-commits
mailing list