Description Usage Arguments Details Value Author(s) See Also Examples
Add self-defined graphics track by track
1 2 3 4 5 6 |
gr |
genomic regions. It should be a data frame in BED format or a |
category |
subset of categories (e.g. chromosomes) that users want to add graphics. The value can be a vector which contains more than one category. By default it is all available categories. |
track |
which track the graphics will be added to. By default it is the next track. The value should only be a scalar. |
clip |
whether graphics are restricted inside the cell. |
panel_fun |
self-defined panel function to add graphics in each 'cell'. THe argument |
panel.fun |
deprecated |
use_raster |
whether render the each panel as a raster image. It helps to reduce file size when the file size is huge. |
raster_device |
graphic device which is used to generate the raster image |
raster_quality |
a value set to larger than 1 will improve the quality of the raster image. A temporary image with |
raster_device_param |
a list of further parameters for the selected graphic device |
Initialization of the Trellis layout and adding graphics are two independent steps.
Once the layout initialization finished, each cell will be an independent plotting region.
As same as panel_fun
in circlize-package
, the self-defined function panel_fun
will be applied on every cell in the specified track (by default it is the 'current' track).
When adding graphics in each cell, get_cell_meta_data
can return several meta data for the current cell.
Since this package is implemented by the grid
graphic system, grid
-family functions
(such as grid.points
, grid.rect
, ...) should be used to add graphics. The usage
of grid
functions is quite similar as the traditional graphic functions.
Followings are several examples:
1 2 3 | grid.points(x, y)
grid.lines(x, y)
grid.rect(x, y, width, height)
|
Graphical parameters are usually passed by gpar
:
1 2 |
grid
system also support a large number of coordinate measurement systems by defining proper unit
object
which provides high flexibility to place graphics on the plotting regions.
1 2 | grid.points(x, y, default.units = "npc")
grid.rect(x, y, width = unit(1, "cm"))
|
You can refer to the documentations and vignettes of grid-package
to get a overview.
No value is returned.
Zuguang Gu <z.gu@dkfz.de>
There are several functions which draw specific graphics and are implemented by add_track
:
add_points_track
add_segments_track
add_lines_track
add_rect_track
add_heatmap_track
1 2 | # There is no example
NULL
|
Loading required package: grid
Loading required package: IRanges
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: ‘BiocGenerics’
The following objects are masked from ‘package:parallel’:
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from ‘package:stats’:
IQR, mad, sd, var, xtabs
The following objects are masked from ‘package:base’:
anyDuplicated, append, as.data.frame, basename, cbind, colnames,
dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which.max, which.min
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: ‘S4Vectors’
The following object is masked from ‘package:base’:
expand.grid
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
========================================
gtrellis version 1.22.0
Bioconductor page: http://bioconductor.org/packages/gtrellis/
Github page: https://github.com/jokergoo/gtrellis
Documentation: http://bioconductor.org/packages/gtrellis/
If you use it in published research, please cite:
Gu, Z. gtrellis: an R/Bioconductor package for making genome-level
Trellis graphics. BMC Bioinformatics 2016.
This message can be suppressed by:
suppressPackageStartupMessages(library(gtrellis))
========================================
NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.