Plotting a P(s) distance law

plotPs(x, mapping, xlim = c(5000, 499000), ylim = c(1e-08, 1e-04))

plotPsSlope(x, mapping, xlim = c(5000, 499000), ylim = c(-3, 0))

Arguments

x

the output data.frame of distanceLaw function

mapping

aes to pass on to ggplot2

xlim

xlim

ylim

ylim

Value

ggplot

Examples

## Single P(s)

contacts_yeast <- contacts_yeast()
#> see ?HiContactsData and browseVignettes('HiContactsData') for documentation
#> loading from cache
ps <- distanceLaw(contacts_yeast)
#> pairsFile not specified. The P(s) curve will be an approximation.
plotPs(ps, ggplot2::aes(x = binned_distance, y = norm_p))
#> Warning: Removed 13 rows containing missing values or values outside the scale range
#> (`geom_line()`).


## Comparing several P(s)

contacts_yeast <- contacts_yeast()
#> see ?HiContactsData and browseVignettes('HiContactsData') for documentation
#> loading from cache
contacts_yeast_eco1 <- contacts_yeast_eco1()
#> see ?HiContactsData and browseVignettes('HiContactsData') for documentation
#> loading from cache
ps_wt <- distanceLaw(contacts_yeast)
#> pairsFile not specified. The P(s) curve will be an approximation.
ps_wt$sample <- 'WT'
ps_eco1 <- distanceLaw(contacts_yeast_eco1)
#> pairsFile not specified. The P(s) curve will be an approximation.
ps_eco1$sample <- 'eco1'
ps <- rbind(ps_wt, ps_eco1)
plotPs(ps, ggplot2::aes(x = binned_distance, y = norm_p, group = sample, color = sample))
#> Warning: Removed 26 rows containing missing values or values outside the scale range
#> (`geom_line()`).

plotPsSlope(ps, ggplot2::aes(x = binned_distance, y = slope, group = sample))
#> Warning: Removed 26 rows containing missing values or values outside the scale range
#> (`geom_line()`).