~ubuntu-branches/ubuntu/trusty/r-cran-genabel/trusty

« back to all changes in this revision

Viewing changes to man/hom.Rd

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2013-07-22 09:22:48 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130722092248-xds9dpinjhbx3kho
Tags: 1.7-6-1
* New upstream version
* debian/control: Drop citation from long description because this
  information is provided in debian/upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
\name{hom}
2
2
\alias{hom}
3
3
\title{function to compute average homozygosity within a person}
4
 
\description{
5
 
This function computes average homozygosity (inbreeding) for a set of 
6
 
people, across multiple markers. Can be used for Quality Control
7
 
(e.g. contamination checks)
8
 
}
9
4
\usage{
10
 
        hom(data, snpsubset, idsubset, snpfreq, n.snpfreq = 1000)
 
5
  hom(data, snpsubset, idsubset, snpfreq, n.snpfreq = 1000)
11
6
}
12
7
\arguments{
13
 
  \item{data}{Object of \link{gwaa.data-class} or \link{snp.data-class}}
 
8
  \item{data}{Object of \link{gwaa.data-class} or
 
9
  \link{snp.data-class}}
 
10
 
14
11
  \item{snpsubset}{Subset of SNPs to be used}
15
 
  \item{idsubset}{People for whom average homozygosity is to be computed}
16
 
  \item{snpfreq}{when option weight="freq" used, you can provide 
17
 
                fixed allele frequencies}
18
 
  \item{n.snpfreq}{when option weight="freq" used, you can provide 
19
 
                a vector supplying the number of people used to estimate allele 
20
 
                frequencies at the particular marker, or a fixed number}
 
12
 
 
13
  \item{idsubset}{People for whom average homozygosity is
 
14
  to be computed}
 
15
 
 
16
  \item{snpfreq}{when option weight="freq" used, you can
 
17
  provide fixed allele frequencies}
 
18
 
 
19
  \item{n.snpfreq}{when option weight="freq" used, you can
 
20
  provide a vector supplying the number of people used to
 
21
  estimate allele frequencies at the particular marker, or
 
22
  a fixed number}
 
23
}
 
24
\value{
 
25
  A matrix with rows corresponding to the ID names and
 
26
  columns showing the number of SNPs measured in this
 
27
  person (NoMeasured), the number of measured polymorphic
 
28
  SNPs (NoPoly), homozygosity (Hom), expected homozygosity
 
29
  (E(Hom)), variance, and the estimate of inbreeding, F.
 
30
}
 
31
\description{
 
32
  This function computes average homozygosity (inbreeding)
 
33
  for a set of people, across multiple markers. Can be used
 
34
  for Quality Control (e.g. contamination checks)
21
35
}
22
36
\details{
23
 
        Homozygosity is measured as proportion of 
24
 
        homozygous genotypes observed in a person.
25
 
 
26
 
        Inbreeding for person \eqn{i} is estimated with 
27
 
 
28
 
        \deqn{
29
 
        f_i = \frac{(O_i - E_i)}{(L_i - E_i)}
30
 
        }{
31
 
        f_i = ((O_i - E_i))/((L_i - E_i))
32
 
        }
33
 
 
34
 
        where \eqn{O_i} is observed homozygosity, \eqn{L_i} is the number of SNPs 
35
 
        measured in individual \eqn{i} and 
36
 
 
37
 
        \deqn{
38
 
        E_i = \Sigma_{j=1}^{L_i} (1 - 2 p_j (1 - p_j) \frac{T_{Aj}}{T_{Aj}-1})
39
 
        }{
40
 
        E_i = Sigma_(j=1)^(L_i) (1 - 2 p_j (1 - p_j) (T_(Aj))/(T_(Aj)-1))
41
 
        }
42
 
 
43
 
        where \eqn{T_{Aj}} is the number of measured genotypes at locus \eqn{j}; 
44
 
        \eqn{T_{Aj}} is either estimated from data or provided by "n.snpfreq" 
45
 
        parameter (vector). Allelic frequencies are either estimated from 
46
 
        data or provided by the "snpfreq" vector.
47
 
 
48
 
        This measure is the same as used by PLINK (see reference).
49
 
 
50
 
        The variance (Var) is estimated as
51
 
        
52
 
        \deqn{
53
 
        V_{i} = \frac(1)(N) \Sigma_k \frac{(x_{i,k} - p_k)^2}{(p_k * (1 - p_k))}
54
 
        }
55
 
 
56
 
        where k changes from 1 to N = number of SNPs, \eqn{x_{i,k}} is 
57
 
        a genotype of ith person at the kth SNP, coded as 0, 1/2, 1 and 
58
 
        \eqn{p_k} is the frequency 
59
 
        of the "+" allele.
60
 
 
61
 
        Only polymorphic loci with number of measured genotypes >1 are used
62
 
        with this option.
63
 
 
64
 
        This variance is used as diagonal of the genomic 
65
 
        kinship matrix when using EIGENSTRAT method. 
66
 
 
67
 
        You should use as many people and markers as possible when estimating 
68
 
        inbreeding/variance from marker data.
69
 
}
70
 
\value{
71
 
        A matrix with rows corresponding to the ID names and columns
72
 
        showing the number of SNPs measured in this person (NoMeasured), 
73
 
        the number of measured polymorphic SNPs (NoPoly),  
74
 
        homozygosity (Hom),
75
 
        expected homozygosity (E(Hom)), variance, and
76
 
        the estimate of inbreeding, F. 
77
 
}
78
 
\references{
79
 
        Purcell S. et al, (2007) PLINK: a toolset for whole genome association and population-based 
80
 
        linkage analyses. Am. J. Hum. Genet.
81
 
}
82
 
\author{Yurii Aulchenko, partly based on code by John Barnard}
83
 
%\note{
84
 
%}
85
 
\seealso{
86
 
\code{\link{ibs}},
87
 
\code{\link{gwaa.data-class}},
88
 
\code{\link{snp.data-class}}
 
37
  Homozygosity is measured as proportion of homozygous
 
38
  genotypes observed in a person.
 
39
 
 
40
  Inbreeding for person \eqn{i} is estimated with
 
41
 
 
42
  \deqn{ }{ f_i = ((O_i - E_i))/((L_i - E_i)) }\deqn{ f_i =
 
43
  \frac{(O_i - E_i)}{(L_i - E_i)} }{ f_i = ((O_i -
 
44
  E_i))/((L_i - E_i)) }\deqn{ }{ f_i = ((O_i - E_i))/((L_i
 
45
  - E_i)) }
 
46
 
 
47
  where \eqn{O_i} is observed homozygosity, \eqn{L_i} is
 
48
  the number of SNPs measured in individual \eqn{i} and
 
49
 
 
50
  \deqn{ }{ E_i = Sigma_(j=1)^(L_i) (1 - 2 p_j (1 - p_j)
 
51
  (T_(Aj))/(T_(Aj)-1)) }\deqn{ E_i = \Sigma_{j=1}^{L_i} (1
 
52
  - 2 p_j (1 - p_j) \frac{T_{Aj}}{T_{Aj}-1}) }{ E_i =
 
53
  Sigma_(j=1)^(L_i) (1 - 2 p_j (1 - p_j)
 
54
  (T_(Aj))/(T_(Aj)-1)) }\deqn{ }{ E_i = Sigma_(j=1)^(L_i)
 
55
  (1 - 2 p_j (1 - p_j) (T_(Aj))/(T_(Aj)-1)) }
 
56
 
 
57
  where \eqn{T_{Aj}} is the number of measured genotypes at
 
58
  locus \eqn{j}; \eqn{T_{Aj}} is either estimated from data
 
59
  or provided by "n.snpfreq" parameter (vector). Allelic
 
60
  frequencies are either estimated from data or provided by
 
61
  the "snpfreq" vector.
 
62
 
 
63
  This measure is the same as used by PLINK (see
 
64
  reference).
 
65
 
 
66
  The variance (Var) is estimated as
 
67
 
 
68
  \deqn{ V_{i} = \frac{1}{N} \Sigma_k \frac{(x_{i,k} -
 
69
  p_k)^2}{(p_k * (1 - p_k))} }
 
70
 
 
71
  where k changes from 1 to N = number of SNPs,
 
72
  \eqn{x_{i,k}} is a genotype of ith person at the kth SNP,
 
73
  coded as 0, 1/2, 1 and \eqn{p_k} is the frequency of the
 
74
  "+" allele.
 
75
 
 
76
  Only polymorphic loci with number of measured genotypes
 
77
  >1 are used with this option.
 
78
 
 
79
  This variance is used as diagonal of the genomic kinship
 
80
  matrix when using EIGENSTRAT method.
 
81
 
 
82
  You should use as many people and markers as possible
 
83
  when estimating inbreeding/variance from marker data.
89
84
}
90
85
\examples{
91
86
data(ge03d2)
93
88
h[1:5,]
94
89
homsem <- h[,"Hom"]*(1-h[,"Hom"])/h[,"NoMeasured"]
95
90
plot(h[,"Hom"],homsem)
96
 
# wrong analysis: one should use all people (for right frequency) and markers (for right F) available!
 
91
# wrong analysis: one should use all people (for right frequency)
 
92
# and markers (for right F) available!
97
93
h <- hom(ge03d2[,c(1:10)])
98
94
h
99
95
}
100
 
\keyword{htest}% at least one, from doc/KEYWORDS
 
96
\author{
 
97
  Yurii Aulchenko, partly based on code by John Barnard
 
98
}
 
99
\references{
 
100
  Purcell S. et al, (2007) PLINK: a toolset for whole
 
101
  genome association and population-based linkage analyses.
 
102
  Am. J. Hum. Genet.
 
103
}
 
104
\seealso{
 
105
  \code{\link{ibs}}, \code{\link{gwaa.data-class}},
 
106
  \code{\link{snp.data-class}}
 
107
}
 
108
\keyword{htest}
 
109