PlotCountDistributions: Plot empirical distributions of read counts

Description Usage Arguments See Also Examples

View source: R/PlotBRD_V3.R

Description

Plot empirical distributions of read counts

Usage

1
2
3
PlotCountDistributions(X, pops = NULL, sampling = NULL, vb = 0,
  names = T, palette = "magma", gradient = "hcl.mono.grey",
  legend = T, inset = c(-0.25, 0), saturation = 0.9, ...)

Arguments

...

optional arguments forwarded to the SideBySide function.

x

a read count matrix, preferably dithered and log2 transformed.

See Also

DitherCounts, ReadCountMatrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Simulation of a read count matrix with 3 populations of 10000 observations
p <- c(10000, 10000, 10000)
m <- DefineSimulation(
  chip = 5, patterns = c("^", "v"), enrichment = c(1.0, 3), replicate = 2
)
r <-  MakeSimulation(p = p, m = m)

grp <- r$group # Population memberships
cnt <- r$data  # Simulated counts

# Prepare figure layout and graphic options
layout(matrix(1:4, 2, 2, byrow = TRUE))
par(pch = 20)

# Show the empirical distribution of simulated populations
l2c <- log2(DitherCounts(cnt)) # Dithering and log2 transformation
xyl <- range(l2c[FiniteValues(l2c), ])

r <- PlotCountDistributions(l2c, ylim = xyl, main = "Total")
for(i in sort(unique(grp))) {
  main <- ifelse(i == 1, "Invariable subset", paste("Variable subset", i - 1))
  r <- PlotCountDistributions(l2c[grp == i, ], ylim = xyl, main = main)
}

benja0x40/Tightrope documentation built on May 24, 2019, 1:35 a.m.