View source: R/compare_genoprob.R
compare_genoprob | R Documentation |
Compare two sets of genotype probabilities for one individual on a single chromosome.
compare_genoprob(
probs1,
probs2,
cross,
ind = 1,
chr = NULL,
minprob = 0.95,
minmarkers = 10,
minwidth = 0,
annotate = FALSE
)
probs1 |
Genotype probabilities (as produced by |
probs2 |
A second set of genotype probabilities, just like |
cross |
Object of class |
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 |
minmarkers |
Minimum number of markers in results. |
minwidth |
Minimum width in results. |
annotate |
If TRUE, add some annotations to the |
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.
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.
plot_genoprobcomp()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.