Skip to content

Commit

Permalink
Update circos_heatmap function
Browse files Browse the repository at this point in the history
  • Loading branch information
benben-miao committed Jul 26, 2023
1 parent 32d9b44 commit 804c8bf
Show file tree
Hide file tree
Showing 90 changed files with 243 additions and 184 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: TOmicsVis
Type: Package
Title: Transcriptome Visualization Process Scheme
Version: 1.2.3
Version: 1.2.4
Authors@R: c(
person(given = "Benben", family = "Miao", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7307-1331")),
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## TOmicsVis 1.2.4

**Date**: 2023-07-26

<span style="background-color: green; border-radius: 10px; padding: 0px 5px; font-weight: bold; color: white;">New Features:</span>

<span style="background-color: red; border-radius: 10px; padding: 0px 5px; font-weight: bold; color: white;">Bugs Fixed:</span>

1. Add new parameters (cluster_run, dend_show, rowname_show) for `?TOmicsVis::circos_heatmap` function.

---

## TOmicsVis 1.2.3

**Date**: 2023-07-20
Expand Down
17 changes: 12 additions & 5 deletions R/circos_heatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
#' @param mid_color Character: middle value color (color name or hex value). Default: "#ffffff".
#' @param high_color Character: high value color (color name or hex value). Default: "#ff0000".
#' @param gap_size Numeric: heatmap gap size. Default: 10, min: 0.
#' @param cluster_run Logical: running cluster algorithm. Default: TRUE, options: TRUE, FALSE.
#' @param cluster_method Character: cluster methods. Default: "complete", options: "ward.D", "ward.D2", "single", "complete", "average", "mcquitty", "median", "centroid".
#' @param distance_method Character: distance methods. Default: "euclidean", options: "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski".
#' @param dend_show Character: control dendgram display and position. Default: "inside", options: "none", "outside", "inside".
#' @param dend_height Numeric: dendgram height. Default: 0.20, min: 0.00, max: 0.50.
#' @param rowname_show Character: control rownames display and position. Hind first rowname by running rownames(data)[1]. Default: "outside", options: "none", "outside", "inside".
#' @param rowname_size Numeric: rowname font size. Default: 0.80, min: 0.10, max: 10.00.
#'
#' @importFrom stats reorder
Expand All @@ -35,9 +38,12 @@ circos_heatmap <- function(data,
mid_color = "#ffffff",
high_color = "#ff0000",
gap_size = 10,
cluster_run = TRUE,
cluster_method = "complete",
distance_method = "euclidean",
dend_show = "inside",
dend_height = 0.20,
rowname_show = "outside",
rowname_size = 0.80
){

Expand Down Expand Up @@ -101,17 +107,18 @@ circos_heatmap <- function(data,
bg.border = NA,
bg.lty = graphics::par("lty"),
bg.lwd = graphics::par("lwd"),
cluster = TRUE,
cluster = cluster_run,
clustering.method = cluster_method, # "ward.D", "ward.D2", "single", "complete", "average", "mcquitty", "median", "centroid"
distance.method = distance_method, # "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski"
dend.callback = function(dend, m, si) stats::reorder(dend, rowMeans(m)),
dend.side = "inside", # "none", "outside", "inside"
dend.side = dend_show, # "none", "outside", "inside"
dend.track.height = dend_height,
rownames.side = "outside", # "none", "outside", "inside"
rownames.side = rowname_show, # "none", "outside", "inside"
rownames.cex = rowname_size,
rownames.font = graphics::par("font"),
rownames.col = "black",
track.height = 0.3
track.height = 0.3,
show.sector.labels = FALSE
)
# circos.track(track.index = get.current.track.index(),
# panel.fun = function(x, y) {
Expand All @@ -126,7 +133,7 @@ circos_heatmap <- function(data,
# }, bg.border = NA)
legend = ComplexHeatmap::Legend(title = "ColorBar", col_fun = col_fun)
grid::grid.draw(legend)
circos.clear()
circlize::circos.clear()
}
# # <- 4. Plot

Expand Down
5 changes: 4 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,17 @@ data(circos_heatmap_data)
# 2. Run circos_heatmap plot function
circos_heatmap(
circos_heatmap_data,
data = circos_heatmap_data,
low_color = "#0000ff",
mid_color = "#ffffff",
high_color = "#ff0000",
gap_size = 10,
cluster_run = TRUE,
cluster_method = "complete",
distance_method = "euclidean",
dend_show = "inside",
dend_height = 0.2,
rowname_show = "outside",
rowname_size = 0.8
)
```
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,17 @@ data(circos_heatmap_data)

# 2. Run circos_heatmap plot function
circos_heatmap(
circos_heatmap_data,
data = circos_heatmap_data,
low_color = "#0000ff",
mid_color = "#ffffff",
high_color = "#ff0000",
gap_size = 10,
cluster_run = TRUE,
cluster_method = "complete",
distance_method = "euclidean",
dend_show = "inside",
dend_height = 0.2,
rowname_show = "outside",
rowname_size = 0.8
)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Tutorials.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.0.7
pkgdown_sha: ~
articles:
Tutorials: Tutorials.html
last_built: 2023-07-24T09:23Z
last_built: 2023-07-26T05:08Z
urls:
reference: https://github.com/benben-miao/TOmicsVis/reference
article: https://github.com/benben-miao/TOmicsVis/articles
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/box_data.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/box_plot.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/chord_data.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/reference/chord_plot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 804c8bf

Please sign in to comment.