forked from PhanstielLab/plotgardener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb_plotTranscripts.Rd
91 lines (67 loc) · 4.87 KB
/
bb_plotTranscripts.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
82
83
84
85
86
87
88
89
90
91
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bb_plotTranscripts.R
\name{bb_plotTranscripts}
\alias{bb_plotTranscripts}
\title{Plot gene transcripts in a pileup style for a single chromosome}
\usage{
bb_plotTranscripts(chrom)
bb_plotTranscripts(chrom, x, y, width, height,
just = c("left", "top"),
default.units = "inches")
}
\arguments{
\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{fill}{Character value(s) as a single value or vector specifying fill colors of transcripts. Default value is \code{fill = c("#8a8aff", "#ff7e7e")}.}
\item{colorbyStrand}{A logical value indicating whether to color plus and minus strands by the first two colors in a \code{fill} vector, where plus strand transcripts will be colored by the first \code{fill} color and
minus strand transcripts will be colored by the second \code{fill} color. Default value is \code{colorbyStrand = TRUE}.}
\item{strandSplit}{A logical value indicating whether plus and minus-stranded transcripts should be separated, with plus strand transcripts plotted above the x-axis and minus strand transcripts plotted below the x-axis. Default value is \code{strandSplit = FALSE}.}
\item{boxHeight}{A numeric or unit object specifying height of transcripts. Default value is \code{boxHeight = unit(2, "mm")}.}
\item{spaceWidth}{A numeric value specifying the width of minimum spacing between transcripts, as a fraction of the plot's genomic range. Default value is \code{spaceWidth = 0.02}.}
\item{spaceHeight}{A numeric value specifying the height of spacing between transcripts on different rows, as a fraction of \code{boxHeight}. Default value is \code{spaceHeight = 0.3}.}
\item{fontsize}{A numeric specifying text fontsize in points. Default value is \code{fontsize = 8}.}
\item{labels}{A character value describing the format of transcript text labels. Default value is \code{labels = "trancript"}. Options are:
\itemize{
\item{\code{NULL}: }{No labels.}
\item{\code{"transcript"}: }{Transcript name labels.}
\item{\code{"gene"}: }{Gene name labels.}
\item{\code{"both"}: }{Combined transcript and gene name labels with the format "gene name:transcript name".}
}}
\item{stroke}{A numeric value indicating the stroke width for transcript body outlines. Default value is \code{stroke = 0.1}.}
\item{bg}{Character value indicating background color. Default value is \code{bg = NA}.}
\item{x}{A numeric or unit object specifying transcript plot x-location.}
\item{y}{A numeric or unit object specifying transcript plot y-location.}
\item{width}{A numeric or unit object specifying transcript plot width.}
\item{height}{A numeric or unit object specifying transcript plot height.}
\item{just}{Justification of transcript 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_transcripts} object containing relevant genomic region, placement, and \link[grid]{grob} information.
}
\description{
Plot gene transcripts in a pileup style for a single chromosome
}
\details{
Genomic annotation information is acquired through \link[GenomicFeatures]{TxDb} and \link[AnnotationDb]{OrgDb-class} packages, as determined
through the \code{assembly} parameter.
}
\examples{
## Load hg19 genomic annotation packages
library("TxDb.Hsapiens.UCSC.hg19.knownGene")
library("org.Hs.eg.db")
## Plot transcripts filling up entire graphic device
bb_plotTranscripts(chrom = "chr8", chromstart = 1000000, chromend = 2000000, assembly = "hg19")
## Plot and place transcripts on a BentoBox page
bb_pageCreate(width = 4, height = 4, default.units = "inches", xgrid = 0, ygrid = 0)
bb_plotTranscripts(chrom = "chr8", chromstart = 1000000, chromend = 2000000, assembly = "hg19", labels = "gene",
x = 0.5, y = 0.5, width = 3, height = 2.5, just = c("left", "top"), default.units = "inches")
}
\seealso{
\link[BentoBox]{bb_assembly}, \link[BentoBox]{bb_genomes}, \link[BentoBox]{bb_defaultPackages}
}