
Read an ancestry compatibility rules table from a file
Source:R/readAncestryRules.R
readAncestryRules.RdReads a center-configurable ancestry compatibility rules table from a
user-supplied file into a data frame for checkAncestryRules
(issue #168). Each row is one unordered pair of standardized ancestry
levels plus the rule's severity: columns ancestry1,
ancestry2, and severity ("block" or "flag"),
with a header row. Excel (.xls/.xlsx) and delimited text
(.csv/.txt) files are both accepted, mirroring
readKinshipOverrides.
Value
A data frame of the rows read from fileName (typically with
columns ancestry1, ancestry2, and severity). Validate
it with checkAncestryRules before use.
Details
This reader does not validate structure or domain – that is
checkAncestryRules's job. An example rules file expressing
the rhesus Indian-origin purity case ships as
example_ancestry_rules.csv in the package's
extdata/examples directory.
Examples
rulesFile <- system.file("extdata", "examples",
"example_ancestry_rules.csv",
package = "nprcgenekeepr"
)
rules <- checkAncestryRules(readAncestryRules(rulesFile))
rules
#> ancestry1 ancestry2 severity
#> 1 INDIAN CHINESE block
#> 2 INDIAN HYBRID block
#> 3 INDIAN UNKNOWN flag
#> 4 INDIAN OTHER flag