checkPedigreeFile {relMix} | R Documentation |
Check a pedigree file
Description
Given a pedigree file path the function attempts to load it and compare it to the reference profiles to detect possible errors.
Usage
checkPedigreeFile(filename, df)
Arguments
filename |
Path of the pedigree file |
df |
Data frame with reference profiles |
Details
The pedigree file must be a a text file in ped format (see the relMix vignette for an example). The data frame with reference data is used to compare names of individuals and detect possible misspellings. If warnings are found, the function attempts to fix them and explains what it has done in the warning messages. If an error is found, checking stops. The error is described in the error messages.
Value
A list containing
-
df
A list of class [Familias::FamiliasPedigree()], or NULL if errors are present. -
warning
A list of strings describing the errors that ocurred but could be fixed or that do not prevent the execution of the program. -
error
A list of strings describing the errors that ocurred that made it imposible to return a valid data frame. If this list is not empty, then the dataframe item will be null.
Author(s)
Elias Hernandis
Examples
#First load mixture file
mixfile <- system.file("extdata","mixture_silent_ex.txt",package="relMix")
mix <- checkMixtureFile(mixfile);
#Load reference file
reffile <- system.file("extdata","references_silent.txt",package="relMix")
ref <- checkReferenceFile(reffile, mix$df)
#Check pedigree file
pedfile <- system.file("extdata","custom_pedigree_maternity_duo.ped",package="relMix")
checkPedigreeFile(pedfile,ref$df);