Fix Pedigree
Ensure all parents & all genotyped individuals are included, remove duplicates, rename columns, and replace 0 by NA or v.v..
PedPolish( Pedigree, gID = NULL, ZeroToNA = TRUE, NAToZero = FALSE, DropNonSNPd = TRUE, FillParents = FALSE, NullOK = FALSE, LoopCheck = TRUE, StopIfInvalid = TRUE )
Pedigree |
dataframe where the first 3 columns are id, dam, sire. |
gID |
character vector with ids of genotyped individuals (rownames of genotype matrix). |
ZeroToNA |
logical, replace 0's for missing values by NA's (defaults to
|
NAToZero |
logical, replace NA's for missing values by 0's. If
|
DropNonSNPd |
logical, remove any non-genotyped individuals (but keep
non-genotyped parents), & sort pedigree in order of |
FillParents |
logical, for individuals with only 1 parent assigned, set
the other parent to a dummy (without assigning siblings or grandparents).
Makes the pedigree compatible with R packages and software that requires
individuals to have either 2 or 0 parents, such as
|
NullOK |
logical, is it OK for Ped to be NULL? Then NULL will be returned. |
LoopCheck |
logical, check for invalid pedigree loops by calling
|
StopIfInvalid |
if a pedigree loop is detected, stop with an error (TRUE, default). |
Recognized column names are any that contain:
"dam", "mother", "mot", "mom", "mum", "mat"
"sire", "father", "fat", "dad", "pat"
sequoia
requires the column order id - dam - sire; columns 2 and 3 are
swapped if necessary.
## Not run: # To get the output pedigree into kinship2 compatible format: PedP <- sequoia::PedPolish(SeqOUT$Pedigree, DropNonSNPd=FALSE, FillParents = TRUE) PedP$Sex <- with(PedP, ifelse(id %in% dam, "female", "male")) # default to 'male' to avoid warning: "More than 25% of the gender values are # 'unknown'" Ped.fix <- with(PedP, kinship2::fixParents(id=id, dadid=sire, momid=dam, sex=Sex)) Ped.k <- with(Ped.fix, kinship2::pedigree(id, dadid, momid, sex, missid=0)) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.