Learn R Programming

QTLRel (version 0.1)

genoProb: 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=Inf, gr=2, pos=NULL, method=c("Haldane",
   "Kosambi"), verbose = 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 leftmost SNP (marker) on the chromosome.
step
the maximum "cumulative" distance (in cM) between two adjacent loci for which the probabilities are calculated. The 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.
verbose
a logical variable. If TRUE, certain information will be printed out during calculation.

Value

  • pra 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.
  • chrchromosome where the locus is located.
  • distgenetic distance (in cM) of the locus from the first locus on the chromosome.
  • snpSNP (marker) that the locus represents.

Details

The "cumulative" genetic distance between any two adjacent loci for which probabilities are calculated is not larger than step. If 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.

Examples

Run this code
data(miscEx)

sum(is.na(gdat))
gdat[11:13,21:25]

gdtmp<- (gdat=="AA") + (gdat=="AB")*2 + (gdat=="BB")*3
   gdtmp<- replace(gdtmp,is.na(gdtmp),0)
# The 12th individual not imputable on chromosome 7.
# One needs to assign genotypes manually.
prDat<- genoProb(gdat=gdtmp, gmap=genMap, step=Inf,
   gr=2, method="Haldane", verbose=TRUE)
prDat$pr[11:13,,21:25]

Run the code above in your browser using DataLab