paternity: Estimates fractional paternity probability

View source: R/paternity.R

paternityR Documentation

Estimates fractional paternity probability

Description

This function estimates fractional paternity for offspring given a set of potential fathers.

Usage

paternity(
  offspring,
  mother,
  fathers,
  ID = "ID",
  OffID = "OffID",
  strict = FALSE
)

Arguments

offspring

A particular offspring. Often as a row from a data.frame with columns as loci and other meta data.

mother

The assumed mother of the offspring as a row from a data.frame with columns as loci and other meta data.

fathers

A data.frame of potential fathers.

ID

The name of the column where the dad's adult ID column is found in the data.frame of potential fathers.

OffID

The name of the column where the offspring ID is located. All offspring from a maternal individual should have have the same maternal ID to indicate which mother they are from but must also have a unique offspring ID.

strict

A flag (default=FALSE) to use strict paternity (e.g., where only one dad can be the father) versus fractional paternity (e.g., where potentially more than one father is assignable but whose likelihood is based upon their transition probabilities).

Value

A data.frame with indications of paternity by row. Columns will include ID, OffID, DadID, and potentially Fij.

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

freqs <- c(1/3,1/3,1/3)
loci <- rep( paste("Loc",1:6,sep="-"), each=3)
alleles <- LETTERS[1:3]
f <- data.frame(Locus=loci, Allele=alleles, Frequency=freqs)
f
adults <- make_population(f,N=20)
adults
offs <- mate( adults[1,], adults[2,], N=10)
offs$OffID <- offs$ID
offs$MomID <- adults$ID[1]
paternity( offs, adults[1,], adults )

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.