Description Usage Arguments Details Value Author(s) See Also Examples
mendelList
creates a "mendelList" object (a list of trios).
mendelListAsDataFrame
converts a "mendelList" object to a data frame.
1 2 3 | mendelList(familyid, offspring, father, mother, sex, scanID)
mendelListAsDataFrame(mendel.list)
|
familyid |
A vector of family identifiers. |
offspring |
A vector of offspring subject identifiers. |
father |
A vector of father identifiers. |
mother |
A vector of mother identifiers. |
sex |
A vector to specify whether each subject is male "M" or female "F". |
scanID |
A vector of scanIDs indicating unique genotyping
instances for the |
mendel.list |
An object of class "mendelList". |
The lengths of familyid
, offspring
, father
,
mother
, sex
, and scanID
must all be
identical. These vectors should include all genotyped samples, i.e.,
samples present in the father
and mother
vectors should also
appear in the offspring
vector if there are genotypes for these
samples, and their unique scan IDs should be given in the
scanID
vector.
Identifiers may be character strings or integers, but not factors.
The "mendelList" object is required as input for the mendelErr
function.
mendelList
returns a "mendelList" object. A "mendelList" object is a list of lists.
The first level list is all the families.
The second level list is offspring within families who have one or both parents genotyped.
Within the second level are data.frame(s) with columns "offspring", "father", and "mother" which each contain
the scanID for each member of the trio (a missing parent is denoted by -1).
When replicates of the same offsping ID occur (duplicate scans for the same subject),
this data.frame has multiple rows representing all combinations
of scanIDs for that trio.
mendelListAsDataFrame
returns a data.frame with variables "offspring", "father", and "mother" which each contain
the scanID for each member of the trio (a missing parent is denoted by -1). This takes every data.frame
from the "mendelList" object and puts them all into one large data frame. This can be easier to work with
for certain analyses.
Xiuwen Zheng, Matthew P. Conomos
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # data frame of sample information. No factors!
dat <- data.frame(family=c(1,1,1,1,2,2,2), offspring=c("a","a","b","c","d","e","f"),
father=c("b","b",0,0,"e",0,0), mother=c("c","c",0,0,"f",0,0),
sex=c("M","M","M","F","F","M","F"), scanID=1:7,
stringsAsFactors=FALSE)
dat
men.list <- mendelList(dat$family, dat$offspring, dat$father, dat$mother,
dat$sex, dat$scanID)
men.list
# If fathers and mothers do not have separate entries in each vector,
# mendelList returns a "NULL":
dat <- dat[c(1,5),]
dat
mendelList(dat$family, dat$offspring, dat$father, dat$mother,
dat$sex, dat$scanID)
men.df <- mendelListAsDataFrame(men.list)
men.df
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.