plotProbabilities: Plot genetic composition across the genome

Description Usage Arguments Details Value Examples

View source: R/plotProbabilities.R

Description

Plot genetic composition across the genome

Usage

1
plotProbabilities(inputObject, positions, alleles, chromosomes)

Arguments

inputObject

An object of class mpcrossMapped containing IBD genotype probabilities

positions

The genetic positions at which to plot the composition

alleles

The founder alleles which we are interested in.

chromosomes

The chromosomes of to plot the composition.

Details

Plot genetic composition of a population, across the genome. Composition is determined by using the IBD genotype probabilities, as computed by computeGenotypeProbabilities. The plot is produced by taking the average IBD genotype probability, for each founder allele and each genotpe position. Deviations from the expected proprotions (determined by the experimental design) may indicate non-standard genetic inheritance or selective pressure.

Value

A ggplot object, suitable for display.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(simulatedFourParentData)
part1 <- subset(simulatedFourParentData, lines = 
	names(which(finals(simulatedFourParentData)[, 50] == 1)))
part2 <- subset(simulatedFourParentData, lines = 
	names(which(finals(simulatedFourParentData)[, 50] != 1)))
distorted <- subset(part1, lines = sample(nLines(part1), 100)) + part2
distortedMapped <- mpcrossMapped(distorted, map = simulatedFourParentMap)
probabilities <- computeGenotypeProbabilities(distortedMapped)
#Here the composition of the population reflects the fact that we have less of founder 1 than 
#    expected, at a specific point on the genome
plotProbabilities(probabilities)
#Go back to the undistorted data
undistortedMapped <- mpcrossMapped(simulatedFourParentData, map = simulatedFourParentMap)
probabilities <- computeGenotypeProbabilities(distortedMapped)
#Here the composition of the population reflects the expected inheritance; the trace 
#    corresponding to every founder is flat
plotProbabilities(probabilities)

mpMap2 documentation built on Sept. 13, 2020, 5:17 p.m.