Skip to content

Commit

Permalink
add fontsize settings in circos.genomicInitialize()
Browse files Browse the repository at this point in the history
  • Loading branch information
jokergoo committed Jun 15, 2018
1 parent ad33704 commit a748c97
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
8 changes: 4 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export('$.CELL_META')
S3method("$", CELL_META)
export("$.CELL_META")
S3method("print", CELL_META)
export("print.CELL_META")
export('circos.arrow')
export('circos.axis')
export('circos.clear')
Expand Down Expand Up @@ -52,7 +55,6 @@ export('highlight.chromosome')
export('highlight.sector')
export('posTransform.default')
export('posTransform.text')
export('print.CELL_META')
export('read.chromInfo')
export('read.cytoband')
export('reverse.circlize')
Expand Down Expand Up @@ -83,8 +85,6 @@ export(uh)
export(ux)
export(uy)

S3method("$", CELL_META)
S3method(print, CELL_META)
import(graphics)
importFrom("GlobalOptions", setGlobalOptions)
importFrom("colorspace", HLS)
Expand Down
6 changes: 3 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Changes in version 0.4.5
-------------------------------------------------------------------------

* update denpendency of GlobalOptions package
------------------------------------------------------------------------
* add `axis.labels.cex` and `labels.cex` in `circos.genomicInitialize()`.

Changes in version 0.4.4
-------------------------------------------------------------------------

* update denpendency of GlobalOptions package
* `genomicDensity()`: add `chr.len` argument.

Changes in version 0.4.3
Expand Down
13 changes: 8 additions & 5 deletions R/genomic.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ circos.genomicIdeogram = function(cytoband = system.file(package = "circlize",
# -plotType If it is not ``NULL``, there will create a new track containing axis and names for sectors.
# This argument controls which part should be drawn, ``axis`` for genomic axis and ``labels`` for chromosome names
# -tickLabelsStartFromZero Whether axis tick labels start from 0? This will only affect the axis labels while not affect x-values in cells.
# -axis.labels.cex the font size for the axis tick labels.
# -labels.cex the font size for the labels.
# -track.height If ``PlotType`` is not ``NULL``, height of the annotation track.
# -... Pass to `circos.initialize`
#
Expand All @@ -146,7 +148,8 @@ circos.genomicIdeogram = function(cytoband = system.file(package = "circlize",
#
# For more details on initializing genomic plot, please refer to the vignettes.
circos.genomicInitialize = function(data, sector.names = NULL, major.by = NULL,
plotType = c("axis", "labels"), tickLabelsStartFromZero = TRUE,
plotType = c("axis", "labels"), tickLabelsStartFromZero = TRUE,
axis.labels.cex = 0.4*par("cex"), labels.cex = par("cex"),
track.height = convert_height(3, "mm"), ...) {

if(is.factor(data[[1]])) {
Expand Down Expand Up @@ -217,12 +220,12 @@ circos.genomicInitialize = function(data, sector.names = NULL, major.by = NULL,


if(all(c("axis", "labels") %in% plotType)) {
circos.axis(h = 0, major.at = major.at, labels = major.tick.labels, labels.cex = 0.4*par("cex"))
circos.text(mean(xlim), 1.3, labels = sector.names[sector.index], cex = par("cex"), adj = c(0.5, 0), niceFacing = TRUE)
circos.axis(h = 0, major.at = major.at, labels = major.tick.labels, labels.cex = axis.labels.cex)
circos.text(mean(xlim), 1.3, labels = sector.names[sector.index], cex = labels.cex, adj = c(0.5, 0), niceFacing = TRUE)
} else if("labels" %in% plotType) {
circos.text(mean(xlim), 0, labels = sector.names[sector.index], cex = par("cex"), adj = c(0.5, 0), niceFacing = TRUE)
circos.text(mean(xlim), 0, labels = sector.names[sector.index], cex = labels.cex, adj = c(0.5, 0), niceFacing = TRUE)
} else if("axis" %in% plotType) {
circos.axis(h = 0, major.at = major.at, labels = major.tick.labels, labels.cex = 0.4*par("cex"))
circos.axis(h = 0, major.at = major.at, labels = major.tick.labels, labels.cex = axis.labels.cex)
}
}
)
Expand Down
3 changes: 3 additions & 0 deletions man/circos.genomicInitialize.rd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Initialize circular plot with any genomic data
\usage{
circos.genomicInitialize(data, sector.names = NULL, major.by = NULL,
plotType = c("axis", "labels"), tickLabelsStartFromZero = TRUE,
axis.labels.cex = 0.4*par("cex"), labels.cex = par("cex"),
track.height = convert_height(3, "mm"), ...)
}
\arguments{
Expand All @@ -18,6 +19,8 @@ circos.genomicInitialize(data, sector.names = NULL, major.by = NULL,
\item{major.by}{Increment of major ticks. It is calculated automatically if the value is not set (about every 10 degrees there is a major tick).}
\item{plotType}{If it is not \code{NULL}, there will create a new track containing axis and names for sectors. This argument controls which part should be drawn, \code{axis} for genomic axis and \code{labels} for chromosome names}
\item{tickLabelsStartFromZero}{Whether axis tick labels start from 0? This will only affect the axis labels while not affect x-values in cells.}
\item{axis.labels.cex}{the font size for the axis tick labels.}
\item{labels.cex}{the font size for the labels.}
\item{track.height}{If \code{PlotType} is not \code{NULL}, height of the annotation track.}
\item{...}{Pass to \code{\link{circos.initialize}}}

Expand Down
3 changes: 2 additions & 1 deletion man/circos.par.rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ circos.par(..., RESET = FALSE, READ.ONLY = NULL, LOCAL = FALSE, ADD = FALSE)
\item{RESET}{reset to default values}
\item{READ.ONLY}{please ignore}
\item{LOCAL}{please ignore}
\item{ADD}{please ignore}
\item{ADD}{please ignore}

}
\details{
Global parameters for the circular layout. Currently supported parameters are:
Expand Down

0 comments on commit a748c97

Please sign in to comment.