gene2gg | R Documentation |
Gene GRangesList to ggplot2 grob
gene2gg(
gene = NULL,
tx = NULL,
flatExonsByGene = NULL,
flatExonsByTx = NULL,
geneColor = "dodgerblue",
labelExons = TRUE,
exonLabelAngle = 90,
exonLabelSize = 8,
geneSymbolColname = "gene_name",
newValues = list(feature_type = "gap", subclass = "gap", gene_nameExon = "gap"),
gene_order = c("first", "last"),
return_type = c("grob", "df"),
ref2c = NULL,
hjust = 0.5,
vjust = 0.5,
direction = c("both", "x", "y"),
compressGaps = TRUE,
tx2geneDF = NULL,
label_coords = NULL,
verbose = FALSE,
...
)
gene |
|
tx |
|
flatExonsByGene , flatExonsByTx |
|
geneColor |
|
labelExons |
|
exonLabelAngle |
|
exonLabelSize |
|
newValues |
argument passed to |
gene_order |
|
return_type |
|
ref2c |
|
hjust , vjust |
|
direction |
|
compressGaps |
|
tx2geneDF |
|
label_coords |
|
verbose |
|
... |
additional arguments are passed to relevant functions
as needed, including |
This function is intended to help plot gene and transcript exon
models, and is a lightweight wrapper around grl2df()
.
It takes flatExonsByGene
which is the output from
flattenExonsBy()
, and essentially plots the end result
for review.
Alternatively, when return_type="df"
, the output is
the data.frame
used to produce the ggplot, which allows
for more customization.
Other jam plot functions:
bgaPlotly3d()
,
factor2label()
,
grl2df()
,
jitter_norm()
,
plotSashimi()
,
prepareSashimi()
,
stackJunctions()
Other jam ggplot2 functions:
geom_diagonal_wide_arc()
,
plotSashimi()
,
splicejam-extensions
,
to_basic.GeomShape()
Other splicejam core functions:
exoncov2polygon()
,
grl2df()
,
make_ref2compressed()
,
plotSashimi()
,
prepareSashimi()
## Assume we start with flattened gene exons
data(test_exon_wide_gr);
test_flatExonsByGene <- GenomicRanges::split(test_exon_wide_gr,
GenomicRanges::values(test_exon_wide_gr)[,"gene_name"]);
# The most basic plot of exons
gene2gg(gene="TestGene1", flatExonsByGene=test_flatExonsByGene);
# You can be fancy and number the exons
test_flatExonsByGene <- assignGRLexonNames(test_flatExonsByGene,
geneSymbolColname="gene_name");
gene2gg(gene="TestGene1", flatExonsByGene=test_flatExonsByGene);
# Or the exon labels can be hidden
gene2gg(gene="TestGene1", flatExonsByGene=test_flatExonsByGene, labelExons=FALSE)
if (1 == 2) {
## Do not run automated examples until sample data is available
ggGria1 <- gene2gg("Gria1",
flatExonsByGene=flatExonsByGeneCds);
## if transcript exons are available
ggGria1 <- gene2gg("Gria1",
flatExonsByGene=flatExonsByGene,
flatExonsByTx=flatExonsByTx);
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.