forked from PhanstielLab/plotgardener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb_plotHicTriangle.Rd
81 lines (61 loc) · 4.01 KB
/
bb_plotHicTriangle.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
80
81
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bb_plotHicTriangle.R
\name{bb_plotHicTriangle}
\alias{bb_plotHicTriangle}
\title{Plot a Hi-C interaction matrix in a triangular format}
\usage{
bb_plotHicTriangle(hicData, chrom)
bb_plotHicTriangle(hicData, chrom, x, y, width, height,
just = c("left", "top"),
default.units = "inches")
}
\arguments{
\item{hicData}{Path to .hic file as a string or a 3-column dataframe of interaction counts in sparse upper triangular format.}
\item{resolution}{A numeric specifying the width in basepairs of each pixel. For hic files, "auto" will attempt to choose a resolution based on the size of the region. For
dataframes, "auto" will attempt to detect the resolution the dataframe contains.}
\item{zrange}{A numeric vector of length 2 specifying the range of interaction scores to plot, where extreme values will be set to the max or min.}
\item{norm}{Character value specifying hic data normalization method, if giving .hic file. This value must be found in the .hic file. Default value is \code{norm = "KR"}.}
\item{matrix}{Character value indicating the type of matrix to output. Default value is \code{matrix = "observed"}. Options are:
\itemize{
\item{\code{"observed"}: }{Observed counts.}
\item{\code{"oe"}: }{Observed/expected counts.}
}}
\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{palette}{A function describing the color palette to use for representing scale of interaction scores. Default value is \code{palette = colorRampPalette(c("white", "dark red"))}.}
\item{x}{A numeric or unit object specifying triangle Hi-C plot x-location.}
\item{y}{A numeric or unit object specifying triangle Hi-C plot y-location.}
\item{width}{A numeric or unit object specifying the bottom width of the Hi-C plot triangle.}
\item{height}{A numeric or unit object specifying the height of the Hi-C plot triangle.}
\item{just}{Justification of triangle Hi-C 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 is \code{draw = TRUE}.}
\item{params}{An optional \link[BentoBox]{bb_assembly} object containing relevant function parameters.}
}
\value{
Returns a \code{bb_hicTriangle} object containing relevant genomic region, Hi-C data, placement, and \link[grid]{grob} information.
}
\description{
Plot a Hi-C interaction matrix in a triangular format
}
\details{
If \code{height} is \eqn{<} \eqn{0.5 * sqrt(2)}, the top of the triangle will be cropped to the given \code{height}.
}
\examples{
## Load Hi-C data
data("bb_hicData")
## Plot triangle Hi-C plot filling up entire graphic device
bb_plotHicTriangle(hicData = bb_hicData, resolution = 10000, zrange = c(0, 70),
chrom = "chr21", chromstart = 28000000, chromend = 30300000)
## Plot and place triangle Hi-C plot on a BentoBox page
bb_pageCreate(width = 4, height = 2.5, default.units = "inches", xgrid = 0, ygrid = 0)
bb_plotHicTriangle(hicData = bb_hicData, resolution = 10000, zrange = c(0, 70),
chrom = "chr21", chromstart = 28000000, chromend = 30300000,
x = 2, y = 0.5, width = 3, height = 1.5, just = "top", default.units = "inches")
}
\seealso{
\link[BentoBox]{bb_readHic}
}