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

View source: R/familias2ped.R

Familias2pedR Documentation

Convert Familias objects to ped format


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().


Familias2ped(familiasped, datamatrix, loci, matchLoci = FALSE)




A FamiliasPedigree object or a list of such.


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


A FamiliasLocus object or a list of such.


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.


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.


A ped object, or a list of such.


Magnus Dehli Vigeland, Thore Egeland


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

See Also



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 18, 2022, 5:19 p.m.