Skip to content

Commit

Permalink
merge dev
Browse files Browse the repository at this point in the history
Merge branch 'dev'

# Conflicts:
#	README.md
#	man/fragments/figures/unnamed-chunk-19-1.png
#	man/fragments/figures/unnamed-chunk-20-1.png
  • Loading branch information
stemangiola committed Nov 21, 2022
2 parents 24fc4b1 + 79de9ad commit da76666
Show file tree
Hide file tree
Showing 34 changed files with 1,909 additions and 435 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: tidyHeatmap
Title: A Tidy Implementation of Heatmap
Version: 1.8.1
Version: 1.9.0
Authors@R:
c(person(given = "Stefano",
family = "Mangiola",
Expand Down Expand Up @@ -67,5 +67,5 @@ Biarch: true
biocViews: AssayDomain, Infrastructure
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
RoxygenNote: 7.2.1
Language: en-US
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export(add_bar)
export(add_line)
export(add_point)
export(add_tile)
export(annotation_bar)
export(annotation_line)
export(annotation_point)
export(annotation_tile)
export(as_ComplexHeatmap)
export(heatmap)
export(layer_arrow_down)
Expand Down
262 changes: 261 additions & 1 deletion R/deprecated_framework.R
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,264 @@ annot_to_list_OLD = function(.data){
{ setNames( pull(., color), pull(., col_name)) })
), ~ (.))

}
}

#' DEPRECATED. Adds a bar annotation layer to a `InputHeatmap`, that on evaluation creates a `ComplexHeatmap`
#'
#' \lifecycle{maturing}
#'
#' @description add_bar() from a `InputHeatmap` object, adds a bar annotation layer.
#'
#' @importFrom rlang enquo
#' @importFrom magrittr "%>%"
#' @importFrom grid unit
#'
#'
#' @name add_bar
#' @rdname add_bar-method
#'
#' @param .data A `tbl_df` formatted as | <ELEMENT> | <FEATURE> | <VALUE> | <...> |
#' @param .column Vector of quotes
#' @param palette A character vector of colors, or a function such as colorRamp2 (see examples).
#' @param size A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation.
#' @param ... The arguments that will be passed to top_annotation or left_annotation of the ComplexHeatmap container
#'
#' @details It uses `ComplexHeatmap` as visualisation tool.
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
#'
#'
#' @examples
#'
#' print("DEPRECATED")
#'
#'
#' @export
setGeneric("add_bar", function(.data,
.column,
palette = NULL, size = NULL,...)
standardGeneric("add_bar"))

#' DEPRECATED. Adds a tile annotation layer to a `InputHeatmap`, that on evaluation creates a `ComplexHeatmap`
#'
#' \lifecycle{maturing}
#'
#' @description add_tile() from a `InputHeatmap` object, adds a tile annotation layer.
#'
#' @importFrom rlang enquo
#' @importFrom magrittr "%>%"
#' @importFrom grid unit
#'
#' @name add_tile
#' @rdname add_tile-method
#'
#' @param .data A `tbl_df` formatted as | <ELEMENT> | <FEATURE> | <VALUE> | <...> |
#' @param .column Vector of quotes
#' @param palette A character vector of colors, or a function such as colorRamp2 (see examples).
#' @param size A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation.
#' @param ... The arguments that will be passed to top_annotation or left_annotation of the ComplexHeatmap container
#'
#' @details It uses `ComplexHeatmap` as visualisation tool.
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
#'
#'
#' @examples
#'
#' print("DEPRECATED")
#'
#' @export
setGeneric("add_tile", function(.data,
.column,
palette = NULL, size = NULL, ...)
standardGeneric("add_tile"))

#' DEPRECATED. add_tile
#'
#' @docType methods
#' @rdname add_tile-method
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
setMethod("add_tile", "InputHeatmap", function(.data,
.column,
palette = NULL, size = NULL,...){

deprecate_warn("1.9.0", "tidyHeatmap::add_tile()", details = "Please use `annotation_tile()` instead")

.column = enquo(.column)

annotation_tile(.data = .data, .column = !!.column, palette = palette, size = size, ...)

})

#' DEPRECATED. Adds a point annotation layer to a `InputHeatmap`, that on evaluation creates a `ComplexHeatmap`
#'
#' \lifecycle{maturing}
#'
#' @description add_point() from a `InputHeatmap` object, adds a point annotation layer.
#'
#' @importFrom rlang enquo
#' @importFrom magrittr "%>%"
#' @importFrom grid unit
#'
#'
#' @name add_point
#' @rdname add_point-method
#'
#' @param .data A `tbl_df` formatted as | <ELEMENT> | <FEATURE> | <VALUE> | <...> |
#' @param .column Vector of quotes
#' @param palette A character vector of colors, or a function such as colorRamp2 (see examples).
#' @param size A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation.
#' @param ... The arguments that will be passed to top_annotation or left_annotation of the ComplexHeatmap container
#'
#' @details It uses `ComplexHeatmap` as visualisation tool.
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
#'
#'
#' @examples
#'
#' print("DEPRECATED")
#'
#'
#' @export
setGeneric("add_point", function(.data,
.column,
palette = NULL, size = NULL,...)
standardGeneric("add_point"))

#' DEPRECATED. add_point
#'
#' @docType methods
#' @rdname add_point-method
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
setMethod("add_point", "InputHeatmap", function(.data,
.column,
palette = NULL, size = NULL,...){

.column = enquo(.column)

deprecate_warn("1.9.0", "tidyHeatmap::add_point()", details = "Please use `annotation_point()` instead")

annotation_point(.data = .data, .column = !!.column, palette = palette, size = size, ...)

})

#' DEPRECATED. Adds a line annotation layer to a `InputHeatmap`, that on evaluation creates a `ComplexHeatmap`
#'
#' \lifecycle{maturing}
#'
#' @description add_line() from a `InputHeatmap` object, adds a line annotation layer.
#'
#' @importFrom rlang enquo
#' @importFrom magrittr "%>%"
#' @importFrom grid unit
#'
#'
#' @name add_line
#' @rdname add_line-method
#'
#' @param .data A `tbl_df` formatted as | <ELEMENT> | <FEATURE> | <VALUE> | <...> |
#' @param .column Vector of quotes
#' @param palette A character vector of colors, or a function such as colorRamp2 (see examples).
#' @param size A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation.
#' @param ... The arguments that will be passed to top_annotation or left_annotation of the ComplexHeatmap container
#'
#' @details It uses `ComplexHeatmap` as visualisation tool.
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
#'
#'
#' @examples
#'
#' print("DEPRECATED")
#'
#'
#' @export
setGeneric("add_line", function(.data,
.column,
palette = NULL,size = NULL, ...)
standardGeneric("add_line"))

#' DEPRECATED. add_line
#'
#' @docType methods
#' @rdname add_line-method
#'
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
setMethod("add_line", "InputHeatmap", function(.data,
.column,
palette = NULL, size = NULL,...){

.column = enquo(.column)

deprecate_warn("1.9.0", "tidyHeatmap::add_line()", details = "Please use `annotation_line()` instead")

annotation_line(.data = .data, .column = !!.column, palette = palette, size = size, ...)

})

#' DEPRECATED. Adds a bar annotation layer to a `InputHeatmap`, that on evaluation creates a `ComplexHeatmap`
#'
#' \lifecycle{maturing}
#'
#' @description add_bar() from a `InputHeatmap` object, adds a bar annotation layer.
#'
#' @importFrom rlang enquo
#' @importFrom magrittr "%>%"
#' @importFrom grid unit
#'
#'
#' @name add_bar
#' @rdname add_bar-method
#'
#' @param .data A `tbl_df` formatted as | <ELEMENT> | <FEATURE> | <VALUE> | <...> |
#' @param .column Vector of quotes
#' @param palette A character vector of colors, or a function such as colorRamp2 (see examples).
#' @param size A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation.
#' @param ... The arguments that will be passed to top_annotation or left_annotation of the ComplexHeatmap container
#'
#' @details It uses `ComplexHeatmap` as visualisation tool.
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
#'
#'
#' @examples
#'
#' print("DEPRECATED")
#'
#'
#' @export
setGeneric("add_bar", function(.data,
.column,
palette = NULL, size = NULL,...)
standardGeneric("add_bar"))

#' DEPRECATED. add_bar
#'
#' @docType methods
#' @rdname add_bar-method
#'
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
#'
setMethod("add_bar", "InputHeatmap", function(.data,
.column,
palette = NULL, size = NULL,...){

deprecate_warn("1.9.0", "tidyHeatmap::add_bar()", details = "Please use `annotation_bar()` instead")

.column = enquo(.column)

annotation_bar(.data = .data, .column = !!.column, palette = palette, size = size, ...)

})
Loading

0 comments on commit da76666

Please sign in to comment.