Familias2ped: Convert 'Familias' objects to 'ped' format

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/familias2ped.R

Description

Familias is a widely used software for forensic kinship computations, which also features an accompanying R package (also called Familias). The function documented here converts pedigrees and marker data from the R version of Familias to pedtools::ped() format, used by forrel. This may be of interest for specialized computations not implemented in Familias, e.g. conditional simulations. Note: For importing ".fam" files created by (the stand-alone) Familias, see readFam().

Usage

1
2
3
Familias2ped(familiasped, datamatrix, loci, matchLoci = FALSE)

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. If TRUE, the column names of datamatrix must be found either within names(loci) or within 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 default) it is assumed that the loci correspond to the (pairs of) columns in datamatrix sequentially.

Details

The Familias program represents pedigrees and marker data in a way that differs from the ped format in several ways, mostly because of the latter's stricter definition of a pedigree. A ped object always represent a connected pedigree, and each member must have either 0 or 2 parents. None of this is required by FamiliasPedigree objects. The conversion function Familias2ped takes care of all potential differences: It converts each Familias pedigree into a list of connected ped objects, adding missing parents where needed.

Value

A ped object, or a list of such.

Author(s)

Magnus Dehli Vigeland, Thore Egeland

References

Familias is freely available from https://familias.name.

See Also

readFam()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
famPed = structure(
  list(id = c('mother', 'daughter', 'AF'),
       findex = c(0, 3, 0),
       mindex = c(0, 1, 0),
       sex = c('female', 'female', 'male')),
  class = "FamiliasPedigree")

datamatrix = data.frame(
  M1.1 = c(NA, 8, NA),
  M1.2 = c(NA, 9.3, NA),
  row.names = famPed$id)

famLoc = structure(
  list(locusname = "M1",
       alleles = c("8" = 0.2, "9" = 0.5, "9.3" = 0.3)),
  class = "FamiliasLocus")

Familias2ped(famPed, datamatrix, loci = famLoc, matchLoci = TRUE)

forrel documentation built on March 14, 2021, 1:06 a.m.