Learn R Programming

R453Plus1Toolbox (version 1.22.0)

plotChimericReads: Plots chimeric reads

Description

This function plots a given set of aligned chimeric reads along a reference sequence. It plots the breakpoints of translations or inversions and marks deletions, insertions and mismatches. Optionally, it displays all base pairs in a given region around the breakpoint.

Usage

plotChimericReads(brpData, geneSymbols=FALSE, plotMut=TRUE, plotBasePairs=FALSE, maxBasePairs=50, legend=FALSE, title="", col=c("red", "green", "black", "orange"))

Arguments

brpData
A Breakpoints object containing the consensus breakpoint of all reads and the consensus reference sequence as returned by the methods detectBreakpoints and mergeBreakpoints. Since only one plot is made, the function will only work for objects of class Breakpoints having length one.
geneSymbols
Boolean value whether to automatically load and plot the gene symbols from the Ensembl database. Additionally, geneSymbols can be a vector of two strings for an own annotation.
plotMut
Boolean value whether to mark deletions, insertions and mismatches.
plotBasePairs
Optionally, plotChimericReads displays all base pairs in a given region around the breakpoint (see maxBasePairs).
maxBasePairs
The maximum number of base pairs to be plotted. Only used in conjunction with plotBasePairs=TRUE.
legend
A logical value (TRUE/FALSE) whether to plot a legend that explains the colouration of the insertions, deletions, mismatches and breakpoints.
title
A title for the plot.
col
A vector of four colours to draw insertions, deletions, mismatches and breakpoints. In this order, the default colours are "red", "green", "black" and "orange" (use colours() to see a list of possible values).

Details

This method is intended to be run after the pipeline for structural variant detection. Therefore, see the methods filterChimericReads, detectBreakpoints and mergeBreakpoints to correctly preprocess your alignment before running plotChimericReads.

See Also

Breakpoints-class, detectBreakpoints, mergeBreakpoints

Examples

Run this code
# load breakpoint data containing twelve chimeric reads describing an inversion in chromosome 16
data("breakpoints")
breakpoints

# standard plot 
# (only arrangement of reads plotted; breakpoints in orange, deletions
# in red, insertions in green and mismatches in black by default)
plotChimericReads(breakpoints)

# plot base pairs in the breakpoint region (+/- 32bp) 
## Not run: plotChimericReads(breakpoints, plotBasePairs=TRUE, maxBasePairs=32)

# use custom colours and display a legend:
# deletions="brown", insertions="blue", mismatches="yellow", breakpoints="gray"
plotChimericReads(breakpoints, col=c("brown", "blue", "yellow", "gray"), legend=TRUE)

Run the code above in your browser using DataLab