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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Apr 4 12:06:36 CEST 2013


Author: yurii
Date: 2013-04-04 12:06:36 +0200 (Thu, 04 Apr 2013)
New Revision: 1184

Modified:
   pkg/GenABEL/R/egscore.R
   pkg/GenABEL/R/hom.R
   pkg/GenABEL/R/ibs.R
   pkg/GenABEL/man/egscore.Rd
   pkg/GenABEL/man/hom.Rd
   pkg/GenABEL/man/ibs.Rd
Log:
fixing documentation entries related to genomic kinship/homozygosity

Modified: pkg/GenABEL/R/egscore.R
===================================================================
--- pkg/GenABEL/R/egscore.R	2013-04-04 09:02:17 UTC (rev 1183)
+++ pkg/GenABEL/R/egscore.R	2013-04-04 10:06:36 UTC (rev 1184)
@@ -6,7 +6,7 @@
 #' The idea of this test is to use genomic kinship matrix to first, derive axes
 #' of genetic variation (principal components), and, second, adjust both trait
 #' and genotypes onto these axes. Note that the diagonal of the kinship matrix
-#' should be replaced (default it is .5+F, and for EIGENSTRAT one needs
+#' should be replaced (default it is 0.5*(1+F), and for EIGENSTRAT one needs
 #' variance).  These variances are porduced by \code{\link{hom}} function (see
 #' example).
 #' 

Modified: pkg/GenABEL/R/hom.R
===================================================================
--- pkg/GenABEL/R/hom.R	2013-04-04 09:02:17 UTC (rev 1183)
+++ pkg/GenABEL/R/hom.R	2013-04-04 10:06:36 UTC (rev 1184)
@@ -31,7 +31,7 @@
 #' 
 #' The variance (Var) is estimated as
 #' 
-#' \deqn{ V_{i} = \frac(1)(N) \Sigma_k \frac{(x_{i,k} - p_k)^2}{(p_k * (1 -
+#' \deqn{ V_{i} = \frac{1}{N} \Sigma_k \frac{(x_{i,k} - p_k)^2}{(p_k * (1 -
 #' p_k))} }
 #' 
 #' where k changes from 1 to N = number of SNPs, \eqn{x_{i,k}} is a genotype of

Modified: pkg/GenABEL/R/ibs.R
===================================================================
--- pkg/GenABEL/R/ibs.R	2013-04-04 09:02:17 UTC (rev 1183)
+++ pkg/GenABEL/R/ibs.R	2013-04-04 10:06:36 UTC (rev 1184)
@@ -10,7 +10,7 @@
 #' When weight "freq" is used, IBS for a pair of people i and j is computed as
 #' 
 #' \deqn{
-#' f_{i,j} = \Sigma_k \frac{(x_{i,k} - p_k) * (x_{j,k} - p_k)}{(p_k * (1 - p_k))}
+#' f_{i,j} = \frac{1}{N} \Sigma_k \frac{(x_{i,k} - p_k) * (x_{j,k} - p_k)}{(p_k * (1 - p_k))}
 #' }
 #' 
 #' where k changes from 1 to N = number of SNPs GW, \eqn{x_{i,k}} is 
@@ -20,8 +20,15 @@
 #' kinship coefficient.
 #' 
 #' With "eVar" option above formula changes by using ( 2 * empirical variance 
-#' of the genotype ) in the denominator
+#' of the genotype ) in the denominator. The empirical variance is computed 
+#' according to the formula 
 #' 
+#' \deqn{
+#' Var(g_k) = \frac{1}{M} \Sigma_i g_{ik}^2 - E[g_k]^2
+#' }
+#' 
+#' where M is the number of people
+#' 
 #' Only with "freq" option monomorphic SNPs are regarded as non-informative.
 #' 
 #' ibs() operation may be very lengthy for a large number of people.
@@ -30,7 +37,9 @@
 #' between a pair below the diagonal and number of SNP genotype  
 #' measured for both members of the pair above the diagonal. 
 #' 
-#' On the diagonal, homozygosity 0.5*(1+inbreeding) is provided.
+#' On the diagonal, homozygosity 0.5*(1+inbreeding) is provided with option 
+#' 'freq';  with option 'eVar' the diagonal is set to 0.5; the diagonal is set 
+#' to homozygosity with option 'no'.  
 #' 
 #' attr(computedobject,"Var") returns variance (replacing the 
 #' diagonal when the object is used by \code{\link{egscore}}
@@ -118,7 +127,7 @@
 		homodiag <- hom(data)[,"Hom"]
 		option = 0
 	} else if (weight == "freq") {
-		homodiag <- 0.5+(hom(data,snpfreq=snpfreq)[,"F"]/2)
+		homodiag <- 0.5*(1+hom(data,snpfreq=snpfreq)[,"F"])
 		option = 1
 	} else if (weight == "homo") {
 		smr <- summary(data)

Modified: pkg/GenABEL/man/egscore.Rd
===================================================================
--- pkg/GenABEL/man/egscore.Rd	2013-04-04 09:02:17 UTC (rev 1183)
+++ pkg/GenABEL/man/egscore.Rd	2013-04-04 10:06:36 UTC (rev 1184)
@@ -69,8 +69,8 @@
   first, derive axes of genetic variation (principal
   components), and, second, adjust both trait and genotypes
   onto these axes. Note that the diagonal of the kinship
-  matrix should be replaced (default it is .5+F, and for
-  EIGENSTRAT one needs variance).  These variances are
+  matrix should be replaced (default it is 0.5*(1+F), and
+  for EIGENSTRAT one needs variance).  These variances are
   porduced by \code{\link{hom}} function (see example).
 
   The traits is first analysed using LM and with covariates

Modified: pkg/GenABEL/man/hom.Rd
===================================================================
--- pkg/GenABEL/man/hom.Rd	2013-04-04 09:02:17 UTC (rev 1183)
+++ pkg/GenABEL/man/hom.Rd	2013-04-04 10:06:36 UTC (rev 1184)
@@ -65,7 +65,7 @@
 
   The variance (Var) is estimated as
 
-  \deqn{ V_{i} = \frac(1)(N) \Sigma_k \frac{(x_{i,k} -
+  \deqn{ V_{i} = \frac{1}{N} \Sigma_k \frac{(x_{i,k} -
   p_k)^2}{(p_k * (1 - p_k))} }
 
   where k changes from 1 to N = number of SNPs,

Modified: pkg/GenABEL/man/ibs.Rd
===================================================================
--- pkg/GenABEL/man/ibs.Rd	2013-04-04 09:02:17 UTC (rev 1183)
+++ pkg/GenABEL/man/ibs.Rd	2013-04-04 10:06:36 UTC (rev 1184)
@@ -34,7 +34,9 @@
   the diagonal.
 
   On the diagonal, homozygosity 0.5*(1+inbreeding) is
-  provided.
+  provided with option 'freq'; with option 'eVar' the
+  diagonal is set to 0.5; the diagonal is set to
+  homozygosity with option 'no'.
 
   attr(computedobject,"Var") returns variance (replacing
   the diagonal when the object is used by
@@ -51,8 +53,8 @@
   When weight "freq" is used, IBS for a pair of people i
   and j is computed as
 
-  \deqn{ f_{i,j} = \Sigma_k \frac{(x_{i,k} - p_k) *
-  (x_{j,k} - p_k)}{(p_k * (1 - p_k))} }
+  \deqn{ f_{i,j} = \frac{1}{N} \Sigma_k \frac{(x_{i,k} -
+  p_k) * (x_{j,k} - p_k)}{(p_k * (1 - p_k))} }
 
   where k changes from 1 to N = number of SNPs GW,
   \eqn{x_{i,k}} is a genotype of ith person at the kth SNP,
@@ -61,8 +63,15 @@
   of the kinship coefficient.
 
   With "eVar" option above formula changes by using ( 2 *
-  empirical variance of the genotype ) in the denominator
+  empirical variance of the genotype ) in the denominator.
+  The empirical variance is computed according to the
+  formula
 
+  \deqn{ Var(g_k) = \frac{1}{M} \Sigma_i g_{ik}^2 -
+  E[g_k]^2 }
+
+  where M is the number of people
+
   Only with "freq" option monomorphic SNPs are regarded as
   non-informative.
 



More information about the Genabel-commits mailing list