genoProb: Probability of a Genotype.

View source: R/imFn.R

genoProbR Documentation

Probability of a Genotype.

Description

Calculate the probability of a genotype at a locus conditional on the genotypes of its flanking markers in advance intercross lines (AIL).

Usage

genoProb(gdat, gmap, step, gr = 2, pos = NULL, method=c("Haldane", "Kosambi"),
   msg = FALSE)

Arguments

gdat

Genotype data. Should be a matrix or a data frame, with each row representing an observation and each column a marker locus. The column names should be marker names. Each entry should be 1, 2, 3 or 0, corresponding to "AA", "AB", "BB" or missing genotype.

gmap

A genetic map. Should be data frame (snp, chr, dist,...), where "snp" is the SNP (marker) name, "chr" is the chromosome where the "snp" is, and "dist" is the genetic distance in centi-Morgan (cM) from the left of the chromosome.

step

Optional. If specified, it is the maximum "cumulative" genetic distance (in cM) between two adjacent loci for which the probabilities are calculated. The genetic distance corresponds to the "cumulative" recombination rate at gr-th generation.

gr

The generation under consideration.

pos

Data frame (chr, dist, snp, ...). If given, step will be ignored.

method

Whether "Haldane" or "Kosambi" mapping function should be used.

msg

A logical variable. If TRUE, certain information will be printed out during calculation.

Details

The "cumulative" genetic distance between any two adjacent loci for which probabilities are calculated is not larger than step. If step is missing or step = Inf, probabilities will only be calculated at loci in both the columns of gdat and the rows of gmap. If step is small, a large set of putative loci will be considered, including all loci defined by the columns of gdat and the rows of gmap.

Value

Probabilities for genotypes as well as genetic map information (snp,chr,dist)

pr

A 3-D array with the first dimension corresponding to that of gdat, the second to three genotype and the third to the putative loci. The probabilities will be -1 if not imputable, which happens when the genotype data is missing at all loci on the chromosome.

Note

Currently only suitable for advanced intercross lines.

Examples

data(miscEx)

## Not run: 
# briefly look at genotype data
sum(is.na(gdatF8))
gdatF8[1:5,1:5]

gdtmp<- gdatF8
   gdtmp<- replace(gdtmp,is.na(gdtmp),0)
# In case an individual is not imputable, then
# one needs to assign genotypes manually
prDat<- genoProb(gdat=gdtmp, gmap=gmapF8, gr=8, method="Haldane", msg=TRUE)
prDat$pr[1:5,,1:5]

## End(Not run)

QTLRel documentation built on Aug. 9, 2023, 1:07 a.m.

Related to genoProb in QTLRel...