Pedigree             package:GeneticsPed             R Documentation

_P_e_d_i_g_r_e_e

_D_e_s_c_r_i_p_t_i_o_n:

     'Pedigree' function creates a pedigree object

_U_s_a_g_e:

     Pedigree(x, subject="id", ascendant=c("father", "mother"),
       ascendantSex=c(1, 2), ascendantLevel=c(1, 1), unknown=NA, sex=NA,
       dtBirth=NA, generation=NA, family=NA, generationOrder="increasing",
       check=TRUE, sort=FALSE, extend=FALSE, drop=TRUE, codes=FALSE)

_A_r_g_u_m_e_n_t_s:

       x: data.frame or matrix

 subject: character, column name in 'x' for subjects

ascendant: character, column name(s) in 'x' for ascendants

  family: character, column name in 'x' for family

ascendantSex: integer orcharacter, sex of ascendant(s); see details

ascendantLevel: integer, generation level of ascendant(s); see details

 unknown: vector or list, uknown representation of identification and
          other data in the pedigree; see details

     sex: character, column name in 'x' for sex

 dtBirth: character, column name in 'x' for date of birth

generation: character, column name in 'x' for generation

generationOrder: character, generation value is "increasing" or
          "decreasing" through generations; see details

   check: logical, check for common errors

    sort: logical, sort pedigree

  extend: logical, extend pedigree

    drop: logical, drop unused levels if factors are used

   codes: logical, code individuals into integers

_D_e_t_a_i_l_s:

     FIXME: study geneSet class

     Pedigree can be one source of information on genetic relationship
     between relatives. Take for example the following pedigree:


       paternal    paternal     maternal    maternal
       grandfather grandmother  grandfather grandmother
           |           |            |           |
           -------------            -------------
                 |                        |
               father                   mother
                 |                        |
                 -------------------------
                             |
                          subject

     This information can be stored in a data.frame as

       mother   maternal grandfather  maternal grandmother
       father   paternal grandfather  paternal grandmother
       subject  father                mother

     There is considerable variability in terminology between as well
     as within various fields of genetics. We use the following terms
     throughout the help and code: individual (any individual in a
     pedigree), subject (individual whose pedigree is given i.e.
     individuals in the first column in upper data.frame), ascendant
     and descendant. Additionally, family, sex, dtBirth and generation
     are used for additional data in the pedigree. Their meaning should
     be clear. For these, argument 'col' is usually used in function
     calls.

     'family' TODO

     'ascendantSex' can be used to define sex of ascendant(s); for
     example c("Male", "Female") or c("M", "F") or even c(1, 2) for
     father and mother or c(2, 1, 1) for mother and two possible
     fathers or c(1, 1) for father and maternal father etc. This data
     is needed only for the structure of the class and defaults should
     be ok for the majority. But you need to make sure that data
     defined here must be in accordance with values in 'sex' column.

     'ascendantLevel' can be used to define generation level of
     ascendant(s) in relation to a subject; for example c(1, 1) for
     father and mother or c(1, 1, 1) for mother and two possible
     fathers or c(1, 2) for father and maternal father etc. This data
     is needed only for the structure of the class and defaults should
     be ok for the majority.

     There is no need for 'as.integer' TODO in arguments
     'ascendantLevel' as this is done internally.

     unknown TODO

     Sex TODO

     Date of birth TODO

     'generationOrder' defines in which order are 'generation' values:
     "increasing" if values increase from ascendants to descendants and
     "decreasing" if values decrease from ascendants to descendants.

     'check', 'sort', 'extend', and 'codes' are actions on the pedigree
     and have their own help pages.

     Individuals can be stored as either integer, numeric or factor
     TODO. In any case all id columns must have the same class and this
     is automatically checked. Argument 'drop' can be used to drop
     unused levels, if factors are used.

     'as.Pedigree.*' FIXME 'as.*.Pedigree' FIXME

     Object of Pedigree class is a data.frame with columns that can be
     divided into core columns (subject, ascendant(s), sex, dtBirth and
     generationTODO) and possibly other columns such as data on
     phenotype and genotype and other subject attributes, for example
     factors and covariates TODO. Class name starts in upper case i.e.
     Pedigree and not pedigree, due to name clash with similar
     function in 'kinship' package.

     Additionally, the following attributes are set on pedigree:


   ._s_u_b_j_e_c_t character, column name of subject identification in
        pedigree

   ._a_s_c_e_n_d_a_n_t character, column name(s) of ascendant(s) identification
        in pedigree

   ._f_a_m_i_l_y character, column name of family identification in pedigree

   ._a_s_c_e_n_d_a_n_t_S_e_x integer, sex of ascendant(s)

   ._a_s_c_e_n_d_a_n_t_L_e_v_e_l integer, generation level of ascendant(s)

   ._s_e_x character, column name of subject's sex

   ._d_t_B_i_r_t_h character, column name of subject's date of birth

   ._g_e_n_e_r_a_t_i_o_n character, column name of subject's generation

   ._g_e_n_e_r_a_t_i_o_n_O_r_d_e_r character, generation value is "increasing" or
        "decreasing" through generations

   ._c_o_l_C_l_a_s_s character, storage class for id columns: "integer",
        "numeric" or "factor"

   ._c_h_e_c_k_e_d logical, is pedigree checked for common errors

   ._s_o_r_t_e_d logical, is pedigree sorted; by TODO

   ._e_x_t_e_n_d_e_d logical, is pedigree extended

   ._c_o_d_e_d logical, is pedigree coded

   ._u_n_k_n_o_w_n list, uknown representation for individual identification
        and other data in the pedigree; names of the list are c(".id",
        ".family", ".sex", ".dtBirth", ".generation")

_V_a_l_u_e:

     Pedigree object as described in the details

_A_u_t_h_o_r(_s):

     Gregor Gorjanc

_S_e_e _A_l_s_o:

     'check', 'sort', and 'extend' provide help on pedigree utility
     functions. There is also 'pedigree' in 'kinship' package

_E_x_a_m_p_l_e_s:

     data(Mrode2.1)
     Mrode2.1$dtB <- as.Date(Mrode2.1$dtB)
     x2.1 <- Pedigree(x=Mrode2.1, subject="sub", ascendant=c("fat", "mot"),
                      ascendantSex=c("M", "F"), family="fam", sex="sex",
                      generation="gen", dtBirth="dtB")

     if (FALSE) {
       ## How to handle different pedigree types
       ## * multiple parents
       ped2 <- ped
       ped2$father1 <- ped$father
       ped2$father2 <- ped$father
       ped2$father <- NULL
       ped2 <- as.data.frame(ped2)
       str(Pedigree(ped2, ascendant=c("father1", "father2", "mother"),
                    ascendantSex=c(1, 1, 2), ascendantLevel=c(1, 1, 1)))

       ## * different level of parents
       ped3 <- as.data.frame(ped)
       ped3$m.grandfather <- ped3$mother
       ped3$mother <- NULL
       str(Pedigree(ped3, ascendant=c("father", "m.grandfather"),
                    ascendantSex=c(1, 1), ascendantLevel=c(1, 2)))
     }

