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 FamiliasPedigree object or a list of such.

datamatrix

A data frame with two columns per marker (one for each allele) and one row per individual.

loci

A FamiliasLocus object or a list of such.

matchLoci

A logical, by default FALSE. If TRUE, the column names of datamatrix are matched against names(loci), or, if these are missing, against the name entries of loci. The column names of datamatrix are assumed to come in pairs with suffixes ".1" and ".2", e.g. "TH01.1", "TH01.2", etc. If FALSE, the loci are assumed to be in correct order, and no matching on marker name is done.

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

readFam().

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)


[Package pedFamilias version 0.2.2 Index]