summary.genotype
creates an object containing allele and
genotype frequency from a genotype
or haplotype
object. print.summary.genotype
displays a
summary.genotype
object.
# S3 method for genotype
summary(object, ..., maxsum)
# S3 method for summary.genotype
print(x,...,round=2)
an object of class genotype
or haplotype
(for
summary.genotype
) or an object of class
summary.genotype
(for print.summary.genotype
)
optional parameters. Ignored by summary.genotype
,
passed to print.matrix
by print.summary,genotype
.
specifying any value for the parameter
maxsum will cause summary.genotype
to fall back to
summary.factor
.
number of digits to use when displaying proportions.
The returned value of summary.genotype
is an object of class
summary.genotype
which
is a list with the following components:
locus information field (if present) from x
vector of allele names
A two column matrix with one row for each allele, plus one row for
NA
values (if present). The first column, Count
,
contains the frequency of the corresponding allele value. The
second column, Proportion
, contains the fraction of alleles
with the corresponding allele value. Note each observation contains
two alleles, thus the Count
field sums to twice the number of
observations.
A two column matrix with one row for each genotype, plus one row for
NA
values (if present). The first column, Count
, contains the
frequency of the corresponding genotype. The second column,
Proportion
, contains the fraction of genotypes with the
corresponding value.
print.summary.genotype silently returns the object x.
Specifying any value for the parameter maxsum
will cause fallback
to summary.factor
. This is so that the function
summary.dataframe
will give reasonable output when it contains a
genotype column. (Hopefully we can figure out something better to do
in this case.)
genotype
,
HWE.test
,
allele
,
homozygote
,
heterozygote
,
carrier
,
allele.count
locus
gene
marker
# NOT RUN {
example.data <- c("D/D","D/I","D/D","I/I","D/D",
"D/D","D/D","D/D","I/I","")
g1 <- genotype(example.data)
g1
summary(g1)
# }
Run the code above in your browser using DataLab