prep_cross: Create a cross object

Description Usage Arguments Details Value

View source: R/prep_cross.R

Description

Takes raw founder and final genotypes and assembles a cross object for downstream analysis. The genotypic data is first filtered for unambiguous genotypes (see Details), then the genotypes are recoded based on the unambiguous genotypes. Finally a cross object is assembled and returned.

Usage

1
prep_cross(map, founders, finals, selfing.gen)

Arguments

map

The genetic map, formatted as a list of chromosomes, where each chromosome is a named vector of marker positions (in cM) and the names are the marker names.

founders

A list of founder genotypes, where each element in the list is a matrix of genotypes on a single chromosome. Genotypes should be coded as z {0, 1, 2, NA} where z is the number of reference alleles. Column names should be marker names. This is the observed genotype data.

finals

A list of progeny genotypes. The encoding and formatting should be identical to the argument founders.

selfing.gen

The number of selfing generations that the finals have undergone. If the generation of the finals is F_t, then the argument selfing.gen would be t - 1.

Details

To force genotype data from a bi-parental family into a cross object in read.cross, the genotypes must be recoded into parental states. Say two inbred parents have the observed gentypes parent1 = 0 and parent2 = 2, the parental states would be recoded as parent1 = 1 and parent2 = 3. Parent 1 is also given a parental state of 1 and parent 2 is always given a parental state of 3. Among the progeny, any genotype call that is identical to the that of parent 1 would received a recoded genotype of 1, and any gentype cal that is identical to that of parent 2 would receive a recoded genotype of 3. Heterozygous genotype calls are recoded as 2.

Of course, in observed genotype data, the parental states are inherently unknown (otherwise imputation would be easy). To determine parental states at a marker, the marker must be unambiguous. That is, the parental states must be easily inferred. To do this, we must only look at markers for which the parents are both observed (i.e. no NA) and polymorphic between (i.e. 0 and 2). Any ambiguous markers are set to missing. This is ok, because the imputation step is easily able to impute these genotypes.

Value

An object of class cross with the normal elements geno and pheno. The geno element is a list of chromosomes, each with the elements:

data

The recoded progeny genotypes

map

The genetic map on that chromosome

founders

The original founder genotypes

finals

The original final genotypes

founders_unamb

The unambiguous founder genotypes

finals_unamb

The unambiguous final genotypes


neyhartj/fsimpute documentation built on May 23, 2019, 4:29 p.m.