Title: | Interactive Circular Visualization of Genomic Data using 'htmlwidgets' and 'BioCircos.js' |
---|---|
Description: | Implement in 'R' interactive Circos-like visualizations of genomic data, to map information such as genetic variants, genomic fusions and aberrations to a circular genome, as proposed by the 'JavaScript' library 'BioCircos.js', based on the 'JQuery' and 'D3' technologies. The output is by default displayed in stand-alone HTML documents or in the 'RStudio' viewer pane. Moreover it can be integrated in 'R Markdown' documents and 'Shiny' applications. |
Authors: | Loan Vulliard [trl, cre], Xiaowei Chen [aut], Ya Cui [aut] |
Maintainer: | Loan Vulliard <[email protected]> |
License: | GPL-2 | file LICENSE |
Version: | 0.3.4 |
Built: | 2025-01-27 04:25:27 UTC |
Source: | https://github.com/lvulliard/biocircos.r |
Interactive circular visualization of genomic data using ‘htmlwidgets’ and ‘BioCircos.js’
BioCircos(tracklist = BioCircosTracklist(), genome = "hg19", yChr = TRUE, genomeFillColor = "Spectral", chrPad = 0.04, displayGenomeBorder = TRUE, genomeBorderColor = "#000", genomeBorderSize = 0.5, genomeTicksDisplay = TRUE, genomeTicksLen = 5, genomeTicksColor = "#000", genomeTicksTextSize = "0.6em", genomeTicksTextColor = "#000", genomeTicksScale = 3e+07, genomeLabelDisplay = TRUE, genomeLabelTextSize = "10pt", genomeLabelTextColor = "#000", genomeLabelDx = 0.028, genomeLabelDy = "-0.55em", zoom = TRUE, TEXTModuleDragEvent = FALSE, SNPMouseOverDisplay = TRUE, SNPMouseOverColor = "#FF0000", SNPMouseOverCircleSize = 3, SNPMouseOverCircleOpacity = 0.9, SNPMouseOutDisplay = TRUE, SNPMouseOutColor = "none", SNPMouseOverTooltipsHtml01 = "Chromosome: ", SNPMouseOverTooltipsHtml02 = "<br/>Position: ", SNPMouseOverTooltipsHtml03 = "<br/>Value: ", SNPMouseOverTooltipsHtml04 = "<br/>", SNPMouseOverTooltipsHtml05 = "", SNPMouseOverTooltipsBorderWidth = "1px", ARCMouseOverDisplay = TRUE, ARCMouseOverColor = "#FF0000", ARCMouseOverArcOpacity = 0.9, ARCMouseOutDisplay = TRUE, ARCMouseOutColor = "none", ARCMouseOverTooltipsHtml01 = "Chromosome: ", ARCMouseOverTooltipsHtml02 = "<br/>Start: ", ARCMouseOverTooltipsHtml03 = "<br/>End: ", ARCMouseOverTooltipsHtml04 = "<br/>", ARCMouseOverTooltipsHtml05 = "", ARCMouseOverTooltipsBorderWidth = "1px", LINKMouseOverDisplay = TRUE, LINKMouseOverStrokeColor = "#FF00FF", LINKMouseOverOpacity = 0.9, LINKMouseOutDisplay = TRUE, LINKMouseOutStrokeColor = "none", LINKMouseOverTooltipsHtml01 = "Fusion: ", LINKMouseOverTooltipsHtml02 = "", LINKMouseOverTooltipsBorderWidth = "1px", LINKMouseOverStrokeWidth = 5, LINKMouseOutStrokeWidth = "none", width = NULL, height = NULL, elementId = NULL, ...)
BioCircos(tracklist = BioCircosTracklist(), genome = "hg19", yChr = TRUE, genomeFillColor = "Spectral", chrPad = 0.04, displayGenomeBorder = TRUE, genomeBorderColor = "#000", genomeBorderSize = 0.5, genomeTicksDisplay = TRUE, genomeTicksLen = 5, genomeTicksColor = "#000", genomeTicksTextSize = "0.6em", genomeTicksTextColor = "#000", genomeTicksScale = 3e+07, genomeLabelDisplay = TRUE, genomeLabelTextSize = "10pt", genomeLabelTextColor = "#000", genomeLabelDx = 0.028, genomeLabelDy = "-0.55em", zoom = TRUE, TEXTModuleDragEvent = FALSE, SNPMouseOverDisplay = TRUE, SNPMouseOverColor = "#FF0000", SNPMouseOverCircleSize = 3, SNPMouseOverCircleOpacity = 0.9, SNPMouseOutDisplay = TRUE, SNPMouseOutColor = "none", SNPMouseOverTooltipsHtml01 = "Chromosome: ", SNPMouseOverTooltipsHtml02 = "<br/>Position: ", SNPMouseOverTooltipsHtml03 = "<br/>Value: ", SNPMouseOverTooltipsHtml04 = "<br/>", SNPMouseOverTooltipsHtml05 = "", SNPMouseOverTooltipsBorderWidth = "1px", ARCMouseOverDisplay = TRUE, ARCMouseOverColor = "#FF0000", ARCMouseOverArcOpacity = 0.9, ARCMouseOutDisplay = TRUE, ARCMouseOutColor = "none", ARCMouseOverTooltipsHtml01 = "Chromosome: ", ARCMouseOverTooltipsHtml02 = "<br/>Start: ", ARCMouseOverTooltipsHtml03 = "<br/>End: ", ARCMouseOverTooltipsHtml04 = "<br/>", ARCMouseOverTooltipsHtml05 = "", ARCMouseOverTooltipsBorderWidth = "1px", LINKMouseOverDisplay = TRUE, LINKMouseOverStrokeColor = "#FF00FF", LINKMouseOverOpacity = 0.9, LINKMouseOutDisplay = TRUE, LINKMouseOutStrokeColor = "none", LINKMouseOverTooltipsHtml01 = "Fusion: ", LINKMouseOverTooltipsHtml02 = "", LINKMouseOverTooltipsBorderWidth = "1px", LINKMouseOverStrokeWidth = 5, LINKMouseOutStrokeWidth = "none", width = NULL, height = NULL, elementId = NULL, ...)
tracklist |
A list of tracks to display. |
genome |
A list of chromosome lengths to be used as reference for the visualization or 'hg19' to use the chromosomes 1 to 22 and the sexual chromosomes according to the hg19 reference. |
yChr |
A logical stating if the Y chromosome should be displayed. Used only when genome is set to 'hg19'. |
genomeFillColor |
The color to display in each chromosome. Can be a RColorBrewer palette name used to generate one color per chromosome, or a character object or vector of character objects stating RGB values in hexadecimal format or base R colors. If the vector is shorter than the reference genome, values will be repeated. |
chrPad |
Distance between chromosomes. |
displayGenomeBorder , genomeBorderColor , genomeBorderSize
|
Should the reference genome have borders? If yes specify the color, in RGB hexadecimal format, and the thickness. |
genomeTicksDisplay , genomeTicksLen , genomeTicksColor , genomeTicksTextSize , genomeTicksTextColor , genomeTicksScale
|
Should the refence genome have ticks, of which length, color (in hexadecimal RGB format), with labels in which font size and color, and spaced by how many bases? |
genomeLabelDisplay , genomeLabelTextSize , genomeLabelTextColor , genomeLabelDx , genomeLabelDy
|
Should the reference genome have labels on each chromosome, in which font size and color? Moreover rotation and radius shifts for the label texts can be adde |
zoom |
Is zooming and moving in the visualization allowed? |
TEXTModuleDragEvent |
Are text annotations draggable? |
SNPMouseOverDisplay |
Display the tooltip when mouse hover on a SNP point. |
SNPMouseOverColor |
Color of the SNP point when hovered by the mouse, in hexadecimal RGB format. |
SNPMouseOverCircleSize |
Size of the SNP point when hovered by the mouse. |
SNPMouseOverCircleOpacity |
Opacity of the SNP point when hovered by the mouse. |
SNPMouseOutDisplay |
Hide tooltip when mouse is not hovering a SNP point anymore. |
SNPMouseOutColor |
Color of the SNP point when mouse is not hovering a SNP point anymore, in hexadecimal RGB format. To revert back to original color, use the value "none". |
SNPMouseOverTooltipsHtml01 |
Label displayed in tooltip in first position, before chromosome number. |
SNPMouseOverTooltipsHtml02 |
Label displayed in tooltip in second position, before genomic position. |
SNPMouseOverTooltipsHtml03 |
Label displayed in tooltip in third position, before value. |
SNPMouseOverTooltipsHtml04 |
Label displayed in tooltip in fourth position, before SNP labels if any. |
SNPMouseOverTooltipsHtml05 |
Label displayed in tooltip in fifth position, after SNP labels if any. |
SNPMouseOverTooltipsBorderWidth |
The thickness of the tooltip borders, with units specified (such as em or px). |
ARCMouseOverDisplay |
Display the tooltip when mouse hover on an arc. |
ARCMouseOverColor |
Color of the arc when hovered by the mouse, in hexadecimal RGB format. |
ARCMouseOverArcOpacity |
Opacity of the arc when hovered by the mouse. |
ARCMouseOutDisplay |
Hide tooltip when mouse is not hovering an arc anymore. |
ARCMouseOutColor |
Color of the arc when mouse is not hovering an arc anymore, in hexadecimal RGB format. To revert back to original color, use the value "none". |
ARCMouseOverTooltipsHtml01 |
Label displayed in tooltip in first position, before chromosome number. |
ARCMouseOverTooltipsHtml02 |
Label displayed in tooltip in second position, before genomic position. |
ARCMouseOverTooltipsHtml03 |
Label displayed in tooltip in third position, before value. |
ARCMouseOverTooltipsHtml04 |
Label displayed in tooltip in fourth position, before ARC labels if any. |
ARCMouseOverTooltipsHtml05 |
Label displayed in tooltip in fifth position, after ARC labels if any. |
ARCMouseOverTooltipsBorderWidth |
The thickness of the tooltip borders, with units specified (such as em or px). |
LINKMouseOverDisplay |
Display the tooltip when mouse hover on a link. |
LINKMouseOverStrokeColor |
Color of the link when hovered. |
LINKMouseOverOpacity |
Opacity of the link when hovered. |
LINKMouseOutDisplay |
Hide tooltip when mouse is not hovering a link anymore. |
LINKMouseOutStrokeColor |
Color of the link when mouse is not hovering anymore, in hexadecimal RGB format. To revert back to original color, use the value "none". |
LINKMouseOverTooltipsHtml01 |
Label displayed in tooltip in first position, before label. |
LINKMouseOverTooltipsHtml02 |
Label displayed in tooltip in second position, after label. |
LINKMouseOverTooltipsBorderWidth |
The thickness of the tooltip borders, with units specified (such as em or px). |
LINKMouseOverStrokeWidth |
Thickness of the link when hovered. |
LINKMouseOutStrokeWidth |
Thickness of the link when mouse is not hovering a link anymore. |
width , height
|
Must be a valid CSS unit (like |
elementId |
the name of the HTML id to be used to contain the visualization. |
... |
Ignored |
BioCircos(yChr = FALSE, chrPad = 0, genomeFillColor = "Blues")
BioCircos(yChr = FALSE, chrPad = 0, genomeFillColor = "Blues")
Output and render functions for using BioCircos within Shiny applications and interactive Rmd documents.
BioCircosOutput(outputId, width = "100%", height = "400px") renderBioCircos(expr, env = parent.frame(), quoted = FALSE)
BioCircosOutput(outputId, width = "100%", height = "400px") renderBioCircos(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a BioCircos |
env |
The environment in which to evaluate |
quoted |
Is |
Arcs are defined by beginning and ending genomic coordinates
BioCircosArcTrack(trackname, chromosomes, starts, ends, colors = "#40B9D4", labels = "", maxRadius = 0.9, minRadius = 0.5, ...)
BioCircosArcTrack(trackname, chromosomes, starts, ends, colors = "#40B9D4", labels = "", maxRadius = 0.9, minRadius = 0.5, ...)
trackname |
The name of the new track. |
chromosomes |
A vector containing the chromosomes on which each arcs are found. Values should match the chromosome names given in the genome parameter of the BioCircos function. |
starts , ends
|
Vectors containing the coordinates on which each arcs begin or end. Values should be inferior to the chromosome lengths given in the genome parameter of the BioCircos function. |
colors |
The colors for each arc. Can be a RColorBrewer palette name used to generate one color per arc, or a character object or vector of character objects stating RGB values in hexadecimal format or base R colors. If the vector is shorter than the number of arcs, values will be repeated. |
labels |
One or multiple character objects to label each arc. |
minRadius , maxRadius
|
Where the track should begin and end, in proportion of the inner radius of the plot. |
... |
Ignored |
BioCircos(BioCircosArcTrack('ArcTrack', chromosomes = 1:5, starts = 2e+7*1:5, ends = 2.5e+7*2:6))
BioCircos(BioCircosArcTrack('ArcTrack', chromosomes = 1:5, starts = 2e+7*1:5, ends = 2.5e+7*2:6))
Simple background to display behind another track
BioCircosBackgroundTrack(trackname, fillColors = "#EEEEFF", borderColors = "#000000", maxRadius = 0.9, minRadius = 0.5, borderSize = 0.3, ...)
BioCircosBackgroundTrack(trackname, fillColors = "#EEEEFF", borderColors = "#000000", maxRadius = 0.9, minRadius = 0.5, borderSize = 0.3, ...)
trackname |
The name of the new track. |
fillColors |
The color of the background element, in hexadecimal RGB format. |
borderColors |
The color of the background borders, in hexadecimal RGB format. |
minRadius , maxRadius
|
Where the track should begin and end, in proportion of the inner radius of the plot. |
borderSize |
The thickness of the background borders. |
... |
Ignored |
BioCircos(BioCircosBackgroundTrack('bgTrack', fillColors="#FFEEEE", borderSize = 1))
BioCircos(BioCircosBackgroundTrack('bgTrack', fillColors="#FFEEEE", borderSize = 1))
Links are defined by beginning and ending genomic coordinates of the 2 regions to linked, such as the positions linked in genomic fusions.
BioCircosLinkTrack(trackname, gene1Chromosomes, gene1Starts, gene1Ends, gene2Chromosomes, gene2Starts, gene2Ends, color = "#40B9D4", labels = "", maxRadius = 0.4, width = "0.1em", gene1Names = "", gene2Names = "", displayAxis = TRUE, axisColor = "#B8B8B8", axisWidth = 0.5, axisPadding = 0, displayLabel = TRUE, labelColor = "#000000", labelSize = "1em", labelPadding = 3, ...)
BioCircosLinkTrack(trackname, gene1Chromosomes, gene1Starts, gene1Ends, gene2Chromosomes, gene2Starts, gene2Ends, color = "#40B9D4", labels = "", maxRadius = 0.4, width = "0.1em", gene1Names = "", gene2Names = "", displayAxis = TRUE, axisColor = "#B8B8B8", axisWidth = 0.5, axisPadding = 0, displayLabel = TRUE, labelColor = "#000000", labelSize = "1em", labelPadding = 3, ...)
trackname |
The name of the new track. |
gene1Chromosomes , gene1Starts , gene1Ends , gene1Names , gene2Chromosomes , gene2Starts , gene2Ends , gene2Names
|
Vectors with the chromosomes, genomic coordinates of beginning and end, and names of both genes to link. Chromosomes and positions should respect the chromosome names and lengths given in the genome parameter of the BioCircos function. |
color |
The color for the links, in hexadecimal RGB format. |
labels |
A vector of character objects to label each link. |
maxRadius |
Where the track should end, in proportion of the inner radius of the plot. |
width |
The thickness of the links. |
displayAxis |
Display additional axis (i.e. circle) around the track. |
axisColor , axisWidth , axisPadding
|
Color, thickness and padding of the additional axis. |
displayLabel |
Display labels of the track. |
labelColor , labelSize , labelPadding
|
Color, font size and padding of the labels around the track. |
... |
Ignored |
start_chromosomes <- 1:5 end_chromosomes <- 2*10:6 start_pos <- 2.5e+7*2:6 end_pos <- 2e+7*1:5 BioCircos(BioCircosLinkTrack('LinkTrack', start_chromosomes, start_pos, start_pos+1, end_chromosomes, end_pos, end_pos+1, color = '#FF00FF'))
start_chromosomes <- 1:5 end_chromosomes <- 2*10:6 start_pos <- 2.5e+7*2:6 end_pos <- 2e+7*1:5 BioCircos(BioCircosLinkTrack('LinkTrack', start_chromosomes, start_pos, start_pos+1, end_chromosomes, end_pos, end_pos+1, color = '#FF00FF'))
SNPs are defined by genomic coordinates and associated with a numerical value
BioCircosSNPTrack(trackname, chromosomes, positions, values, colors = "#40B9D4", labels = "", size = 2, shape = "circle", maxRadius = 0.9, minRadius = 0.5, range = 0, ...)
BioCircosSNPTrack(trackname, chromosomes, positions, values, colors = "#40B9D4", labels = "", size = 2, shape = "circle", maxRadius = 0.9, minRadius = 0.5, range = 0, ...)
trackname |
The name of the new track. |
chromosomes |
A vector containing the chromosomes on which each SNP are found. Values should match the chromosome names given in the genome parameter of the BioCircos function. |
positions |
A vector containing the coordinates on which each SNP are found. Values should be inferior to the chromosome lengths given in the genome parameter of the BioCircos function. |
values |
A vector of numerical values associated with each SNPs, used to determine the radial coordinates of each point on the visualization. |
colors |
The colors for each point. Can be a RColorBrewer palette name used to generate one color per point, or a character object or vector of character objects stating RGB values in hexadecimal format or base R colors. If the vector is shorter than the number of points, values will be repeated. |
labels |
One or multiple character objects to label each point. |
size |
The size of each point. |
shape |
Shape of the points. Can be "circle" or "rect". |
minRadius , maxRadius
|
Where the track should begin and end, in proportion of the inner radius of the plot. |
range |
a vector of the values to be mapped to the minimum and maximum radii of the track. Default to 0, mapping the minimal and maximal values input in the values parameter. |
... |
Ignored |
BioCircos(BioCircosSNPTrack('SNPTrack', chromosomes = 1:3, positions = 1e+7*2:4, values = 1:3, colors = "Accent", labels = c('A', 'B', 'C')) + BioCircosBackgroundTrack('BGTrack'))
BioCircos(BioCircosSNPTrack('SNPTrack', chromosomes = 1:3, positions = 1e+7*2:4, values = 1:3, colors = "Accent", labels = c('A', 'B', 'C')) + BioCircosBackgroundTrack('BGTrack'))
Simple text annotation displayed in the visualization
BioCircosTextTrack(trackname, text, x = -0.15, y = 0, size = "1.2em", weight = "bold", opacity = 1, color = "#000000", ...)
BioCircosTextTrack(trackname, text, x = -0.15, y = 0, size = "1.2em", weight = "bold", opacity = 1, color = "#000000", ...)
trackname |
The name of the new track. |
text |
The text to be displayed. |
x , y
|
Coordinates of the lower left corner of the annotation, in proportion of the inner radius of the plot. |
size |
Font size, with units specified (such as em or px). |
weight |
Font weight. Can be "normal", "bold", "bolder" or "lighter". |
opacity |
Font opacity. |
color |
Font color, in hexadecimal RGB format. |
... |
Ignored |
BioCircos(BioCircosTextTrack('textTrack', 'Annotation', color = '#DD2222', x = -0.3))
BioCircos(BioCircosTextTrack('textTrack', 'Annotation', color = '#DD2222', x = -0.3))
This allows the use of the '+' and '-' operator on these lists
BioCircosTracklist() ## S3 method for class 'BioCircosTracklist' x + ... ## S3 method for class 'BioCircosTracklist' x - ...
BioCircosTracklist() ## S3 method for class 'BioCircosTracklist' x + ... ## S3 method for class 'BioCircosTracklist' x - ...
x |
The tracklist on which other tracks should be added or removed. |
... |
The tracks to add (as tracklists) or to remove (as track names). |