Browse code

remove rsvg

Zuguang Gu authored on 26/11/2018 19:55:53
Showing11 changed files

... ...
@@ -1,8 +1,8 @@
1 1
 Package: ComplexHeatmap
2 2
 Type: Package
3 3
 Title: Make Complex Heatmaps
4
-Version: 1.99.1
5
-Date: 2018-11-23
4
+Version: 1.99.2
5
+Date: 2018-11-26
6 6
 Author: Zuguang Gu
7 7
 Maintainer: Zuguang Gu <z.gu@dkfz.de>
8 8
 Depends: R (>= 3.1.2), methods, grid, graphics, stats, grDevices
... ...
@@ -10,7 +10,7 @@ Imports: circlize (>= 0.4.5), GetoptLong, colorspace,
10 10
     RColorBrewer, GlobalOptions (>= 0.1.0)
11 11
 Suggests: testthat (>= 0.3), knitr, markdown, dendsort, 
12 12
     Cairo, png, jpeg, tiff, fastcluster,
13
-    dendextend (>= 1.0.1), grImport, grImport2, rsvg, glue
13
+    dendextend (>= 1.0.1), grImport, grImport2, glue
14 14
 VignetteBuilder: knitr
15 15
 Description: Complex heatmaps are efficient to visualize associations 
16 16
     between different sources of data sets and reveal potential patterns. 
... ...
@@ -4,6 +4,7 @@ CHANGES in VERSION 1.99.1
4 4
 * fixed a bug when annotation_height with only one annotation
5 5
 * order of k-means slices are reordered by slice mean of `row_reorder`/`column_reorder`
6 6
   if they are provided as vectors.
7
+* remove **rsvg** from Suggests.
7 8
 
8 9
 =======================
9 10
 
... ...
@@ -1,31 +1,31 @@
1
-setGeneric('draw_heatmap_body', function(object, ...) standardGeneric('draw_heatmap_body'))
1
+setGeneric('map_to_colors', function(object, ...) standardGeneric('map_to_colors'))
2 2
 setGeneric('set_component_height', function(object, ...) standardGeneric('set_component_height'))
3
-setGeneric('row_dend', function(object, ...) standardGeneric('row_dend'))
4
-setGeneric('draw_heatmap_legend', function(object, ...) standardGeneric('draw_heatmap_legend'))
5
-setGeneric('draw_title', function(object, ...) standardGeneric('draw_title'))
6
-setGeneric('copy_all', function(object, ...) standardGeneric('copy_all'))
7
-setGeneric('add_heatmap', function(object, ...) standardGeneric('add_heatmap'))
8
-setGeneric('row_order', function(object, ...) standardGeneric('row_order'))
3
+setGeneric('draw_heatmap_body', function(object, ...) standardGeneric('draw_heatmap_body'))
9 4
 setGeneric('component_height', function(object, ...) standardGeneric('component_height'))
5
+setGeneric('re_size', function(object, ...) standardGeneric('re_size'))
10 6
 setGeneric('make_layout', function(object, ...) standardGeneric('make_layout'))
11
-setGeneric('column_order', function(object, ...) standardGeneric('column_order'))
7
+setGeneric('heatmap_legend_size', function(object, ...) standardGeneric('heatmap_legend_size'))
8
+setGeneric('get_legend_param_list', function(object, ...) standardGeneric('get_legend_param_list'))
9
+setGeneric('color_mapping_legend', function(object, ...) standardGeneric('color_mapping_legend'))
10
+setGeneric('make_column_cluster', function(object, ...) standardGeneric('make_column_cluster'))
11
+setGeneric('column_dend', function(object, ...) standardGeneric('column_dend'))
12
+setGeneric('row_order', function(object, ...) standardGeneric('row_order'))
13
+setGeneric('draw_heatmap_list', function(object, ...) standardGeneric('draw_heatmap_list'))
14
+setGeneric('row_dend', function(object, ...) standardGeneric('row_dend'))
15
+setGeneric('add_heatmap', function(object, ...) standardGeneric('add_heatmap'))
12 16
 setGeneric('set_component_width', function(object, ...) standardGeneric('set_component_width'))
13
-setGeneric('component_width', function(object, ...) standardGeneric('component_width'))
14
-setGeneric('get_color_mapping_list', function(object, ...) standardGeneric('get_color_mapping_list'))
15
-setGeneric('map_to_colors', function(object, ...) standardGeneric('map_to_colors'))
16
-setGeneric('adjust_heatmap_list', function(object, ...) standardGeneric('adjust_heatmap_list'))
17
-setGeneric('make_row_cluster', function(object, ...) standardGeneric('make_row_cluster'))
18
-setGeneric('draw', function(object, ...) standardGeneric('draw'))
17
+setGeneric('column_order', function(object, ...) standardGeneric('column_order'))
18
+setGeneric('draw_annotation_legend', function(object, ...) standardGeneric('draw_annotation_legend'))
19
+setGeneric('draw_heatmap_legend', function(object, ...) standardGeneric('draw_heatmap_legend'))
19 20
 setGeneric('annotation_legend_size', function(object, ...) standardGeneric('annotation_legend_size'))
20
-setGeneric('draw_heatmap_list', function(object, ...) standardGeneric('draw_heatmap_list'))
21 21
 setGeneric('draw_annotation', function(object, ...) standardGeneric('draw_annotation'))
22 22
 setGeneric('prepare', function(object, ...) standardGeneric('prepare'))
23 23
 setGeneric('draw_dimnames', function(object, ...) standardGeneric('draw_dimnames'))
24
-setGeneric('get_legend_param_list', function(object, ...) standardGeneric('get_legend_param_list'))
25
-setGeneric('make_column_cluster', function(object, ...) standardGeneric('make_column_cluster'))
26
-setGeneric('re_size', function(object, ...) standardGeneric('re_size'))
27
-setGeneric('column_dend', function(object, ...) standardGeneric('column_dend'))
28
-setGeneric('draw_annotation_legend', function(object, ...) standardGeneric('draw_annotation_legend'))
29
-setGeneric('heatmap_legend_size', function(object, ...) standardGeneric('heatmap_legend_size'))
30
-setGeneric('color_mapping_legend', function(object, ...) standardGeneric('color_mapping_legend'))
24
+setGeneric('draw', function(object, ...) standardGeneric('draw'))
25
+setGeneric('draw_title', function(object, ...) standardGeneric('draw_title'))
26
+setGeneric('make_row_cluster', function(object, ...) standardGeneric('make_row_cluster'))
27
+setGeneric('component_width', function(object, ...) standardGeneric('component_width'))
28
+setGeneric('get_color_mapping_list', function(object, ...) standardGeneric('get_color_mapping_list'))
31 29
 setGeneric('draw_dend', function(object, ...) standardGeneric('draw_dend'))
30
+setGeneric('adjust_heatmap_list', function(object, ...) standardGeneric('adjust_heatmap_list'))
31
+setGeneric('copy_all', function(object, ...) standardGeneric('copy_all'))
... ...
@@ -337,7 +337,7 @@ anno_simple = function(x, col, na_col = "grey",
337 337
 # == details
338 338
 # This function supports image formats in ``png``, ``svg``, ``pdf``, ``eps``, ``jpeg/jpg``, ``tiff``. 
339 339
 # ``png``, ``jpeg/jpg`` and ``tiff`` images are imported by `png::readPNG`, `jpeg::readJPEG` and 
340
-# `tiff::readTIFF`, and drawn by `grid::grid.raster`. ``svg`` images are firstly reformatted by `rsvg::rsvg_svg`
340
+# `tiff::readTIFF`, and drawn by `grid::grid.raster`. ``svg`` images are firstly reformatted by ``rsvg::rsvg_svg``
341 341
 # and then imported by `grImport2::readPicture` and drawn by `grImport2::grid.picture`. ``pdf`` and ``eps``
342 342
 # images are imported by `grImport::PostScriptTrace` and `grImport::readPicture`, later drawn by `grImport::grid.picture`.
343 343
 #
... ...
@@ -416,11 +416,15 @@ anno_image = function(image, which = c("column", "row"), border = TRUE,
416 416
 			if(!requireNamespace("grImport2")) {
417 417
 				stop_wrap("Need grImport2 package to read svg images.")
418 418
 			}
419
-			if(!requireNamespace("rsvg")) {
419
+			# if(!requireNamespace("rsvg")) {
420
+			# 	stop_wrap("Need rsvg package to convert svg images.")
421
+			# }
422
+			temp_file = tempfile()
423
+			# get it work on bioconductor build server
424
+			oe = try(getFromNamespace("rsvg_svg", ns = "rsvg")(image[i], temp_file))
425
+			if(inherits(oe, "try-error")) {
420 426
 				stop_wrap("Need rsvg package to convert svg images.")
421 427
 			}
422
-			temp_file = tempfile()
423
-			rsvg::rsvg_svg(image[i], temp_file)
424 428
 			image_list[[i]] = grImport2::readPicture(temp_file)
425 429
 			file.remove(temp_file)
426 430
 			image_class[i] = "grImport2::Picture"
... ...
@@ -25,7 +25,7 @@ anno_image(image, which = c("column", "row"), border = TRUE,
25 25
 \details{
26 26
 This function supports image formats in \code{png}, \code{svg}, \code{pdf}, \code{eps}, \code{jpeg/jpg}, \code{tiff}. 
27 27
 \code{png}, \code{jpeg/jpg} and \code{tiff} images are imported by \code{\link[png]{readPNG}}, \code{\link[jpeg]{readJPEG}} and 
28
-\code{\link[tiff]{readTIFF}}, and drawn by \code{\link[grid]{grid.raster}}. \code{svg} images are firstly reformatted by \code{\link[rsvg]{rsvg_svg}}
28
+\code{\link[tiff]{readTIFF}}, and drawn by \code{\link[grid]{grid.raster}}. \code{svg} images are firstly reformatted by \code{rsvg::rsvg_svg}
29 29
 and then imported by \code{\link[grImport2]{readPicture}} and drawn by \code{\link[grImport2]{grid.picture}}. \code{pdf} and \code{eps}
30 30
 images are imported by \code{\link[grImport]{PostScriptTrace}} and \code{\link[grImport]{readPicture}}, later drawn by \code{\link[grImport]{grid.picture}}.
31 31
 
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{component_height}.
10 10
 \code{component_height} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{component_height,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14 13
 \item \code{\link{component_height,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14
+\item \code{\link{component_height,Heatmap-method}}, \code{\link{Heatmap-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{component_width}.
10 10
 \code{component_width} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{component_width,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14 13
 \item \code{\link{component_width,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14
+\item \code{\link{component_width,Heatmap-method}}, \code{\link{Heatmap-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,12 +10,12 @@ Method dispatch page for \code{draw}.
10 10
 \code{draw} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{draw,SingleAnnotation-method}}, \code{\link{SingleAnnotation-class}} class method
14
-\item \code{\link{draw,Heatmap-method}}, \code{\link{Heatmap-class}} class method
15
-\item \code{\link{draw,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
16
-\item \code{\link{draw,Legends-method}}, \code{\link{Legends-class}} class method
17 13
 \item \code{\link{draw,AnnotationFunction-method}}, \code{\link{AnnotationFunction-class}} class method
14
+\item \code{\link{draw,Legends-method}}, \code{\link{Legends-class}} class method
18 15
 \item \code{\link{draw,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
16
+\item \code{\link{draw,SingleAnnotation-method}}, \code{\link{SingleAnnotation-class}} class method
17
+\item \code{\link{draw,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
18
+\item \code{\link{draw,Heatmap-method}}, \code{\link{Heatmap-class}} class method
19 19
 }
20 20
 }
21 21
 \examples{
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{make_layout}.
10 10
 \code{make_layout} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{make_layout,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14 13
 \item \code{\link{make_layout,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14
+\item \code{\link{make_layout,Heatmap-method}}, \code{\link{Heatmap-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{row_order}.
10 10
 \code{row_order} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{row_order,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14 13
 \item \code{\link{row_order,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14
+\item \code{\link{row_order,Heatmap-method}}, \code{\link{Heatmap-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,12 +10,12 @@ Method dispatch page for \code{show}.
10 10
 \code{show} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{show,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14
-\item \code{\link{show,SingleAnnotation-method}}, \code{\link{SingleAnnotation-class}} class method
15
-\item \code{\link{show,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
16 13
 \item \code{\link{show,ColorMapping-method}}, \code{\link{ColorMapping-class}} class method
17
-\item \code{\link{show,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
18 14
 \item \code{\link{show,AnnotationFunction-method}}, \code{\link{AnnotationFunction-class}} class method
15
+\item \code{\link{show,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
16
+\item \code{\link{show,SingleAnnotation-method}}, \code{\link{SingleAnnotation-class}} class method
17
+\item \code{\link{show,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
18
+\item \code{\link{show,Heatmap-method}}, \code{\link{Heatmap-class}} class method
19 19
 }
20 20
 }
21 21
 \examples{