View source: R/lsn.transcripts.plot.R
| lsn.transcripts.plot | R Documentation |
Creates an integrated genomic-region plot combining patient-level genomic lesions with optional transcript annotations, chromosome context, genomic coordinates, lesion-type legends, and gene-level GRIN2 statistics.
The function supports both gene-centered plots and user-defined genomic regions. Single-position lesions, or lesion types explicitly selected by the user, are drawn at their exact genomic coordinates with user-controlled marker size.
lsn.transcripts.plot(
grin.res,
gene = NULL,
chrom = NULL,
plot.start = NULL,
plot.end = NULL,
transTrack = TRUE,
show.ideogram = TRUE,
show.axis = TRUE,
show.transcript.labels = FALSE,
transcript.mode = c("all", "selected"),
selected.transcript = NULL,
lesion.grp = NULL,
lsn.clrs = NULL,
spec.lsn.clr = NULL,
point.lesion.groups = NULL,
point.size.mm = 0.8,
expand = 0.0005,
hg38.transcripts = NULL,
hg38.cytoband = NULL,
genome = "hg38",
transcript.height = 0.31,
draw = TRUE
)
grin.res |
A GRIN2 results object containing at least |
gene |
Optional character scalar specifying the gene to plot. When
supplied, genomic coordinates are obtained from |
chrom |
Chromosome for a user-defined regional plot. Used only when
|
plot.start, plot.end |
Numeric start and end coordinates for a
user-defined regional plot. Both are required when |
transTrack |
Logical; whether to display transcript annotations. |
show.ideogram |
Logical; whether to display a chromosome ideogram. |
show.axis |
Logical; whether to display a genomic-coordinate axis. |
show.transcript.labels |
Logical; whether transcript or gene labels are displayed within the transcript track. |
transcript.mode |
Character string specifying which transcript
annotations to display. Use |
selected.transcript |
Character vector of transcript IDs retained when
|
lesion.grp |
Optional character vector specifying lesion types to plot. |
lsn.clrs |
Optional named character vector assigning colors to lesion
types. Vector names must match the lesion-type values in
|
spec.lsn.clr |
Optional color used when a single lesion type is
selected through |
point.lesion.groups |
Optional character vector specifying lesion types
to display as point markers. When |
point.size.mm |
Positive numeric scalar specifying the diameter, in millimeters, of lesions displayed as circles. The default is 0.8. |
expand |
Non-negative numeric proportion used to expand a gene-centered plotting interval upstream and downstream. It is ignored for user-defined regional plots, which use the supplied coordinates exactly. |
hg38.transcripts |
An |
hg38.cytoband |
Cytoband annotation supplied to
|
genome |
Genome identifier passed to the Gviz annotation tracks. |
transcript.height |
Relative vertical space allocated to the transcript
annotation track. Increasing this value provides additional space when
many transcripts are displayed. This value is used only when
|
draw |
Logical; if |
In gene mode, the displayed interval is derived from the matching entry in
gene.data and can be expanded using expand. In regional mode, the exact
interval specified by chrom, plot.start, and plot.end is used.
Transcript annotations can be shown in full or restricted to selected transcript IDs. Selected IDs are matched after removal of version suffixes. Unmatched IDs are reported in a warning when at least one requested transcript is available; the function stops with an informative error when none of the requested transcripts can be found.
Point-like lesions are plotted at their exact genomic start coordinates and use physical marker sizes measured in millimeters. Lesions are ordered first by lesion type and then by interval size, with source order used to break exact ties.
When transcript annotations are not displayed, the vertical space allocated to the ideogram and genomic-coordinate axis is reduced automatically so that the lesion panel occupies the available plotting area more efficiently.
For gene-centered plots, available lesion-specific subject counts and
transformed p- and q-values are displayed together with ordered
constellation statistics from gene.hits. Missing statistics are omitted
rather than preventing plot construction.
Invisibly returns a gtable/grob object representing the assembled
figure. When draw = TRUE, the figure is also drawn.
grin.stats(), Gviz::GeneRegionTrack(),
Gviz::GenomeAxisTrack(), Gviz::IdeogramTrack(),
ensembldb::getGeneRegionTrackForGviz()
data("grin.results")
data("hg38_cytoband")
# Plot lesions across a user-defined genomic region without transcript
# annotations. This example uses only data included with GRIN2.
lsn.transcripts.plot(
grin.res = grin.results,
chrom = 9,
plot.start = 19900000,
plot.end = 25600000,
transTrack = FALSE,
show.ideogram = FALSE,
lesion.grp = "loss",
spec.lsn.clr = "blue"
)
# Plot all lesion types across a larger genomic region without transcript
# annotations.
lsn.transcripts.plot(
grin.res = grin.results,
chrom = 9,
plot.start = 1,
plot.end = 141000000,
transTrack = FALSE,
show.ideogram = FALSE,
point.size.mm = 1
)
## Not run:
# Transcript-track examples require an EnsDb annotation object retrieved
# through AnnotationHub and therefore require an internet connection.
ah <- AnnotationHub::AnnotationHub()
# Ensembl release 110 transcript annotations for human GRCh38.
hg38.transcripts <- ah[["AH113665"]]
# Define colors for the lesion types in the example dataset.
lesion.colors <- c(
fusion = "black",
gain = "red",
loss = "blue",
mutation = "olivedrab"
)
# Plot all transcripts and genomic lesions affecting JAK3.
lsn.transcripts.plot(
grin.res = grin.results,
gene = "JAK3",
transcript.mode = "all",
lsn.clrs = lesion.colors,
hg38.transcripts = hg38.transcripts,
hg38.cytoband = hg38_cytoband
)
# Display selected JAK1 transcripts and increase point-marker size.
lsn.transcripts.plot(
grin.res = grin.results,
gene = "JAK1",
transcript.mode = "selected",
selected.transcript = c(
"ENST00000342505",
"ENST00000672751"
),
lsn.clrs = lesion.colors,
point.size.mm = 0.7,
transcript.height = 0.40,
hg38.transcripts = hg38.transcripts,
hg38.cytoband = hg38_cytoband
)
# Plot transcript annotations and genomic lesions across a user-defined
# region while displaying gene names in the transcript track.
lsn.transcripts.plot(
grin.res = grin.results,
chrom = 9,
plot.start = 21900000,
plot.end = 21990000,
transcript.mode = "all",
show.transcript.labels = TRUE,
lsn.clrs = lesion.colors,
transcript.height = 0.46,
hg38.transcripts = hg38.transcripts,
hg38.cytoband = hg38_cytoband
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.