mkfam {Mega2R} | R Documentation |
assemble pedigree information into a data frame
Description
Generate a data frame with a row for each person. The observations are:
pedigree | family pedigree name |
person | person name |
father | father of person |
mother | mother of person |
sex | sex of person |
trait | value of case/control phenotype for person |
Usage
mkfam(brkloop = FALSE, traitname = "default", envir = ENV)
Arguments
brkloop |
I haven't needed to set this TRUE yet. Maybe never will. If loops are broken, a person will be replaced by a dopple ganger in the same family with a different father/mother. The number of persons per family will be different when there are broken loops. Also, the person_link numbers will be different for all the persons after the first loop is broken. |
traitname |
Name of the trait to use as case/control value; by default, "default" |
envir |
An 'environment' that contains all the data frames created from the SQLite database. |
Value
data frame that is described above
Note
The columns of this data frame come by selecting the values after merging the data frames: pedigree_table, person_table, and trait_table.
Also, the father and mother columns from person_table are translated from the row index in the person_table to the corresponding name.
This function stores the data frame in the 'environment' and also returns it.
The function setfam()
stores the data frame
into the 'environment' and adjusts the genotype_table and the phenotype_table.
Examples
db = system.file("exdata", "seqsimm.db", package="Mega2R")
ENV = read.Mega2DB(db)
fam = mkfam()
fam