From 6cc99d375590e1bd28c5fbee8d56de7f5d598c6d Mon Sep 17 00:00:00 2001 From: Zuguang Gu Date: Sat, 13 Oct 2018 12:06:30 +0200 Subject: [PATCH] update documentation --- NAMESPACE | 168 +++++++++++++++---------------- NEWS | 2 + R/chordDiagram.R | 20 ++-- man/Subset.CELL_META.rd | 1 + man/chordDiagram.rd | 3 +- man/chordDiagramFromDataFrame.rd | 3 +- man/chordDiagramFromMatrix.rd | 3 +- 7 files changed, 105 insertions(+), 95 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index dfde0aba..70903ac2 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,89 +1,89 @@ -S3method("$", CELL_META) +S3method("$", "CELL_META") export("$.CELL_META") -S3method("print", CELL_META) +S3method("print", "CELL_META") export("print.CELL_META") -export('circos.arrow') -export('circos.axis') -export('circos.clear') -export('circos.dendrogram') -export('circos.genomicDensity') -export('circos.genomicHeatmap') -export('circos.genomicIdeogram') -export('circos.genomicInitialize') -export('circos.genomicLabels') -export('circos.genomicLines') -export('circos.genomicLink') -export('circos.genomicPoints') -export('circos.genomicPosTransformLines') -export('circos.genomicRainfall') -export('circos.genomicRect') -export('circos.genomicText') -export('circos.genomicTrack') -export('circos.genomicTrackPlotRegion') -export('circos.info') -export('circos.initialize') -export('circos.initializeWithIdeogram') -export('circos.lines') -export('circos.link') -export('circos.nested') -export('circos.par') -export('circos.points') -export('circos.polygon') -export('circos.raster') -export('circos.rect') -export('circos.segments') -export('circos.text') -export('circos.track') -export('circos.trackHist') -export('circos.trackLines') -export('circos.trackPlotRegion') -export('circos.trackPoints') -export('circos.trackText') -export('circos.update') -export('circos.updatePlotRegion') -export('circos.xaxis') -export('circos.yaxis') -export('cytoband.col') -export('draw.sector') -export('get.all.sector.index') -export('get.all.track.index') -export('get.cell.meta.data') -export('get.current.chromosome') -export('get.current.sector.index') -export('get.current.track.index') -export('highlight.chromosome') -export('highlight.sector') -export('posTransform.default') -export('posTransform.text') -export('read.chromInfo') -export('read.cytoband') -export('reverse.circlize') -export('set.current.cell') -export('show.index') -export(CELL_META) -export(add_transparency) -export(adjacencyList2Matrix) -export(chordDiagram) -export(chordDiagramFromDataFrame) -export(chordDiagramFromMatrix) -export(circlize) -export(col2value) -export(colorRamp2) -export(convert_height) -export(convert_length) -export(convert_x) -export(convert_y) -export(degree) -export(fontsize) -export(generateRandomBed) -export(genomicDensity) -export(getI) -export(rainfallTransform) -export(rand_color) -export(smartAlign) -export(uh) -export(ux) -export(uy) +export("CELL_META") +export("add_transparency") +export("adjacencyList2Matrix") +export("chordDiagram") +export("chordDiagramFromDataFrame") +export("chordDiagramFromMatrix") +export("circlize") +export("circos.arrow") +export("circos.axis") +export("circos.clear") +export("circos.dendrogram") +export("circos.genomicDensity") +export("circos.genomicHeatmap") +export("circos.genomicIdeogram") +export("circos.genomicInitialize") +export("circos.genomicLabels") +export("circos.genomicLines") +export("circos.genomicLink") +export("circos.genomicPoints") +export("circos.genomicPosTransformLines") +export("circos.genomicRainfall") +export("circos.genomicRect") +export("circos.genomicText") +export("circos.genomicTrack") +export("circos.genomicTrackPlotRegion") +export("circos.info") +export("circos.initialize") +export("circos.initializeWithIdeogram") +export("circos.lines") +export("circos.link") +export("circos.nested") +export("circos.par") +export("circos.points") +export("circos.polygon") +export("circos.raster") +export("circos.rect") +export("circos.segments") +export("circos.text") +export("circos.track") +export("circos.trackHist") +export("circos.trackLines") +export("circos.trackPlotRegion") +export("circos.trackPoints") +export("circos.trackText") +export("circos.update") +export("circos.updatePlotRegion") +export("circos.xaxis") +export("circos.yaxis") +export("col2value") +export("colorRamp2") +export("convert_height") +export("convert_length") +export("convert_x") +export("convert_y") +export("cytoband.col") +export("degree") +export("draw.sector") +export("fontsize") +export("generateRandomBed") +export("genomicDensity") +export("get.all.sector.index") +export("get.all.track.index") +export("get.cell.meta.data") +export("get.current.chromosome") +export("get.current.sector.index") +export("get.current.track.index") +export("getI") +export("highlight.chromosome") +export("highlight.sector") +export("posTransform.default") +export("posTransform.text") +export("rainfallTransform") +export("rand_color") +export("read.chromInfo") +export("read.cytoband") +export("reverse.circlize") +export("set.current.cell") +export("show.index") +export("smartAlign") +export("uh") +export("ux") +export("uy") import(graphics) importFrom("GlobalOptions", setGlobalOptions) diff --git a/NEWS b/NEWS index 608e1119..b78b358e 100755 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ Changes in version 0.4.5 ------------------------------------------------------------------------ * add `axis.labels.cex` and `labels.cex` in `circos.genomicInitialize()`. * remove `lwd` in `circos.genomicRect()` because `lwd` is not allowed to be vector. +* fixed a bug when self.link = 1 in chordDiagram() +* add `scale` in chordDiagram() Changes in version 0.4.4 ------------------------------------------------------------------------- diff --git a/R/chordDiagram.R b/R/chordDiagram.R index 6ece9e53..2d9e6f4d 100755 --- a/R/chordDiagram.R +++ b/R/chordDiagram.R @@ -38,6 +38,7 @@ # -link.largest.ontop pass to `chordDiagramFromMatrix` or `chordDiagramFromDataFrame` # -link.visible pass to `chordDiagramFromMatrix` or `chordDiagramFromDataFrame` # -link.rank order to add links to the circle, a large value means to add it later. +# -scale scale each sector to same width # -... pass to `circos.link`. # # == details @@ -78,7 +79,7 @@ chordDiagram = function(x, grid.col = NULL, grid.border = NA, transparency = 0.5 link.arr.type = "triangle", link.arr.lty = par("lty"), link.arr.lwd = par("lwd"), link.arr.col = par("col"), link.largest.ontop = FALSE, link.visible = TRUE, - link.rank = NULL, ...) { + link.rank = NULL, scale = FALSE, ...) { if(inherits(x, "matrix")) { chordDiagramFromMatrix(x, grid.col = grid.col, grid.border = grid.border, transparency = transparency, @@ -89,7 +90,7 @@ chordDiagram = function(x, grid.col = NULL, grid.border = NA, transparency = 0.5 link.border = link.border, link.lwd = link.lwd, link.lty = link.lty, link.sort = link.sort, link.decreasing = link.decreasing, link.arr.length = link.arr.length, link.arr.width = link.arr.width, link.arr.type = link.arr.type, link.arr.lty = link.arr.lty, link.arr.lwd = link.arr.lwd, link.arr.col = link.arr.col, link.largest.ontop = link.largest.ontop, - link.visible = link.visible, link.rank = link.rank, ...) + link.visible = link.visible, link.rank = link.rank, scale = scale, ...) } else if(inherits(x, "data.frame")) { if(ncol(x) > 3) { if(all(sapply(x, inherits, c("numeric", "integer")))) { @@ -102,7 +103,7 @@ chordDiagram = function(x, grid.col = NULL, grid.border = NA, transparency = 0.5 link.border = link.border, link.lwd = link.lwd, link.lty = link.lty, link.sort = link.sort, link.decreasing = link.decreasing, link.arr.length = link.arr.length, link.arr.width = link.arr.width, link.arr.type = link.arr.type, link.arr.lty = link.arr.lty, link.arr.lwd = link.arr.lwd, link.arr.col = link.arr.col, link.largest.ontop = link.largest.ontop, - link.visible = link.visible, link.rank = link.rank, ...))) + link.visible = link.visible, link.rank = link.rank, scale = scale, ...))) } else { chordDiagramFromDataFrame(x, grid.col = grid.col, grid.border = grid.border, transparency = transparency, col = col, order = order, directional = directional, direction.type = direction.type, @@ -111,7 +112,7 @@ chordDiagram = function(x, grid.col = NULL, grid.border = NA, transparency = 0.5 link.border = link.border, link.lwd = link.lwd, link.lty = link.lty, link.sort = link.sort, link.decreasing = link.decreasing, link.arr.length = link.arr.length, link.arr.width = link.arr.width, link.arr.type = link.arr.type, link.arr.lty = link.arr.lty, link.arr.lwd = link.arr.lwd, link.arr.col = link.arr.col, link.largest.ontop = link.largest.ontop, - link.visible = link.visible, link.rank = link.rank, ...) + link.visible = link.visible, link.rank = link.rank, scale = scale, ...) } } else { chordDiagramFromDataFrame(x, grid.col = grid.col, grid.border = grid.border, transparency = transparency, @@ -121,7 +122,7 @@ chordDiagram = function(x, grid.col = NULL, grid.border = NA, transparency = 0.5 link.border = link.border, link.lwd = link.lwd, link.lty = link.lty, link.sort = link.sort, link.decreasing = link.decreasing, link.arr.length = link.arr.length, link.arr.width = link.arr.width, link.arr.type = link.arr.type, link.arr.lty = link.arr.lty, link.arr.lwd = link.arr.lwd, link.arr.col = link.arr.col, link.largest.ontop = link.largest.ontop, - link.visible = link.visible, link.rank = link.rank, ...) + link.visible = link.visible, link.rank = link.rank, scale = scale, ...) } } else { stop("`x` can only be a matrix or a data frame.") @@ -317,6 +318,7 @@ mat2df = function(mat) { # -link.visible whether plot the link. The value is logical, if it is set to ``FALSE``, the corresponding link will not # plotted, but the space is still ocuppied. The format of this argument is same as ``link.lwd`` # -link.rank order to add links to the circle, a large value means to add it later. +# -scale scale each sector to same width # -... pass to `circos.link` # # == details @@ -339,7 +341,7 @@ chordDiagramFromMatrix = function(mat, grid.col = NULL, grid.border = NA, transp link.arr.type = "triangle", link.arr.lty = par("lty"), link.arr.lwd = par("lwd"), link.arr.col = par("col"), link.largest.ontop = FALSE, link.visible = TRUE, - link.rank = NULL, ...) { + link.rank = NULL, scale = FALSE, ...) { if(!is.matrix(mat)) { stop("`mat` can only be a matrix.") @@ -574,6 +576,7 @@ chordDiagramFromMatrix = function(mat, grid.col = NULL, grid.border = NA, transp link.largest.ontop = link.largest.ontop, link.visible = link.visible, link.rank = link.rank, + scale = scale, ...) } @@ -634,6 +637,7 @@ chordDiagramFromMatrix = function(mat, grid.col = NULL, grid.border = NA, transp # -link.visible whether plot the link. The value is logical, if it is set to ``FALSE``, the corresponding link will not # plotted, but the space is still ocuppied. The format of this argument is same as ``link.lwd`` # -link.rank order to add links to the circle, a large value means to add it later. +# -scale scale each sector to same width # -... pass to `circos.link` # # == details @@ -654,7 +658,7 @@ chordDiagramFromDataFrame = function(df, grid.col = NULL, grid.border = NA, tran link.arr.width = link.arr.length/2, link.arr.type = "triangle", link.arr.lty = par("lty"), link.arr.lwd = par("lwd"), link.arr.col = par("col"), - link.largest.ontop = FALSE, link.visible = link.visible, + link.largest.ontop = FALSE, link.visible = TRUE, link.rank = seq_len(nrow(df)), scale = FALSE, ...) { @@ -885,7 +889,7 @@ chordDiagramFromDataFrame = function(df, grid.col = NULL, grid.border = NA, tran l = df$cn == nm if(self.link == 1) { l2 = ! df$rn[l] == nm # self link - od[[nm]] = order(od[[nm]][l2]) + od[[nm]][l2] = order(od[[nm]][l2]) } else { l2 = rep(TRUE, sum(l)) } diff --git a/man/Subset.CELL_META.rd b/man/Subset.CELL_META.rd index b0404db1..e287b7c9 100644 --- a/man/Subset.CELL_META.rd +++ b/man/Subset.CELL_META.rd @@ -1,5 +1,6 @@ \name{$.CELL_META} \alias{$.CELL_META} +\alias{Subset.CELL_META} \title{ Easy to way to get meta data in the current cell } diff --git a/man/chordDiagram.rd b/man/chordDiagram.rd index 62aa4bf0..5369d5a6 100755 --- a/man/chordDiagram.rd +++ b/man/chordDiagram.rd @@ -23,7 +23,7 @@ chordDiagram(x, grid.col = NULL, grid.border = NA, transparency = 0.5, link.arr.type = "triangle", link.arr.lty = par("lty"), link.arr.lwd = par("lwd"), link.arr.col = par("col"), link.largest.ontop = FALSE, link.visible = TRUE, - link.rank = NULL, ...) + link.rank = NULL, scale = FALSE, ...) } \arguments{ @@ -60,6 +60,7 @@ chordDiagram(x, grid.col = NULL, grid.border = NA, transparency = 0.5, \item{link.largest.ontop}{pass to \code{\link{chordDiagramFromMatrix}} or \code{\link{chordDiagramFromDataFrame}} } \item{link.visible}{pass to \code{\link{chordDiagramFromMatrix}} or \code{\link{chordDiagramFromDataFrame}} } \item{link.rank}{order to add links to the circle, a large value means to add it later. } + \item{scale}{scale each sector to same width } \item{...}{pass to \code{\link{circos.link}}. } } diff --git a/man/chordDiagramFromDataFrame.rd b/man/chordDiagramFromDataFrame.rd index 8171a98c..4e160ab1 100755 --- a/man/chordDiagramFromDataFrame.rd +++ b/man/chordDiagramFromDataFrame.rd @@ -19,7 +19,7 @@ chordDiagramFromDataFrame(df, grid.col = NULL, grid.border = NA, transparency = link.arr.width = link.arr.length/2, link.arr.type = "triangle", link.arr.lty = par("lty"), link.arr.lwd = par("lwd"), link.arr.col = par("col"), - link.largest.ontop = FALSE, link.visible = link.visible, + link.largest.ontop = FALSE, link.visible = TRUE, link.rank = seq_len(nrow(df)), scale = FALSE, ...) } @@ -54,6 +54,7 @@ chordDiagramFromDataFrame(df, grid.col = NULL, grid.border = NA, transparency = \item{link.largest.ontop}{controls the order of adding links, whether based on the absolute value? } \item{link.visible}{whether plot the link. The value is logical, if it is set to \code{FALSE}, the corresponding link will not plotted, but the space is still ocuppied. The format of this argument is same as \code{link.lwd} } \item{link.rank}{order to add links to the circle, a large value means to add it later. } + \item{scale}{scale each sector to same width } \item{...}{pass to \code{\link{circos.link}} } } diff --git a/man/chordDiagramFromMatrix.rd b/man/chordDiagramFromMatrix.rd index 4a972565..7f9f292e 100755 --- a/man/chordDiagramFromMatrix.rd +++ b/man/chordDiagramFromMatrix.rd @@ -21,7 +21,7 @@ chordDiagramFromMatrix(mat, grid.col = NULL, grid.border = NA, transparency = 0. link.arr.type = "triangle", link.arr.lty = par("lty"), link.arr.lwd = par("lwd"), link.arr.col = par("col"), link.largest.ontop = FALSE, link.visible = TRUE, - link.rank = NULL, ...) + link.rank = NULL, scale = FALSE, ...) } \arguments{ @@ -58,6 +58,7 @@ chordDiagramFromMatrix(mat, grid.col = NULL, grid.border = NA, transparency = 0. \item{link.largest.ontop}{controls the order of adding links, whether based on the absolute value? } \item{link.visible}{whether plot the link. The value is logical, if it is set to \code{FALSE}, the corresponding link will not plotted, but the space is still ocuppied. The format of this argument is same as \code{link.lwd} } \item{link.rank}{order to add links to the circle, a large value means to add it later. } + \item{scale}{scale each sector to same width } \item{...}{pass to \code{\link{circos.link}} } }