[Genabel-commits] r948 - pkg/GenABEL/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Aug 30 11:26:00 CEST 2012
Author: yurii
Date: 2012-08-30 11:26:00 +0200 (Thu, 30 Aug 2012)
New Revision: 948
Modified:
pkg/GenABEL/R/qtscore.R
pkg/GenABEL/R/reconstructNPs.R
pkg/GenABEL/R/summary.snp.data.R
pkg/GenABEL/R/summary.snp.data_old.R
Log:
fixing partial arguments match
Modified: pkg/GenABEL/R/qtscore.R
===================================================================
--- pkg/GenABEL/R/qtscore.R 2012-08-29 21:27:32 UTC (rev 947)
+++ pkg/GenABEL/R/qtscore.R 2012-08-30 09:26:00 UTC (rev 948)
@@ -254,7 +254,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
@@ -277,8 +277,8 @@
chi2.c1df <- chi2.1df/lambda$estimate
if (is.logical(clambda)) {
- lambda$iz0 <- estlambda(z0*z0,plot=FALSE,prop=propPs)$estimate
- lambda$iz2 <- estlambda(z2*z2,plot=FALSE,prop=propPs)$estimate
+ lambda$iz0 <- estlambda(z0*z0,plot=FALSE,proportion=propPs)$estimate
+ lambda$iz2 <- estlambda(z2*z2,plot=FALSE,proportion=propPs)$estimate
if (clambda && lambda$iz0<1.0) {warning("z0 lambda < 1, set to 1");lambda$iz0<-1.0}
if (clambda && lambda$iz2<1.0) {warning("z2 lambda < 1, set to 1");lambda$iz2<-1.0}
chi2.c2df <- (z0*z0/lambda$iz0 + z2*z2/lambda$iz2 - 2.*z0*z2*rho/(sqrt(lambda$iz0*lambda$iz2)))/(1.- rho*rho)
@@ -331,8 +331,8 @@
#out$Pc2df <- pr.c2df/times
#out$Pc2df <- replace(out$Pc2df,(out$Pc2df==0),1/(1+times))
} else {
- P1df <- pchisq(chi2.1df,1,lower=F)
- P2df <- pchisq(chi2.2df,actdf,lower=F)
+ P1df <- pchisq(chi2.1df,1,lower.tail=F)
+ P2df <- pchisq(chi2.2df,actdf,lower.tail=F)
Pc1df <- NULL
#out$Pc1df <- pchisq(chi2.c1df,1,lower=F)
#out$Pc2df <- pchisq(chi2.c2df,2,lower=F)
Modified: pkg/GenABEL/R/reconstructNPs.R
===================================================================
--- pkg/GenABEL/R/reconstructNPs.R 2012-08-29 21:27:32 UTC (rev 947)
+++ pkg/GenABEL/R/reconstructNPs.R 2012-08-30 09:26:00 UTC (rev 948)
@@ -141,7 +141,7 @@
}
# identify offspring and construct NPs
marIs.na <- function(matr,MAR) {
- out <- apply(matr,MAR=MAR,FUN=function(x) {any(is.na(x))})
+ out <- apply(matr,MARGIN=MAR,FUN=function(x) {any(is.na(x))})
out
}
colIs.na <- function(matr) {return(marIs.na(matr,MAR=2))}
Modified: pkg/GenABEL/R/summary.snp.data.R
===================================================================
--- pkg/GenABEL/R/summary.snp.data.R 2012-08-29 21:27:32 UTC (rev 947)
+++ pkg/GenABEL/R/summary.snp.data.R 2012-08-30 09:26:00 UTC (rev 948)
@@ -48,7 +48,7 @@
#dim(res) <- c(object at nsnps,9)
#res <- as.data.frame(res)
- res[,9] <- pchisq(res[,9],1,lower=F)
+ res[,9] <- pchisq(res[,9],1,lower.tail=F)
# X-chromosome
if (any(chromosome(object) == "X")) {
vec <- (chromosome(object) == "X")
@@ -66,7 +66,7 @@
as.integer(1),999)
res[vec,7] <- resX[(nsnps(oX)*6+1):(nsnps(oX)*7)]
res[vec,8] <- resX[(nsnps(oX)*7+1):(nsnps(oX)*8)]
- res[vec,9] <- pchisq(resX[(nsnps(oX)*8+1):(nsnps(oX)*9)],1,lower=F)
+ res[vec,9] <- pchisq(resX[(nsnps(oX)*8+1):(nsnps(oX)*9)],1,lower.tail=F)
rm(oX,vec,resX);gc(verbose=FALSE)
} else {
res[vec,7] <- rep(1,sum(vec))
Modified: pkg/GenABEL/R/summary.snp.data_old.R
===================================================================
--- pkg/GenABEL/R/summary.snp.data_old.R 2012-08-29 21:27:32 UTC (rev 947)
+++ pkg/GenABEL/R/summary.snp.data_old.R 2012-08-30 09:26:00 UTC (rev 948)
@@ -4,7 +4,7 @@
res <- .C("snp_summary_exhwe",as.raw(object at gtps),as.integer(object at nids),as.integer(object at nsnps), out = double(object at nsnps*9), PACKAGE="GenABEL")$out
dim(res) <- c(object at nsnps,9)
res <- as.data.frame(res)
- res[,9] <- pchisq(res[,9],1,lower=F)
+ res[,9] <- pchisq(res[,9],1,lower.tail=F)
# X-chromosome
if (any(object at chromosome == "X")) {
vec <- (object at chromosome == "X")
@@ -13,7 +13,7 @@
resX <- .C("snp_summary_exhwe",as.raw(oX at gtps),as.integer(oX at nids),as.integer(oX at nsnps), out = double(oX at nsnps*9), PACKAGE="GenABEL")$out
res[vec,7] <- resX[(oX at nsnps*6+1):(oX at nsnps*7)]
res[vec,8] <- resX[(oX at nsnps*7+1):(oX at nsnps*8)]
- res[vec,9] <- pchisq(resX[(oX at nsnps*8+1):(oX at nsnps*9)],1,lower=F)
+ res[vec,9] <- pchisq(resX[(oX at nsnps*8+1):(oX at nsnps*9)],1,lower.tail=F)
rm(oX,vec,resX);gc(verbose=FALSE)
} else {
res[vec,7] <- rep(1,sum(vec))
More information about the Genabel-commits
mailing list