minus_mom: Subtracts maternal component to offspring genotypes

View source: R/minus_mom.R

minus_momR Documentation

Subtracts maternal component to offspring genotypes

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

minus_mom(x, MomCol = "ID", OffCol = "OffID", Check = FALSE)

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.

Check

A flag (default FALSE) that will run through the reduction process and produce a check of all mom/off/locus problems that are observed.

Value

Either a data.frame object of only the offspring after removing the contribution of each maternal individual or a data.frame with

Author(s)

Rodney J. Dyer <rjdyer@vcu.edu>

Examples

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") ) 
EE <- locus( c("E","E") )
F  <- locus( c("F"))
G  <- locus( )
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 )
loci <- c(AA,AB,BB,AD,BB,BC,G,CD,EE,F) 
df <- data.frame( ID=factor(momID), OffID=factor(offID), TPI=loci )
minus_mom( df, Check=TRUE )

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