trio.prepare
function. Otherwise, an object identifying the Mendelian errors is
returned.trio.check(dat, is.linkage=TRUE, replace=FALSE)
If the data are in linkage format, the file has to have the
standard linkage/pedigree format. Each row describes an individual,
and the columns are trio.ped1
and
trio.ped2
contained in this package as examples for trio data
in linkage file format (complete and with missing records,
respectively).
If the data are in genotype format, each row in the
object describes an individual, and each block of three consecutive
rows describes the two parents and the affected child in a trio. The
columns in the object are NA
=missing genotype). Please see the
data frames trio.gen1
and trio.gen2
contained in this
package as examples for trio data in linkage file format (complete
and with missing records, respectively).
TRUE
) or in genotype format
(FALSE
).NA
, and an object suitable for
input to the trio.prepare
function is returned.trio.check
returns a list with the following
elements:trio.prepare
. This element will be
NULL
if Mendelian errors are detected.NULL
if no Mendelian errors
are detected. Otherwise, this element will be a data frame with
five columns, indicating the Mendelian errors detected in the object
dat
. The five columns of the data frame refer to the trio
(trio
), the family id (famid
), the genotype (snp
), the row numbers (r
),
and the column numbers (c
).NULL
if no Mendelian
errors are detected. Otherwise, this element will be a data frame
with the trio genotype data. If the input was a linkage file, the
data will be converted from alleles to genotypes. If the input was a
genotype file, this element will be identical to the input.trio.check
. Unless otherwise specified, this function assumes
that the data are in linkage format, however, genotype data can also
be accommodated. If no Mendelian inconsistencies in the data provided
are identified, trio.check
creates an object that can be
processed in the subsequent analysis with the trio.prepare
function. If the data were in linkage format, the genotype information
for each SNP will be converted into a single variable, denoting the
number of variant alleles. To delineate the genotype information for the pseudo-controls in the
subsequent analysis, the trio data must not contain any Mendelian
errors. The function trio.check
returns a warning, and an R
object with relevant information when Mendelian errors are encountered
in the supplied trio data. It is the users responsibility to find the
cause for the Mendelian errors and correct those, if
possible. However, Mendelian inconsistencies are often due to
genotyping errors and thus, it might not be possible to correct those
in a very straightforward manner. In this instance, the user might
want to encode the genotypes that cause theses Mendelian errors in
some of the trios as missing data. The function trio.check
allows for this possibility, using the argument replace=T
.
trio.prepare
data(trio.data)
trio.tmp <- trio.check(dat=trio.ped1)
str(trio.tmp, max=1)
trio.tmp$trio[1:6,]
trio.tmp <- trio.check(dat=trio.ped.err)
str(trio.tmp, max=1)
trio.tmp$errors
trio.tmp$trio.err[1:3, c(1,2, 11:12)]
trio.ped.err[1:3,c(1:2, 23:26)]
trio.tmp <- trio.check(dat=trio.gen.err, is.linkage=FALSE)
trio.tmp$errors
trio.tmp$trio.err[1:6, c(1,2,7), drop=FALSE]
trio.rep <- trio.check(dat=trio.gen.err, is.linkage=FALSE, replace=TRUE)
trio.rep$trio[1:6,c(1,2,7)]
Run the code above in your browser using DataLab