minus_mom: Subtracts maternal component to offspring genotypes

Description Usage Arguments Value Author(s) Examples

View source: R/minus_mom.R

Description

This function removes the female component to the offspring genotypes. It is one step in the 2gener analysis. The coding of the MomCol and the OffCol headers are specific so that this algorithm can differentiate between maternal individuals and offspring.

Usage

1
minus_mom(x, MomCol = "ID", OffCol = "OffID")

Arguments

x

A data.frame with mother and offspring locus columns.

MomCol

The name of the column indicating maternal ID. All offspring from a mother MUST have the same MomCol value.

OffCol

The name of the column indicating the offspring ID number. It is required that maternal individuals have OffCol="0" indicating that this is the mother of those offspring.

Value

A data.frame object of only the offspring after removing the contribution of each maternal individual.

Author(s)

Rodney J. Dyer <rjdyer@vcu.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
AA <- locus( c("A","A") )
AB <- locus( c("A","B") )
BB <- locus( c("B","B") )
AC <- locus( c("A","C") )
AD <- locus( c("A","D") )
BC <- locus( c("B","C") )
BD <- locus( c("B","D") )
CC <- locus( c("C","C") )
CD <- locus( c("C","D") )
DD <- locus( c("D","D") ) 
loci <- c(AA,AB,AC,AD,BB,BC,BD,CD,CD,DD) 
offID <- c(0 ,1,2 , 3, 0, 1, 2,1, 0, 2 )
momID <- c(rep("A",4), rep("B",3), rep("C",3))
df <- data.frame( ID=factor(momID), OffID=factor(offID), TPI=loci )
minus_mom( df )

MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.