Familias2ped {pedFamilias} | R Documentation |
Convert Familias
R objects to ped
Description
Convert pedigrees and marker data from the Familias
R package into the
ped
format used by the pedsuite
.
Usage
Familias2ped(
familiasped,
datamatrix,
loci,
matchLoci = FALSE,
prefixAdded = "added_"
)
readFamiliasLoci(loci)
Arguments
familiasped |
A |
datamatrix |
A data frame with two columns per marker (one for each allele) and one row per individual. |
loci |
A |
matchLoci |
A logical, by default FALSE. If TRUE, the column names of
|
prefixAdded |
A string used as prefix when adding missing parents. |
Details
The definition of a pedigree in Familias is more liberal than that
implemented in the pedsuite
, which requires that each ped
object is a
connected pedigree, and that each member has either 0 or 2 parents. The
conversion function Familias2ped
takes care of all potential differences.
Specifically, it converts each FamiliasPedigree
object into a list of
connected ped
components, and adds missing parents when needed.
Value
A ped
object, or a list of such.
References
Familias is freely available from https://familias.name.
See Also
Examples
famPed = list(id = c('mother', 'daughter', 'AF'),
findex = c(0, 3, 0),
mindex = c(0, 1, 0),
sex = c('female', 'female', 'male'))
class(famPed) = "FamiliasPedigree"
datamatrix = data.frame(
M1.1 = c(NA, 8, NA),
M1.2 = c(NA, 9.3, NA),
row.names = famPed$id)
famLoc = list(locusname = "M1",
alleles = c("8" = 0.2, "9" = 0.5, "9.3" = 0.3))
class(famLoc) = "FamiliasLocus"
Familias2ped(famPed, datamatrix, loci = famLoc, matchLoci = TRUE)