View source: R/methods_visualise.R
| visualise | R Documentation |
Plot the results of discovery objects. By default
contrasts one sample with the others.
visualise(discovery, ...)
## Default S3 method:
visualise(
discovery,
contrast,
raw,
title,
colour_lim,
colour_lim_contrast,
...
)
discovery |
A |
... |
Further arguments specific to the discovery class. See the section extended arguments below. |
contrast |
An |
raw |
A |
title |
add a title |
colour_lim, colour_lim_contrast |
Indication of limits for the primary and secondary continuous colour scales respectively. One of:
|
The "diff" metric value creates contrast panels by
subtracting the values of each sample by the values of the sample indicated
by the 'contrast' argument. The "lfc" metric value
creates contrast panels by dividing every samples' values by the sample
indicated by the 'contrast' argument and then taking the base 2
logarithm of that division.
The 'raw = TRUE' argument allows custimisation of the plots. The
returned plot will not have position- or fill-scales and no theme settings,
which can be set freely afterwards to match personal aesthetic tastes. When
'raw = TRUE' and 'subtract' is not NULL, the fill
scale of the contrast panels can be manipulated by setting the
'aesthetics = "altfill"' inside ggplot2's fill scale functions.
metricA character of length one: "diff" for
difference by subtraction or "lfc" for
log2 fold changes.
colour_lim, colour_lim_contrastIndication of limits for the primary and secondary colour scale respectively. One of:
NULL to have an educated quess for the scale.
A numeric vector of length two providing the limits of the
scale. Use NA to refer to existing minima or maxima.
A function that accepts the existing (automatic) limits and
returns new limits.
modeA character of length one indicating what type of
result to plot. Either "signal" or "obsexp", referring to the
slot in the discovery object. Applicatble to PE-SCAn, C-SCAn and ARA.
show_single_contrastA logical of length 1;
if FALSE (default), does not show contrasts when discovery
describes one experiment. If TRUE, plots empty panel.
chrA character of length one with the chromosome
name. Defaults to "chr1".
start, endAn integer of length one setting the
start or end of the region to plot. If NULL (default), is set to
-Inf and Inf respectively
metricA character of length one. The choices are:
"smooth"A log10-smoothed line (default)
"both"Like "smooth", but also adds the raw binned
distances as points.
"lfc"Displays
log2 fold change compared to
the sample specified in the contrast argument.
flipFacetA logical of length one. If the
bedlist argument was provided to RCP(), combine all regions
in one panel? Defaults to FALSE.
binsAn integer of length 1 with the number of bins to
aggregate signal in. If NULL (the default), this is set to the
number of Hi-C bins in the viewpoint's chromosome.
bedlistEither a BED-formatted data.frame or a
list thereof, indicating genomic intervals to annotate in the bottom
margin of the plot.
extend_viewpointAn integer of length one in basepairs
indicating by how much to widen the viewpoint censor-box. Affects the
scaling of the y-axis.
chrA character of length one with the chromosome
name. Defaults to "all".
show_single_contrastA logical of length 1;
if FALSE (default), does not show contrasts when discovery
describes one experiment. If TRUE, plots empty panel.
geomOne of the following length one characters:
"boxplot"Display as boxplots.
"violin"Display as violin plots.
"jitter"Display as jittered points plot.
censor_contrastA logical of length 1 deciding whether
the contrasting experiment itself should be censored (TRUE) or
included (FALSE).
For ATA_discovery objects which include the matrix's diagonal,
the upper limit for the contacts fill scale is set to the 95th percentile
of the data to increase the dynamic range of colours. The same is true for
ARA_discovery, when 'mode = "signal"'.
## Not run:
# APA
apa <- APA(list(WT = WT_40kb, KO = KO_40kb), loops)
visualise(apa)
# PE-SCAn
pescan <- PESCAn(list(WT = WT_40kb, KO = KO_40kb), super_enhancers)
visualise(pescan)
# To plot PE-SCAn without background correction
visualise(pescan, mode = "signal")
# ATA
ata <- APA(list(WT = WT_10kb, KO = KO_10kb), tads)
visualise(ata)
# ARA
ara <- ARA(list(WT = WT_20kb, KO = KO_20kb), ctcf_sites)
visualise(ara)
# Compartment score
cs <- compartment_score(list(WT = WT_100kb, KO = KO_100kb), H3K4me1_peaks)
visualise(cs, chr = "chr1")
# Saddle function
sadl <- saddle(list(WT = WT_100kb, KO = KO_100kb), cs) # see example above
visualise(sadl)
# Handling 'raw' plots
visualise(pescan, raw = TRUE) +
ggplot2::scale_fill_gradient(aesthetics = "altfill")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.