-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
445 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ Package: circlize | |
Type: Package | ||
Title: Circular Visualization | ||
Version: 0.4.0 | ||
Date: 2017-3-10 | ||
Date: 2017-4-14 | ||
Author: Zuguang Gu | ||
Maintainer: Zuguang Gu <[email protected]> | ||
Depends: R (>= 2.10.0), graphics | ||
|
@@ -19,8 +19,8 @@ Description: Circular layout is an efficient way for the visualization of huge | |
connection between the powerful computational and visual environment in R, | ||
circlize gives users more convenience and freedom to design figures for | ||
better understanding complex patterns behind multi-dimensional data. | ||
URL: https://github.com/jokergoo/circlize | ||
URL: https://github.com/jokergoo/circlize, http://jokergoo.github.io/circlize_book/book/ | ||
License: GPL (>= 2) | ||
Packaged: 2017-3-10 00:00:00 UTC; Administrator | ||
Packaged: 2017-4-14 00:00:00 UTC; Administrator | ||
Repository: CRAN | ||
Date/Publication: 2017-3-10 00:00:00 | ||
Date/Publication: 2017-4-14 00:00:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,24 @@ | |
# Nested zooming with two circular plots | ||
# | ||
# == param | ||
# -f1 a self-defined function with no argument for making the first circular plot | ||
# -f2 a self-defined function with no argument for making the second circular plot | ||
# -f1 a self-defined function for making the first circular plot. The function should have no argument. | ||
# -f2 a self-defined function for making the second circular plot. The function should have no argument. | ||
# -correspondance a six-column data frame which contains correspondance between the | ||
# coordinates in two circular plots | ||
# -connection_height the height of the connections, measured as the percent to the radius of the unit circle. | ||
# -connection_height the height of the connection track, measured as the percent to the radius of the unit circle. | ||
# The value can be specified by `uh` or `convert_height` with absolute units. | ||
# -connection_col filled color for the connection polygons. The value can be a vector with same length as number of rows of ``correspondance`` | ||
# -connection_border border color for the connection polygons | ||
# -connection_lty line style for the connection polygon borders | ||
# -connection_lwd connection polygon border width | ||
# -adjust_start_degree If ``start.degree`` is not set in ``f2()``, the start degree for the second | ||
# -connection_col filled color of the connection track. The value can be a vector with same length as number of rows of ``correspondance`` | ||
# -connection_border border color of the connection track. | ||
# -connection_lty line style of the connection track borders | ||
# -connection_lwd line width of the connection track borders | ||
# -adjust_start_degree If ``circos.par(start.degree = ...)`` is not set in ``f2()``, the start degree for the second | ||
# circular plot will be adjusted to make the distance of sectors between the two plots to the minimal. | ||
# | ||
# == details | ||
# The function visualizes zoomings by combining two circular plots into one page where | ||
# one is the normal circular plot and the other one only contains regions need to be zoomed. | ||
# one is the normal circular plot and the other one only contains regions that need to be zoomed. | ||
# This function automatically arranges the two plots to make it easy to correspond between | ||
# the original and the zoomed plots. | ||
# the original and the zoomed sectors. | ||
# | ||
# Since the function needs to know the information of the two circular plots, please do not call | ||
# `circos.clear` in either ``f1()`` or ``f2()``. It will be called internally in `circos.nested`. | ||
|
@@ -28,6 +28,9 @@ | |
# Also ``canvas.xlim`` and ``canvas.ylim`` are reset in ``f2()``, they should not be set in ``f2()`` | ||
# either. | ||
# | ||
# == seealso | ||
# http://jokergoo.github.io/circlize_book/book/nested-zooming.html | ||
# | ||
# == author | ||
# Zuguang Gu <[email protected]> | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1695,6 +1695,7 @@ posTransform.text = function(region, y, labels, cex = 1, font = par("font"), | |
# == param | ||
# -bed a data frame in bed format, the matrix is stored from the fourth column. | ||
# -col colors for the heatmaps. The value can be a matrix or a color mapping function generated by `colorRamp2`. | ||
# -numeric.column column index for the numeric columns. The values can be integer index or character index | ||
# -border border of the heatmap grids. | ||
# -border_lwd line width for borders of heatmap grids | ||
# -border_lty line style for borders of heatmap grids | ||
|
@@ -1717,27 +1718,41 @@ posTransform.text = function(region, y, labels, cex = 1, font = par("font"), | |
# Zuguang Gu <[email protected]> | ||
# | ||
# == example | ||
# \dontrun{ | ||
# circos.initializeWithIdeogram(plotType = c("labels", "axis")) | ||
# bed = generateRandomBed(nr = 100, nc = 4) | ||
# col_fun = colorRamp2(c(-1, 0, 1), c("green", "black", "red")) | ||
# circos.genomicHeatmap(bed, col_fun, side = "inside", border = "white") | ||
# circos.genomicHeatmap(bed, col_fun, side = "outside", | ||
# line_col = as.numeric(factor(bed[[1]]))) | ||
circos.genomicHeatmap = function(bed, col, border = NA, border_lwd = par("lwd"), | ||
# } | ||
circos.genomicHeatmap = function(bed, col, numeric.column = NULL, | ||
border = NA, border_lwd = par("lwd"), | ||
border_lty = par("lty"), connection_height = convert_height(5, "mm"), | ||
line_col = par("col"), line_lwd = par("lwd"), line_lty = par("lty"), | ||
heatmap_height = 0.15, side = c("inside", "outside"), | ||
track.margin = circos.par("track.margin")) { | ||
|
||
mat = bed[, -(1:3)] | ||
mat = mat[, apply(mat, 2, "is.numeric"), drop = FALSE] | ||
if(ncol(mat) == 0) { | ||
stop("You don't have numeric columns in `bed`.") | ||
if(is.null(numeric.column)) { | ||
numeric.column = which(apply(mat, 2, "is.numeric")) | ||
if(length(numeric.column) == 0) { | ||
stop("You don't have numeric columns in `bed`.") | ||
} | ||
} else { | ||
if(is.numeric(numeric.column)) { | ||
numeric.column = numeric.column - 3 | ||
} | ||
} | ||
mat = mat[, numeric.column, drop = FALSE] | ||
|
||
mat = as.matrix(mat) | ||
bed = cbind(bed[, 1:3], mat) | ||
|
||
side = match.arg(side) | ||
if(missing(col)) { | ||
col = colorRamp2(seq(min(na.rm = TRUE), max(mat, na.rm = TRUE), length = 3), c("blue", "#EEEEEE", "red")) | ||
} | ||
if(is.function(col)) { | ||
col = col(mat) | ||
} | ||
|
@@ -1810,18 +1825,21 @@ circos.genomicHeatmap = function(bed, col, border = NA, border_lwd = par("lwd"), | |
# Zuguang Gu <[email protected]> | ||
# | ||
# == example | ||
# \dontrun{ | ||
# circos.initializeWithIdeogram(plotType = c("labels", "axis")) | ||
# bed = generateRandomBed(nr = 100, fun = function(k) sample(letters, k, replace = TRUE)) | ||
# bed[1, 4] = "aaaaaaaa" | ||
# circos.genomicLabels(bed, labels.column = 4, side = "inside", | ||
# col = as.numeric(factor(bed[[1]]))) | ||
# circos.genomicLabels(bed, labels.column = 4, side = "outside", | ||
# line_col = as.numeric(factor(bed[[1]]))) | ||
# } | ||
circos.genomicLabels = function(bed, labels = NULL, labels.column = NULL, | ||
col = par("col"), cex = 0.8, font = par("font"), padding = 0.4, | ||
connection_height = convert_height(5, "mm"), | ||
line_col = par("col"), line_lwd = par("lwd"), line_lty = par("lty"), | ||
labels_height = min(c(convert_height(1.5, "cm"), max(strwidth(labels, cex = cex, font = font)))), | ||
labels_height = min(c(convert_height(1.5, "cm"), | ||
max(strwidth(labels, cex = cex, font = font)))), | ||
side = c("inside", "outside"), track.margin = circos.par("track.margin")) { | ||
|
||
if(is.null(labels)){ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.