readFam {pedFamilias} | R Documentation |
.fam
filesParses the content of a .fam
file exported from Familias, and converts it
into suitable ped
objects. This function does not depend on the Familias
R package.
readFam(
famfile,
useDVI = NA,
Xchrom = FALSE,
prefixAdded = "added_",
fallbackModel = c("equal", "proportional"),
simplify1 = TRUE,
deduplicate = TRUE,
includeParams = FALSE,
verbose = TRUE
)
famfile |
Path (or URL) to a |
useDVI |
A logical, indicating if the DVI section of the |
Xchrom |
A logical. If TRUE, the |
prefixAdded |
A string used as prefix when adding missing parents. |
fallbackModel |
Either "equal" or "proportional"; the mutation model to be applied (with the same overall rate) when a specified model fails for some reason. Default: "equal". |
simplify1 |
A logical indicating if the outer list layer should be removed in the output if the file contains only a single pedigree. |
deduplicate |
A logical, only relevant for DVI. If TRUE (default), redundant copies of the reference pedigrees are removed. |
includeParams |
A logical indicating if various parameters should be read and returned in a separate list. See Value for details. Default: FALSE. |
verbose |
A logical. If TRUE, various information is written to the screen during the parsing process. |
The output of readFam()
depends on the contents of the input file,
and the argument includeParams
. This is FALSE by default, giving the
following possible outcomes:
If the input file only contains a database, the output is a list of
information (name, alleles, frequencies, mutation model) about each locus.
This list can be used as locusAttributes
in e.g. pedtools::setMarkers()
.
If the input file describes pedigree data, the output is a list of ped
objects. If there is only one pedigree, and simplify1 = TRUE
, the output
is a ped
object.
If useDVI = TRUE
, or useDVI = NA
and the file contains DVI data, then
the Reference Families
section of the file is parsed and converted to
ped
objects. Each family generally describes multiple pedigrees, so the
output gets another layer in this case.
If includeParams = TRUE
, the output is a list with elements main
(the
main output, as described above) and params
, a list with some or all of
the following entries:
version
: The version of Familias
dvi
: A logical indicating if a DVI section was read
dbName
: The name of the database
dbSize
: A named numeric vector containing the DatabaseSize reported for
each marker
dropoutConsider
: A named logical vector indicating for each person if
dropouts should be considered
dropoutValue
: A named numeric vector containing the dropout value for
each marker
maf
: A named numeric vector containing the "Minor Allele Frequency"
given for each marker
theta
: The Theta/Kinship/Fst
value given for the marker database
Egeland et al. (2000). Beyond traditional paternity and identification cases. Selecting the most probable pedigree. Forensic Sci Int 110(1): 47-59.
# Using example file "paternity.fam" included in the package
fam = system.file("extdata", "paternity.fam", package = "pedFamilias")
# Read and plot
peds = readFam(fam)
plotPedList(peds, hatched = typedMembers, marker = 1)
# Store parameters
x = readFam(fam, includeParams = TRUE)
x$params
stopifnot(identical(x$main, peds))