compare_genoprob: Compare two sets of genotype probabilities

View source: R/compare_genoprob.R

compare_genoprobR Documentation

Compare two sets of genotype probabilities

Description

Compare two sets of genotype probabilities for one individual on a single chromosome.

Usage

compare_genoprob(
  probs1,
  probs2,
  cross,
  ind = 1,
  chr = NULL,
  minprob = 0.95,
  minmarkers = 10,
  minwidth = 0,
  annotate = FALSE
)

Arguments

probs1

Genotype probabilities (as produced by calc_genoprob()) or allele dosages (as produced by genoprob_to_alleleprob()).

probs2

A second set of genotype probabilities, just like probs1.

cross

Object of class "cross2". For details, see the R/qtl2 developer guide.

ind

Individual to plot, either a numeric index or an ID.

chr

Selected chromosome; a single character string.

minprob

Minimum probability for inferring genotypes (passed to maxmarg()).

minmarkers

Minimum number of markers in results.

minwidth

Minimum width in results.

annotate

If TRUE, add some annotations to the geno1 and geno2 columns to indicate, where they differ, which one matches what appears to be the best genotype. (* = matches the best genotype; - = lower match).

Details

The function does the following:

  • Reduce the probabilities to a set of common locations that also appear in cross.

  • Use maxmarg() to infer the genotype at every position using each set of probabilities.

  • Identify intervals where the two inferred genotypes are constant.

  • Within each segment, compare the observed SNP genotypes to the founders' genotypes.

Value

A data frame with each row corresponding to an interval over which probs1 and probs2 each have a fixed inferred genotype. Columns include the two inferred genotypes, the start and end points and width of the interval, and when founder genotypes are in cross, the proportions of SNPs where the individual matches each possible genotypes.

See Also

plot_genoprobcomp()

Examples

iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
iron <- iron[1,"2"]   # subset to first individual on chr 2
map <- insert_pseudomarkers(iron$gmap, step=1)

# in presence of a genotyping error, how much does error_prob matter?
iron$geno[[1]][1,3] <- 3
pr_e <- calc_genoprob(iron, map, error_prob=0.002)
pr_ne <- calc_genoprob(iron, map, error_prob=1e-15)

compare_genoprob(pr_e, pr_ne, iron, minmarkers=1, minprob=0.5)


qtl2 documentation built on May 29, 2024, 11:46 a.m.