Description Usage Arguments Details Value Examples
View source: R/plot_fusion_transcript_with_protein_domain.R
This function takes a fusion object, an ensembldb object, a bedfile with protein domain data and two specific transcript ids. The function plots the specific fusion transcript along with annotations of protein domains. If a bamfile is specified, the fusion transcript will be plotted with coverage information.
1 2 3 4 5 6 7 8 9 | plot_fusion_transcript_with_protein_domain(
fusion,
edb = NULL,
bamfile = NULL,
bedfile = NULL,
gene_upstream_transcript = "",
gene_downstream_transcript = "",
plot_downstream_protein_domains_if_fusion_is_out_of_frame = FALSE
)
|
fusion |
The Fusion object to plot. |
edb |
The edb object that will be used to fetch data. |
bamfile |
The bamfile with RNA-seq data. |
bedfile |
The bedfile with protein domain data. |
gene_upstream_transcript |
The transcript id for the upstream gene. |
gene_downstream_transcript |
The transcript id for the downstream gene. |
plot_downstream_protein_domains_if_fusion_is_out_of_frame |
Setting this to true makes the function plot protein domains in the downstream gene even though the fusion is out of frame. |
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 with annotations of protein domains.
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 | # 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)
# Select transcripts
gene_upstream_transcript <- "ENST00000434290"
gene_downstream_transcript <- "ENST00000370031"
# 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")
# bedfile with protein domains for the transcripts in this example
bedfile <- system.file(
"extdata",
"protein_domains_5267.bed",
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_with_protein_domain(
fusion = fusion,
edb = edb,
bamfile = bamfile5267,
bedfile = bedfile,
gene_upstream_transcript = gene_upstream_transcript,
gene_downstream_transcript = gene_downstream_transcript,
plot_downstream_protein_domains_if_fusion_is_out_of_frame = TRUE)
# Close device
dev.off()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.