[Genabel-commits] r955 - in pkg/GenABEL: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 17 12:36:45 CEST 2012


Author: yurii
Date: 2012-09-17 12:36:45 +0200 (Mon, 17 Sep 2012)
New Revision: 955

Modified:
   pkg/GenABEL/R/GC.R
   pkg/GenABEL/R/GC_ovdom.R
   pkg/GenABEL/R/findRelatives.R
   pkg/GenABEL/R/grammar.R
   pkg/GenABEL/R/ibs.R
   pkg/GenABEL/R/minimac2databel.R
   pkg/GenABEL/R/polygenic_hglm.R
   pkg/GenABEL/R/reconstructNPs.R
   pkg/GenABEL/R/ss.R
   pkg/GenABEL/man/emp.ccfast.Rd
   pkg/GenABEL/man/emp.qtscore.Rd
   pkg/GenABEL/man/grammar.Rd
   pkg/GenABEL/man/scan.glm.2D.Rd
   pkg/GenABEL/man/scan.glm.Rd
   pkg/GenABEL/man/scan.haplo.2D.Rd
Log:
trying to cut the time spent in examples

Modified: pkg/GenABEL/R/GC.R
===================================================================
--- pkg/GenABEL/R/GC.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/GC.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -32,6 +32,8 @@
 #' 
 #' @examples
 #' data(ge03d2)
+#' set.seed(1)
+#' ge03d2 <- ge03d2[sample(1:nids(ge03d2),200),1:1000]
 #' qts=mlreg(phdata(ge03d2)$dm2~1,data=ge03d2,gtmode = "dominant")
 #' chi2.1df=results(qts)$chi2.1df
 #' s=summary(ge03d2)

Modified: pkg/GenABEL/R/GC_ovdom.R
===================================================================
--- pkg/GenABEL/R/GC_ovdom.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/GC_ovdom.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -28,6 +28,8 @@
 #' 
 #' @examples
 #' data(ge03d2)
+#' set.seed(1)
+#' ge03d2 <- ge03d2[sample(1:nids(ge03d2),200),1:1000]
 #' qts=mlreg(phdata(ge03d2)$dm2~1,data=ge03d2,gtmode = "overdominant")
 #' chi2.1df=results(qts)$chi2.1df
 #' s=summary(ge03d2)

Modified: pkg/GenABEL/R/findRelatives.R
===================================================================
--- pkg/GenABEL/R/findRelatives.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/findRelatives.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -88,6 +88,7 @@
 #' df <- ge03d2.clean[,autosomal(ge03d2.clean)]
 #' df <- df[,sort(sample(1:nsnps(df),1000))]
 #' eaf <- summary(gtdata(df))$"Q.2"
+#' \donotrun{
 #' relInfo <- findRelatives(df[27:30,],q=eaf)
 #' relInfo
 #' # look only for 1st and 2nd degree relatives
@@ -95,6 +96,7 @@
 #' relInfo1
 #' relInfoVS <- findRelatives(df[27:30,],q=eaf,nmeivec=c(1:6),vsIDs=idnames(df[27:30,])[1:2])
 #' relInfoVS
+#' }
 #' 
 findRelatives <- function(gtdata,nmeivec=c(1:2),q=NULL,epsilon=0.01, 
 		quiet=FALSE,OddsVsNull=1000,OddsVsNextBest=100,

Modified: pkg/GenABEL/R/grammar.R
===================================================================
--- pkg/GenABEL/R/grammar.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/grammar.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -44,15 +44,15 @@
 #' 
 #' GRAMMAR-Gamma: Svisheva GR, Axenovich TI, Belonogova MN, van Duijn CM, Aulchenko YS. 
 #' Rapid variance componentsÐbased method for whole-genome association analysis. 
-#' (http://dx.doi.org/10.1038/ng.2410)
+#' (\link{http://dx.doi.org/10.1038/ng.2410})
 #' 
 #' @examples 
 #' # Using clean ge03d2 data 
 #' data(ge03d2.clean)
-#' #take half for speed
-#' ge03d2.clean <- ge03d2.clean[1:300,]
+#' #take small piece for speed
+#' ge03d2.clean <- ge03d2.clean[1:200,]
 #' # estimate genomic kinship
-#' gkin <- ibs(ge03d2.clean,w="freq")
+#' gkin <- ibs(ge03d2.clean[,sample(autosomal(ge03d2.clean),1000)],w="freq")
 #' # perform polygneic analysis
 #' h2ht <- polygenic(height ~ sex + age,kin=gkin,ge03d2.clean)
 #' h2ht$est

Modified: pkg/GenABEL/R/ibs.R
===================================================================
--- pkg/GenABEL/R/ibs.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/ibs.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -55,7 +55,7 @@
 #' 
 #' @examples 
 #' data(ge03d2c)
-#' 
+#' set.seed(1)
 #' # compute IBS based on a random sample of 1000 autosomal marker
 #' selectedSnps <- sample(autosomal(ge03d2c),1000,replace=FALSE)
 #' a <- ibs(ge03d2c,snps=selectedSnps)
@@ -71,7 +71,7 @@
 #' # PAINT THE OUTLIERS IN RED
 #' points(mds[cl1,],pch=19,col="red")
 #' # compute genomic kinship matrix to be used with e.g. polygenic, mmscore, etc
-#' a <- ibs(ge03d2c,snps=sample(autosomal(ge03d2c),1000,replace=FALSE),weight="freq")
+#' a <- ibs(ge03d2c,snps=selectedSnps,weight="freq")
 #' a[1:5,1:5]
 #' # now replace diagonal with EIGENSTRAT-type of diaganal to be used for egscore
 #' diag(a) <- hom(ge03d2c[,autosomal(ge03d2c)])$Var
@@ -79,8 +79,8 @@
 #' ##############################
 #' # compare 'freq' with 'eVar'
 #' ##############################
-#' ibsFreq <- ibs(ge03d2c[,autosomal(ge03d2c)], weight="freq") 
-#' ibsEvar <- ibs(ge03d2c[,autosomal(ge03d2c)], weight="eVar")
+#' ibsFreq <- ibs(ge03d2c,snps=selectedSnps, weight="freq") 
+#' ibsEvar <- ibs(ge03d2c,snps=selectedSnps, weight="eVar")
 #' mdsEvar <- cmdscale( as.dist( 0.5 - ibsEvar ) )
 #' plot(mdsEvar)
 #' outliers <- (mdsEvar[,1]>0.1)

Modified: pkg/GenABEL/R/minimac2databel.R
===================================================================
--- pkg/GenABEL/R/minimac2databel.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/minimac2databel.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -1,4 +1,3 @@
-#'
 #' converts Minimac-imputed files to DatABEL (filevector) format
 #'
 #' This function converts Minimac-imputed files to \code{DatABEL} (filevector) format.

Modified: pkg/GenABEL/R/polygenic_hglm.R
===================================================================
--- pkg/GenABEL/R/polygenic_hglm.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/polygenic_hglm.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -46,7 +46,8 @@
 #' 
 #' @examples 
 #' data(ge03d2ex.clean)
-#' df <- ge03d2ex.clean[,autosomal(ge03d2ex.clean)]
+#' set.seed(1)
+#' df <- ge03d2ex.clean[sample(1:nids(ge03d2ex.clean),200),autosomal(ge03d2ex.clean)]
 #' gkin <- ibs(df,w="freq")
 #' 
 #' # ----- for quantitative traits

Modified: pkg/GenABEL/R/reconstructNPs.R
===================================================================
--- pkg/GenABEL/R/reconstructNPs.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/reconstructNPs.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -23,7 +23,7 @@
 #' @author Yurii Aulchenko
 #' 
 #' @examples 
-#' nloci <- 1000
+#' nloci <- 100
 #' q <- runif(nloci,min=0.05,max=0.95)
 #' # g7---g8
 #' #   _|_

Modified: pkg/GenABEL/R/ss.R
===================================================================
--- pkg/GenABEL/R/ss.R	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/R/ss.R	2012-09-17 10:36:45 UTC (rev 955)
@@ -366,7 +366,7 @@
 			}
 			if (!is.null(lambda(object)) & !any(names(tmp)=="Pc1df")) {
 				chi2.1df_corr <- tmp$chi2.1df/lambda(object)$estimate
-				tmp$Pc1df <- pchisq(chi2.1df_corr, df=1, low=FALSE)
+				tmp$Pc1df <- pchisq(chi2.1df_corr, df=1, lower.tail=FALSE)
 			}
 			return(tmp)
 		}

Modified: pkg/GenABEL/man/emp.ccfast.Rd
===================================================================
--- pkg/GenABEL/man/emp.ccfast.Rd	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/man/emp.ccfast.Rd	2012-09-17 10:36:45 UTC (rev 955)
@@ -55,7 +55,8 @@
 a<-ccfast("bt",data=srdta,snps=c(500:800))
 plot(a)
 # this does not make sense, as the whole experiment must be analysed, not a small region!
-b<-emp.ccfast("bt",data=srdta,snps=c(500:800),bcast=10)
+# also, times = 20 is way too small (should be at least 200)
+b<-emp.ccfast("bt",data=srdta,snps=c(500:800),bcast=10, times = 20)
 plot(b)
 # compare qvalues and empirical P
 qv<-qvaluebh95(a[,"P1df"])$qval

Modified: pkg/GenABEL/man/emp.qtscore.Rd
===================================================================
--- pkg/GenABEL/man/emp.qtscore.Rd	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/man/emp.qtscore.Rd	2012-09-17 10:36:45 UTC (rev 955)
@@ -63,7 +63,8 @@
 a<-qtscore(qt3~age+sex,data=srdta,snps=c(1:200))
 plot(a)
 # this does not make sense, as the whole experiment must be analysed, not a small region!
-b<-emp.qtscore(qt3~age+sex,data=srdta,snps=c(1:200))
+# also, times = 20 is way too small (should be at least 200)
+b<-emp.qtscore(qt3~age+sex,data=srdta,snps=c(1:200), times = 20)
 plot(b)
 }
 \keyword{htest}% at least one, from doc/KEYWORDS

Modified: pkg/GenABEL/man/grammar.Rd
===================================================================
--- pkg/GenABEL/man/grammar.Rd	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/man/grammar.Rd	2012-09-17 10:36:45 UTC (rev 955)
@@ -91,8 +91,9 @@
   related individuals. PLoS One. 2007 Dec 5;2(12):e1274.
 
   GRAMMAR-Gamma: Svisheva GR, Axenovich TI, Belonogova MN,
-  van Duijn CM, Aulchenko YS.
-  (http://dx.doi.org/10.1038/ng.2410)
+  van Duijn CM, Aulchenko YS. Rapid variance componentsÐbased 
+  method for whole-genome association analysis
+  (\link{http://dx.doi.org/10.1038/ng.2410})
 }
 \seealso{
   \code{\link{polygenic}}, \code{\link{mmscore}},

Modified: pkg/GenABEL/man/scan.glm.2D.Rd
===================================================================
--- pkg/GenABEL/man/scan.glm.2D.Rd	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/man/scan.glm.2D.Rd	2012-09-17 10:36:45 UTC (rev 955)
@@ -54,8 +54,10 @@
 	\code{\link{scan.haplo.2D}}
 }
 \examples{
+\donotrun{
 data(srdta)
 a <- scan.glm.2D("bt~sex+age+CRSNP",family=binomial(),data=srdta,snps=(1:10),bcast=2)
 plot(a)
 }
+}
 \keyword{htest}% at least one, from doc/KEYWORDS

Modified: pkg/GenABEL/man/scan.glm.Rd
===================================================================
--- pkg/GenABEL/man/scan.glm.Rd	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/man/scan.glm.Rd	2012-09-17 10:36:45 UTC (rev 955)
@@ -44,15 +44,19 @@
 maposnp <- srdta at gtdata@map[osnp]
 maposnp
 reg <- snp.names(srdta,begin=maposnp-100000,end=maposnp+100000,chrom="1")
+\donotrun{
 a <- scan.glm("qt3~sex+age+CRSNP",data=srdta,snps=reg)
-#plot(a)
-#plot(a,df=1)
-#add.plot(a,df=2)
+plot(a)
+plot(a,df=1)
+add.plot(a,df=2)
+}
 
 # interaction with sex
+\donotrun{
 a <- scan.glm("qt3~age+sex*CRSNP",data=srdta,snps=reg)
-#plot(a,df=1)
-#add.plot(a,df=2)
+plot(a,df=1)
+add.plot(a,df=2)
 # you can do interaction with a selected polymorphisms in the same way
 }
+}
 \keyword{htest}% at least one, from doc/KEYWORDS

Modified: pkg/GenABEL/man/scan.haplo.2D.Rd
===================================================================
--- pkg/GenABEL/man/scan.haplo.2D.Rd	2012-09-14 17:54:37 UTC (rev 954)
+++ pkg/GenABEL/man/scan.haplo.2D.Rd	2012-09-17 10:36:45 UTC (rev 955)
@@ -54,10 +54,12 @@
 }
 \examples{
 if (require(haplo.stats)) {
+\donotrun{
 data(srdta)
 c <- scan.haplo.2D("bt~sex+age+CRSNP",data=srdta,snps=(717:733),
 	ids=(srdta at phdata$age<40))
 plot(c)
 }
 }
+}
 \keyword{htest}% at least one, from doc/KEYWORDS



More information about the Genabel-commits mailing list