Description Usage Arguments Details Value Examples
View source: R/plot_fusion_transcript.R
This function takes a fusion object and an ensembldb object and plots the reduced version of the fusion transcript. This transcript consist of the "mashed together" version of all possible fusion transcripts based on known annotations. If a bamfile is specified, the fusion transcript will be plotted with coverage information.
1 2 3 4 5 6 7 | plot_fusion_transcript(
fusion,
edb = NULL,
bamfile = NULL,
which_transcripts = "exonBoundary",
bedgraphfile = NULL
)
|
fusion |
The Fusion object to plot. |
edb |
The edb object that will be used to fetch data. |
bamfile |
The bamfile with RNA-seq data. |
which_transcripts |
This character vector decides which transcripts are to be plotted. Can be "exonBoundary", "withinExon", "withinIntron", "intergenic", or a character vector with specific transcript ids. Default value is "exonBoundary". |
bedgraphfile |
A bedGraph file to use instead of the bamfile to plot coverage. |
Note that the transcript database used (the edb object) must have the same seqnames as any bamfile used. Otherwise the coverage data will be wrong.
Creates a fusion transcript plot.
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 | # Load data and example fusion event
defuse833ke <- system.file(
"extdata",
"defuse_833ke_results.filtered.tsv",
package="chimeraviz")
fusions <- import_defuse(defuse833ke, "hg19", 1)
fusion <- get_fusion_by_id(fusions, 5267)
# Load edb
edbSqliteFile <- system.file(
"extdata",
"Homo_sapiens.GRCh37.74.sqlite",
package="chimeraviz")
edb <- ensembldb::EnsDb(edbSqliteFile)
# bamfile with reads in the regions of this fusion event
bamfile5267 <- system.file(
"extdata",
"fusion5267and11759reads.bam",
package="chimeraviz")
# Temporary file to store the plot
pngFilename <- tempfile(
pattern = "fusionPlot",
fileext = ".png",
tmpdir = tempdir())
# Open device
png(pngFilename, width = 500, height = 500)
# Plot!
plot_fusion_transcript(
fusion = fusion,
bamfile = bamfile5267,
edb = edb)
# Close device
dev.off()
# Example using a .bedGraph file instead of a .bam file:
# Load data and example fusion event
defuse833ke <- system.file(
"extdata",
"defuse_833ke_results.filtered.tsv",
package="chimeraviz")
fusions <- import_defuse(defuse833ke, "hg19", 1)
fusion <- get_fusion_by_id(fusions, 5267)
# Load edb
edbSqliteFile <- system.file(
"extdata",
"Homo_sapiens.GRCh37.74.sqlite",
package="chimeraviz")
edb <- ensembldb::EnsDb(edbSqliteFile)
# bedgraphfile with coverage data from the regions of this fusion event
bedgraphfile <- system.file(
"extdata",
"fusion5267and11759reads.bedGraph",
package="chimeraviz")
# Temporary file to store the plot
pngFilename <- tempfile(
pattern = "fusionPlot",
fileext = ".png",
tmpdir = tempdir())
# Open device
png(pngFilename, width = 500, height = 500)
# Plot!
plot_fusion_transcript(
fusion = fusion,
bamfile = bamfile5267,
edb = edb)
# Close device
dev.off()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.