pgParams | R Documentation |
Creates an object of class "pgParams" that can be used by plotgardener functions. pgParams can be used to set a set of parameters to be shared across multiple functions.
pgParams(assembly = "hg38", gene = NULL, geneBuffer = NULL, ...)
assembly |
String defining the genome build.
Default value is |
gene |
(optional) String naming a gene used to set the chrom, chromstart, and chromend arguments. |
geneBuffer |
(optional) Integer base-pairs to extend the
start and end of a gene defined by argument |
... |
This function will take any plotgardener function parameters and their values:
|
pgParams generates arguments from exported plotgardener functions at
loading time of the package. Arguments defined in a pgParams object
can be passed into the params
argument of plotgardener functions.
params arguments can be overridden from within plotgardener functions.
pgParams also provides an alternative region definition mechanism.
Given a gene name and genome assembly, pgParams returns the appropriate
"chrom", "chromstart", and "chromend" with a default buffer of
(gene length) / 2
added to the ends of the gene coordinates.
The buffer amount can be set manually with the geneBuffer
parameter. Buffer extending beyond the length of the chromosome
will be trimmed.
Returns an object of class pgParams
containing plotgardener function arguments.
## Load hg19 genomic annotation packages
library("TxDb.Hsapiens.UCSC.hg19.knownGene")
library("org.Hs.eg.db")
## Define parameters
p1 <- pgParams(gene = "IL1B", assembly = "hg19")
## Optionally add more parameters
p2 <- pgParams(fontsize = 10, assembly = "hg19")
## Combine parameters and pass them to a plotgardener function
plotGenes(params = c(p1, p2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.