plot-cis: Plotting Functions

Description Usage Arguments Value Examples

Description

The 'plotConfidenceIntervals' is a high-level plotting function for visualizing confidence intervals. The 'plotAbundanceShift' function visualizes the shift in mismatch rates between two samples.

Usage

1
2
3
plotConfidenceIntervals(x, ylim = c(-1.05, 1.05), color = NULL, ...)

plotAbundanceShift(x, ylim = c(-0.05, 1.05), rates = TRUE, ...)

Arguments

x

'GRanges' with mcols of a CI method, or 'data.frame' as returned by one of the CI methods, with the optional column 'start'.

ylim

Limits of the y-axis. Using this instead of using the 'ylim' prevents ugly warnings of 'ggplot2'.

color

Variable that determines the coloring of the confidence axis (character).

rates

Should the non-consensus rates of both samples be visualized as colored end points of the line range? (logical, default: TRUE).

...

Additional plotting arguments that are passed on to ggplot2::geom_pointrange.

Value

For a 'GRanges' input: A 'ggbio' object

For a 'data.frame' input: A 'ggplot' object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Generate sample data
counts = data.frame(x1 = 1:5, n1 = 30, x2 = 0:4, n2 = 30)

## Agresti-Caffo
ci_ac = with(counts, acCi(x1, n1, x2, n2))

library(GenomicRanges)
gr = GRanges("1", IRanges(start = 1:nrow(counts), width = 1))
mcols(gr) = ci_ac

## GRanges
plotConfidenceIntervals(gr)

## data.frame
plotConfidenceIntervals(ci_ac)

## abundance shift
plotAbundanceShift(gr)

plotAbundanceShift(ci_ac)

julian-gehring/Rariant documentation built on May 20, 2019, 4:20 a.m.