forked from PhanstielLab/plotgardener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb_plotSignal.Rd
79 lines (54 loc) · 4.03 KB
/
bb_plotSignal.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bb_plotSignal.R
\name{bb_plotSignal}
\alias{bb_plotSignal}
\title{Plot any kind of signal track data for a single chromosome}
\usage{
bb_plotSignal(data, chrom)
bb_plotSignal(data, chrom, x, y, width, height,
just = c("left", "top"),
default.units = "inches")
}
\arguments{
\item{data}{Data to be plotted as a character value specifying a bigwig file path, a dataframe in BED format, or a \link[GenomicRanges]{GRanges} object with metadata column \code{counts}.
Either one \code{data} argument or a list of two can be provided, where the second \code{data} will be plotted below the x-axis.}
\item{binSize}{A numeric specifying the length of each data bin in basepairs. Default value is \code{binSize = NA}.}
\item{binCap}{A logical value indicating whether the function will limit the number of data bins to 8,000. Default value is \code{binCap = TRUE}.}
\item{chrom}{Chromosome of region to be plotted, as a string.}
\item{chromstart}{Integer start position on chromosome to be plotted.}
\item{chromend}{Integer end position on chromosome to be plotted.}
\item{assembly}{Default genome assembly as a string or a \link[BentoBox]{bb_assembly} object. Default value is \code{assembly = "hg19"}.}
\item{linecolor}{A character value or vector of length 2 specifying the line color(s) outlining the signal track(s). Default value is \code{linecolor = "grey"}.}
\item{fill}{A character value or vector of length 2 specifying the fill color(s) of the signal track(s).}
\item{ymax}{A numeric specifying the fraction of the max y-value to set as the height of the plot. Default value is \code{ymax = 1}.}
\item{range}{A numeric vector of length 2 specifying the y-range of data to plot (c(min, max)).}
\item{scale}{A logical value indicating whether to include a data scale label in the top left corner of the plot. Default value is \code{scale = FALSE}.}
\item{bg}{Character value indicating background color. Default value is \code{bg = NA}.}
\item{baseline}{Logical value indicating whether to include a baseline along the x-axis. Default value is \code{baseline = FALSE}.}
\item{x}{A numeric or unit object specifying signal plot x-location.}
\item{y}{A numeric or unit object specifying signal plot y-location.}
\item{width}{A numeric or unit object specifying signal plot width.}
\item{height}{A numeric or unit object specifying signal plot height.}
\item{just}{Justification of signal plot relative to its (x, y) location. If there are two values, the first value specifies horizontal justification and the second value specifies vertical justification.
Possible string values are: \code{"left"}, \code{"right"}, \code{"centre"}, \code{"center"}, \code{"bottom"}, and \code{"top"}. Default value is \code{just = c("left", "top")}.}
\item{default.units}{A string indicating the default units to use if \code{x}, \code{y}, \code{width}, or \code{height} are only given as numerics. Default value is \code{default.units = "inches"}.}
\item{draw}{A logical value indicating whether graphics output should be produced. Default value \code{draw = TRUE}.}
\item{params}{An optional \link[BentoBox]{bb_assembly} object containing relevant function parameters.}
\item{...}{Additional grid graphical parameters. See \link[grid]{gpar}.}
}
\value{
Returns a \code{bb_signal} object containing relevant genomic region, placement, and \link[grid]{grob} information.
}
\description{
Plot any kind of signal track data for a single chromosome
}
\examples{
## Load signal data
data("bb_signalData")
## Plot signal plot filling up entire graphic device
bb_plotSignal(data = bb_signalData, chrom = "chr21", chromstart = 28000000, chromend = 30300000, fill = "grey")
## Plot and place signal plot on a BentoBox page
bb_pageCreate(width = 4, height = 3, default.units = "inches", xgrid = 0, ygrid = 0)
bb_plotSignal(data = bb_signalData, chrom = "chr21", chromstart = 28000000, chromend = 30300000, fill = "grey",
x = 0.5, y = 1, width = 3, height = 1, just = c("left", "top"), default.units = "inches")
}