... | ... |
@@ -8,9 +8,7 @@ Maintainer: Zuguang Gu <z.gu@dkfz.de> |
8 | 8 |
Depends: R (>= 3.1.2), methods, grid, graphics, stats, grDevices |
9 | 9 |
Imports: circlize (>= 0.4.1), GetoptLong, colorspace, |
10 | 10 |
RColorBrewer, GlobalOptions (>= 0.1.0) |
11 |
-Suggests: testthat (>= 0.3), knitr, markdown, cluster, MASS, pvclust, |
|
12 |
- dendsort, HilbertCurve (>= 1.11.1), Cairo, png, jpeg, tiff, fastcluster, |
|
13 |
- dendextend (>= 1.0.1), grImport, grImport2, rsvg, glue |
|
11 |
+Suggests: testthat (>= 0.3), knitr, markdown |
|
14 | 12 |
VignetteBuilder: knitr |
15 | 13 |
Description: Complex heatmaps are efficient to visualize associations |
16 | 14 |
between different sources of data sets and reveal potential patterns. |
... | ... |
@@ -1,31 +1,31 @@ |
1 |
-setGeneric('map_to_colors', function(object, ...) standardGeneric('map_to_colors')) |
|
2 |
-setGeneric('set_component_height', function(object, ...) standardGeneric('set_component_height')) |
|
3 |
-setGeneric('draw_heatmap_body', function(object, ...) standardGeneric('draw_heatmap_body')) |
|
4 |
-setGeneric('component_height', function(object, ...) standardGeneric('component_height')) |
|
5 |
-setGeneric('re_size', function(object, ...) standardGeneric('re_size')) |
|
6 |
-setGeneric('make_layout', function(object, ...) standardGeneric('make_layout')) |
|
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 | 1 |
setGeneric('make_column_cluster', function(object, ...) standardGeneric('make_column_cluster')) |
2 |
+setGeneric('draw_annotation', function(object, ...) standardGeneric('draw_annotation')) |
|
3 |
+setGeneric('draw_dimnames', function(object, ...) standardGeneric('draw_dimnames')) |
|
11 | 4 |
setGeneric('column_dend', function(object, ...) standardGeneric('column_dend')) |
5 |
+setGeneric('draw_dend', function(object, ...) standardGeneric('draw_dend')) |
|
6 |
+setGeneric('draw_annotation_legend', function(object, ...) standardGeneric('draw_annotation_legend')) |
|
7 |
+setGeneric('set_component_width', function(object, ...) standardGeneric('set_component_width')) |
|
8 |
+setGeneric('make_row_cluster', function(object, ...) standardGeneric('make_row_cluster')) |
|
9 |
+setGeneric('make_layout', function(object, ...) standardGeneric('make_layout')) |
|
10 |
+setGeneric('prepare', function(object, ...) standardGeneric('prepare')) |
|
12 | 11 |
setGeneric('row_order', function(object, ...) standardGeneric('row_order')) |
12 |
+setGeneric('draw_heatmap_body', function(object, ...) standardGeneric('draw_heatmap_body')) |
|
13 |
+setGeneric('heatmap_legend_size', function(object, ...) standardGeneric('heatmap_legend_size')) |
|
14 |
+setGeneric('set_component_height', function(object, ...) standardGeneric('set_component_height')) |
|
15 |
+setGeneric('component_width', function(object, ...) standardGeneric('component_width')) |
|
13 | 16 |
setGeneric('draw_heatmap_list', function(object, ...) standardGeneric('draw_heatmap_list')) |
17 |
+setGeneric('draw', function(object, ...) standardGeneric('draw')) |
|
18 |
+setGeneric('annotation_legend_size', function(object, ...) standardGeneric('annotation_legend_size')) |
|
19 |
+setGeneric('color_mapping_legend', function(object, ...) standardGeneric('color_mapping_legend')) |
|
20 |
+setGeneric('re_size', function(object, ...) standardGeneric('re_size')) |
|
14 | 21 |
setGeneric('row_dend', function(object, ...) standardGeneric('row_dend')) |
15 |
-setGeneric('add_heatmap', function(object, ...) standardGeneric('add_heatmap')) |
|
16 |
-setGeneric('set_component_width', function(object, ...) standardGeneric('set_component_width')) |
|
22 |
+setGeneric('get_legend_param_list', function(object, ...) standardGeneric('get_legend_param_list')) |
|
23 |
+setGeneric('get_color_mapping_list', function(object, ...) standardGeneric('get_color_mapping_list')) |
|
24 |
+setGeneric('draw_title', function(object, ...) standardGeneric('draw_title')) |
|
25 |
+setGeneric('copy_all', function(object, ...) standardGeneric('copy_all')) |
|
26 |
+setGeneric('component_height', function(object, ...) standardGeneric('component_height')) |
|
27 |
+setGeneric('map_to_colors', function(object, ...) standardGeneric('map_to_colors')) |
|
17 | 28 |
setGeneric('column_order', function(object, ...) standardGeneric('column_order')) |
18 |
-setGeneric('draw_annotation_legend', function(object, ...) standardGeneric('draw_annotation_legend')) |
|
19 | 29 |
setGeneric('draw_heatmap_legend', function(object, ...) standardGeneric('draw_heatmap_legend')) |
20 |
-setGeneric('annotation_legend_size', function(object, ...) standardGeneric('annotation_legend_size')) |
|
21 |
-setGeneric('draw_annotation', function(object, ...) standardGeneric('draw_annotation')) |
|
22 |
-setGeneric('prepare', function(object, ...) standardGeneric('prepare')) |
|
23 |
-setGeneric('draw_dimnames', function(object, ...) standardGeneric('draw_dimnames')) |
|
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')) |
|
29 |
-setGeneric('draw_dend', function(object, ...) standardGeneric('draw_dend')) |
|
30 | 30 |
setGeneric('adjust_heatmap_list', function(object, ...) standardGeneric('adjust_heatmap_list')) |
31 |
-setGeneric('copy_all', function(object, ...) standardGeneric('copy_all')) |
|
31 |
+setGeneric('add_heatmap', function(object, ...) standardGeneric('add_heatmap')) |
... | ... |
@@ -1,3 +1,5 @@ |
1 |
+<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/"><img src="https://jokergoo.github.io/ComplexHeatmap-reference/book/complexheatmap-cover.jpg" width=240 align="right" style="border:2px solid black;" ></a> |
|
2 |
+ |
|
1 | 3 |
[](https://travis-ci.org/jokergoo/ComplexHeatmap) |
2 | 4 |
[](https://codecov.io/github/jokergoo/ComplexHeatmap) |
3 | 5 |
[](https://bioconductor.org/packages/stats/bioc/ComplexHeatmap/) |
... | ... |
@@ -6,40 +8,18 @@ |
6 | 8 |
|
7 | 9 |
## Make Complex Heatmaps |
8 | 10 |
|
9 |
-Complex heatmaps are efficient to visualize associations |
|
10 |
-between different sources of data sets and reveal potential structures. |
|
11 |
-Here the **ComplexHeatmap** package provides a highly flexible way to arrange |
|
12 |
-multiple heatmaps and supports self-defined annotation graphics. |
|
11 |
+Complex heatmaps are efficient to visualize associations between different |
|
12 |
+sources of data sets and reveal potential patterns. Here the |
|
13 |
+**ComplexHeatmap** package provides a highly flexible way to arrange multiple |
|
14 |
+heatmaps and supports various annotation graphics. |
|
13 | 15 |
|
14 | 16 |
### Citation |
15 | 17 |
|
16 | 18 |
Zuguang Gu, Roland Eils and Matthias Schlesner, [Complex heatmaps reveal patterns and correlations in multidimensional genomic data](http://bioinformatics.oxfordjournals.org/content/early/2016/05/20/bioinformatics.btw313.abstract), Bioinformatics, 2016 |
17 | 19 |
|
18 |
-### General design |
|
19 |
- |
|
20 |
-Generally, a heatmap list contains several heatmaps and row annotations. |
|
21 |
- |
|
22 |
- |
|
23 |
- |
|
24 |
-Surrounding the heatmap list, |
|
25 |
-there are legends for heatmaps and annotations, also there are titles which are placed |
|
26 |
-on the four sides of the heatmap list. And for each heatmap, there are also different components |
|
27 |
-surrounding the heatmap body. |
|
28 |
- |
|
29 |
-The **ComplexHeatmap** package is implemented in an object-oriented way. To describe a heatmap list, |
|
30 |
-there are following classes: |
|
31 |
- |
|
32 |
-- `Heatmap` class: a single heatmap containing heatmap body, row/column names, titles, dendrograms and column annotations. |
|
33 |
-- `HeatmapList` class: a list of heatmaps and row annotations. |
|
34 |
-- `HeatmapAnnotation` class: defines a list of row annotations and column annotations. |
|
35 |
- |
|
36 |
-There are also several internal classes: |
|
37 |
- |
|
38 |
-- `SingleAnnotation` class: defines a single row annotation or column annotation. |
|
39 |
-- `ColorMapping` class: mapping from values to colors. |
|
20 |
+### Documentation |
|
40 | 21 |
|
41 |
-**ComplexHeatmap** is implemented under **grid** system, so users should know basic **grid** functionality |
|
42 |
-to get full use of the package. |
|
22 |
+The full documentations are available at https://jokergoo.github.io/ComplexHeatmap-reference/book/. |
|
43 | 23 |
|
44 | 24 |
### Install |
45 | 25 |
|
... | ... |
@@ -85,108 +65,25 @@ ha = HeatmapAnnotation(df = anno1, anno_fun = anno2, ..., which = "row") |
85 | 65 |
Heatmap(mat1, ...) + Heatmap(mat2, ...) + ha |
86 | 66 |
``` |
87 | 67 |
|
88 |
-### As a base package |
|
89 |
- |
|
90 |
-**ComplexHeatmap** can be used as a base package to build other packages which focus |
|
91 |
-On specific applications. E.g. [EnrichedHeatmap](http://github.com/jokergoo/EnrichedHeatmap) package |
|
92 |
-uses **ComplexHeatmap** as base to make heatmaps which visualize the enrichment of genomic signals |
|
93 |
-to specific target regions. |
|
94 |
- |
|
95 |
-### Vignettes |
|
96 |
- |
|
97 |
-There are several vignettes in the package. Each vignette focuses on a specific topic. Following |
|
98 |
-lists the general topics discussed in these vignettes: |
|
99 |
- |
|
100 |
- 1. [**Making a Single Heatmap**](http://www.bioconductor.org/packages/devel/bioc/vignettes/ComplexHeatmap/inst/doc/s2.single_heatmap.html) |
|
101 |
- |
|
102 |
- This vignette introduces the basic configuration for making a single heatmap. Similar as other |
|
103 |
- R functions/packages, the basic usage is quite similar, but there are several unique features |
|
104 |
- for **ComplexHeamtap** package. |
|
105 |
- - Works both for numeric matrix and character matrix |
|
106 |
- - For numeric matrix which contains continuous values, the package allows a color mapping function |
|
107 |
- which can give more accurate colors and be robust to outliers. |
|
108 |
- - Highly flexible for clustering. You can define the distance method for clustering by: |
|
109 |
- * a pre-defined distance such as "euclidean" or "pearson" |
|
110 |
- * a self-defined function which calculates distance from a matrix. |
|
111 |
- * a self-defined function which calculates distance from two vectors |
|
112 |
- |
|
113 |
- You can define the clustering method by: |
|
114 |
- * a clustering function such as `diana()` from **cluster** package |
|
115 |
- * a `hclust` or `dendrogram` object. |
|
116 |
- - `NA` is allowed for clustering and heatmap visualization. |
|
117 |
- - Dendrogram and dimension names can be put on any side of the heatmap. |
|
118 |
- - Rows on the heatmap can be split by `cutree`, by `kmeans` or by a data frame which contains |
|
119 |
- different levels that split the heatmap. |
|
120 |
- - The heatmap body itself can be completely self-defined. |
|
121 |
- |
|
122 |
- 2. [**Making a List of Heatmaps**](http://www.bioconductor.org/packages/devel/bioc/vignettes/ComplexHeatmap/inst/doc/s3.a_list_of_heatmaps.html) |
|
123 |
- |
|
124 |
- This vignette introduces how to concatenate a list of heatmaps and how adjustment is applied to keep |
|
125 |
- the correspondence of the heatmaps. |
|
68 |
+### Examples |
|
126 | 69 |
|
127 |
- 3. [**Heatmap Annotations**](http://www.bioconductor.org/packages/devel/bioc/vignettes/ComplexHeatmap/inst/doc/s4.heatmap_annotation.html) |
|
70 |
+#### Visualize Methylation Profile with Complex Annotations |
|
128 | 71 |
|
129 |
- This vignette introduces the concept of the heatmap annotation and demonstrate how to make simple annotations |
|
130 |
- as well as complex annotations. Also, the vignette explains the difference between column annotations |
|
131 |
- and row annotations. |
|
72 |
+ |
|
132 | 73 |
|
133 |
- 4. [**Heatmap and Annotation Legends**](http://www.bioconductor.org/packages/devel/bioc/vignettes/ComplexHeatmap/inst/doc/s5.legend.html) |
|
74 |
+#### Correlations between methylation, expression and other genomic features |
|
134 | 75 |
|
135 |
- This vignette introduces how to configurate the heatmap legend and annotation legend, also |
|
136 |
- how to add self-defined legends. |
|
76 |
+ |
|
137 | 77 |
|
138 |
- 5. [**Heatmap Decoration**](http://www.bioconductor.org/packages/devel/bioc/vignettes/ComplexHeatmap/inst/doc/s6.heatmap_decoration.html) |
|
78 |
+#### Visualize Cell Heterogeneity from Single Cell RNASeq |
|
139 | 79 |
|
140 |
- This vignette introduces methods to add more self-defined graphics to the heatmaps after the heatmaps |
|
141 |
- are generated. |
|
80 |
+ |
|
142 | 81 |
|
143 |
- 6. [**Interactive with Heatmaps**](http://www.bioconductor.org/packages/devel/bioc/vignettes/ComplexHeatmap/inst/doc/s7.interactive.html) |
|
82 |
+#### Making Enhanced OncoPrint |
|
144 | 83 |
|
145 |
- How to select a region in the heatmap to retrieve the sub-matrix. |
|
146 |
- |
|
147 |
- 7. [**OncoPrint**](http://www.bioconductor.org/packages/devel/bioc/vignettes/ComplexHeatmap/inst/doc/s8.oncoprint.html) |
|
148 |
- |
|
149 |
- How to make an oncoPrint. |
|
150 |
- |
|
151 |
- 8. [**Examples**](http://www.bioconductor.org/packages/devel/bioc/vignettes/ComplexHeatmap/inst/doc/s9.examples.html) |
|
152 |
- |
|
153 |
- More simulated and real-world examples are shown in this vignette. |
|
154 |
- |
|
155 |
- |
|
156 |
-### Visualize high dimensional genomic data |
|
157 |
- |
|
158 |
-The examples visualizes correlation between methylation and expression, as well as other annotation information (data are randomly generated). In the heatmap, each row corresponds to a differentially methylated regions (DMRs). |
|
159 |
-From left to right, heatmaps are: |
|
160 |
- |
|
161 |
-1. methylation for each DMRs in samples. |
|
162 |
-2. direction of the methylation (one column heatmap), i.e. is methylation hyper in tumor or hypo? |
|
163 |
-3. expression for the genes that are associated with corresponding DMRs (e.g. closest gene). |
|
164 |
-4. signiciance for the correlation between methylation and expression (-log10(p-value)). |
|
165 |
-5. type of genes, i.e. is the gene a protein coding gene or a lincRNA? |
|
166 |
-6. annotation to gene models, i.e. is the DMR located in the intragenic region of the corresponding gene or the DMR is intergenic? |
|
167 |
-7. distance from the DMR to the TSS of the corresponding gene. |
|
168 |
-8. overlapping between DMRs and enhancers (Color shows how much the DMR is covered by the enhancers). |
|
169 |
- |
|
170 |
- |
|
171 |
- |
|
172 |
-### OncoPrint |
|
173 |
- |
|
174 |
-<a href="http://www.cbioportal.org/faq.jsp#what-are-oncoprints">OncoPrint</a> visualize multiple genomic alteration |
|
175 |
-events through a heatmap. From verion 1.3.0, **ComplexHeatmap** package provides a new `oncoPrint()` function. By this |
|
176 |
-function, users can define their own graphics which correspond to differnet alteration events. Also the function additionally |
|
177 |
-add barplots on two sides of the heatmap which tell number of different alterations in patients or samples. |
|
178 |
- |
|
179 |
-With general functionality of **ComplexHeamtap**, you can add more heatmaps / row annotations to the oncoPrint, even split the |
|
180 |
-oncoPrint to enphasize sub groups. |
|
181 |
- |
|
182 |
- |
|
183 |
- |
|
184 |
-### Interact with heatmaps |
|
185 |
- |
|
186 |
-You can use mouse to select a region on the heatmap, it will return row index and column index which correspond to the selected region. |
|
187 |
- |
|
188 |
-<p><img src="https://cloud.githubusercontent.com/assets/449218/10479344/2981c27a-7264-11e5-9868-7400c5dc620d.gif", width="600"></p> |
|
84 |
+ |
|
189 | 85 |
|
190 | 86 |
### License |
191 | 87 |
|
192 |
-GPL (>= 2) |
|
88 |
+MIT @ Zuguang Gu |
|
89 |
+ |
... | ... |
@@ -10,9 +10,9 @@ Method dispatch page for \code{add_heatmap}. |
10 | 10 |
\code{add_heatmap} can be dispatched on following classes: |
11 | 11 |
|
12 | 12 |
\itemize{ |
13 |
-\item \code{\link{add_heatmap,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method |
|
14 |
-\item \code{\link{add_heatmap,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
15 | 13 |
\item \code{\link{add_heatmap,Heatmap-method}}, \code{\link{Heatmap-class}} class method |
14 |
+\item \code{\link{add_heatmap,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
15 |
+\item \code{\link{add_heatmap,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method |
|
16 | 16 |
} |
17 | 17 |
} |
18 | 18 |
\examples{ |
... | ... |
@@ -10,8 +10,8 @@ Method dispatch page for \code{column_dend}. |
10 | 10 |
\code{column_dend} can be dispatched on following classes: |
11 | 11 |
|
12 | 12 |
\itemize{ |
13 |
-\item \code{\link{column_dend,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
14 | 13 |
\item \code{\link{column_dend,Heatmap-method}}, \code{\link{Heatmap-class}} class method |
14 |
+\item \code{\link{column_dend,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
15 | 15 |
} |
16 | 16 |
} |
17 | 17 |
\examples{ |
... | ... |
@@ -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,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
14 | 13 |
\item \code{\link{component_height,Heatmap-method}}, \code{\link{Heatmap-class}} class method |
14 |
+\item \code{\link{component_height,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
15 | 15 |
} |
16 | 16 |
} |
17 | 17 |
\examples{ |
... | ... |
@@ -10,8 +10,8 @@ Method dispatch page for \code{copy_all}. |
10 | 10 |
\code{copy_all} can be dispatched on following classes: |
11 | 11 |
|
12 | 12 |
\itemize{ |
13 |
-\item \code{\link{copy_all,AnnotationFunction-method}}, \code{\link{AnnotationFunction-class}} class method |
|
14 | 13 |
\item \code{\link{copy_all,SingleAnnotation-method}}, \code{\link{SingleAnnotation-class}} class method |
14 |
+\item \code{\link{copy_all,AnnotationFunction-method}}, \code{\link{AnnotationFunction-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 |
|
13 | 15 |
\item \code{\link{draw,AnnotationFunction-method}}, \code{\link{AnnotationFunction-class}} class method |
14 | 16 |
\item \code{\link{draw,Legends-method}}, \code{\link{Legends-class}} class method |
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 | 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 |
|
18 |
+\item \code{\link{draw,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method |
|
19 | 19 |
} |
20 | 20 |
} |
21 | 21 |
\examples{ |
... | ... |
@@ -10,8 +10,8 @@ Method dispatch page for \code{draw_title}. |
10 | 10 |
\code{draw_title} can be dispatched on following classes: |
11 | 11 |
|
12 | 12 |
\itemize{ |
13 |
-\item \code{\link{draw_title,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
14 | 13 |
\item \code{\link{draw_title,Heatmap-method}}, \code{\link{Heatmap-class}} class method |
14 |
+\item \code{\link{draw_title,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
15 | 15 |
} |
16 | 16 |
} |
17 | 17 |
\examples{ |
... | ... |
@@ -10,8 +10,8 @@ Method dispatch page for \code{row_dend}. |
10 | 10 |
\code{row_dend} can be dispatched on following classes: |
11 | 11 |
|
12 | 12 |
\itemize{ |
13 |
-\item \code{\link{row_dend,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
14 | 13 |
\item \code{\link{row_dend,Heatmap-method}}, \code{\link{Heatmap-class}} class method |
14 |
+\item \code{\link{row_dend,HeatmapList-method}}, \code{\link{HeatmapList-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,ColorMapping-method}}, \code{\link{ColorMapping-class}} class method |
|
14 | 13 |
\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 |
|
14 |
+\item \code{\link{show,ColorMapping-method}}, \code{\link{ColorMapping-class}} class method |
|
16 | 15 |
\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 | 16 |
\item \code{\link{show,Heatmap-method}}, \code{\link{Heatmap-class}} class method |
17 |
+\item \code{\link{show,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method |
|
18 |
+\item \code{\link{show,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method |
|
19 | 19 |
} |
20 | 20 |
} |
21 | 21 |
\examples{ |
... | ... |
@@ -3,3 +3,124 @@ |
3 | 3 |
%\VignetteIndexEntry{Difference to older versions} |
4 | 4 |
--> |
5 | 5 |
|
6 |
+ |
|
7 |
+Difference to Older Versions of ComplexHeatmap |
|
8 |
+================================================= |
|
9 |
+ |
|
10 |
+**Author**: Zuguang Gu ( z.gu@dkfz.de ) |
|
11 |
+ |
|
12 |
+**Date**: `r Sys.Date()` |
|
13 |
+ |
|
14 |
+**Package version**: `r installed.packages()["ComplexHeatmap", "Version"]` |
|
15 |
+ |
|
16 |
+--------------------------------------- |
|
17 |
+ |
|
18 |
+```{r, echo = FALSE, message = FALSE} |
|
19 |
+library(markdown) |
|
20 |
+options(markdown.HTML.options = c(options('markdown.HTML.options')[[1]], "toc")) |
|
21 |
+library(knitr) |
|
22 |
+knitr::opts_chunk$set( |
|
23 |
+ error = FALSE, |
|
24 |
+ tidy = FALSE, |
|
25 |
+ message = FALSE, |
|
26 |
+ fig.align = "center", |
|
27 |
+ fig.width = 6, |
|
28 |
+ fig.height = 6) |
|
29 |
+options(markdown.HTML.stylesheet = "custom.css") |
|
30 |
+options(width = 100) |
|
31 |
+``` |
|
32 |
+ |
|
33 |
+From version 2.0.0 of **ComplexHeatmap**, there are big changes to the older versions. The major |
|
34 |
+functionalities are still the same, but still it is not 100% compatible. This vignette lists the |
|
35 |
+changes between the new and old versions. |
|
36 |
+ |
|
37 |
+## Heatmap() function |
|
38 |
+ |
|
39 |
+- New arguments `column_km` and `column_split` to split heatmap by columns. The old `km` and `split` |
|
40 |
+ are renamed to `row_km` and `row_split`, although `km` and `split` are still usable. |
|
41 |
+- A new argument `border` controls the border of the heatmap body. If heatmap is split into slices, |
|
42 |
+ all the slices will have borders. |
|
43 |
+- Row title and column title allow background color by `column_title_gp = gpar(fill = ...)`. |
|
44 |
+- `cluster_rows` and `cluster_columns` also allows objects which can be converted to `dendrogram`. |
|
45 |
+- If `cluster_rows` and `cluster_columns` are provided as clustering object, dendrogram reordering |
|
46 |
+ is turned off by default. |
|
47 |
+- Add examples of how to integerat seriation |
|
48 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#heatmap-seriation) |
|
49 |
+- Row names and column names allow rotation by `row_names_rot` and `column_names_rot`. |
|
50 |
+- New arguments `row_labels` and `column_labels` which can be set to replace row names and column |
|
51 |
+ names on the heatmap. |
|
52 |
+- When heatmap is split and clustering is performed, there is a parent dendrogram which is |
|
53 |
+ calculated from mean value in slices and put on top of the children dendrograms. There is a dashed |
|
54 |
+ line showing the part of the parent dendrogram and emphasize the dendrogram is combined from |
|
55 |
+ several dendrograms. |
|
56 |
+- Remove `combined_name_fun` argument and control the titles for the heatmap slices directly by |
|
57 |
+ `row_title` and `column_title`. The two arguments support a string template which is convinient to |
|
58 |
+ control the title for each slice. |
|
59 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#titles-for-splitting) |
|
60 |
+- New argument `layer_fun` is a vectorized version of `cell_fun`. This functionality is too |
|
61 |
+ low-level and normally users will not use it. |
|
62 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#customize-the-heatmap-body) |
|
63 |
+- New argument: `width`, `heatmap_width`, `height`, `heatmap_height` to control the size of the |
|
64 |
+ heatmap. |
|
65 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#size-of-the-heatmap) |
|
66 |
+- New argument: `left_annotation` and `right_annotation`. |
|
67 |
+- Remove `top_annotation_height` and `bottom_annotation_height`. The height of annotations should be |
|
68 |
+ set in `HeatmapAnnotation()` function. |
|
69 |
+ |
|
70 |
+## HeatmapAnnotation() function |
|
71 |
+ |
|
72 |
+- All annotations have default width/height now. E.g. the column simple annotation has height of 5mm |
|
73 |
+ and the column barplot annotation has height of 1cm. |
|
74 |
+- Provide more annotation functions: `anno_empty()`, `anno_simple`, `anno_image()`, `anno_block()`, |
|
75 |
+ `anno_lines()`, `anno_joyplot()`, `anno_horizon()`, `anno_summary()`. |
|
76 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html) |
|
77 |
+- The size of the annotations are better to be set in the annotation function, e.g. |
|
78 |
+ `anno_points(..., height = )`, but you can still set `annotation_height`. |
|
79 |
+- The axis for the annotations (e.g. `anno_points()`, ...) can be controlled by the `axis_param` |
|
80 |
+ argument in the annotation function. |
|
81 |
+- `anno_link()` is now renamed to `anno_mark()`. This annotation has default width and no need to |
|
82 |
+ manually calcualte. |
|
83 |
+- `anno_text()`: the size of the annotation is automatically calculated. |
|
84 |
+- By default, the annotation names and axes are drawn and the space for them are also taken into |
|
85 |
+ account for the layout of the final heatmap. |
|
86 |
+- Two `HeatmapAnnotation` objects can be added as a single `HeatmapAnnotation` object by `c()`. |
|
87 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html#heatmap-annotation-utility-function) |
|
88 |
+ |
|
89 |
+## A list of heatmaps |
|
90 |
+ |
|
91 |
+- Heatmaps and annotations can be concatenated vertically by `%v%`. |
|
92 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#vertical-concatenation) |
|
93 |
+- More arguments for the main heatmap can be controlled directly in `draw()`. |
|
94 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#control-main-heatmap-in-draw-function) |
|
95 |
+- Annotations and column names are nicely adjusted. |
|
96 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#annotations-as-components-are-adjusted) |
|
97 |
+ |
|
98 |
+## Legends |
|
99 |
+ |
|
100 |
+- Legends are reimplemented as a `gTree` object internally. `Legend()` and `packLegend()` all |
|
101 |
+ returns a `Legends` object. This object can be treated as a graphic element and to draw by |
|
102 |
+ specifying the positions of the legends on the plot. |
|
103 |
+ (https://jokergoo.github.io/ComplexHeatmap-reference/book/legends.html) |
|
104 |
+- Positions of legend labels are automatically adjusted if they overlap. |
|
105 |
+- A list of legends are automatically wrapped into multiple columns or rows if they are too long and |
|
106 |
+ exceed the plotting region. |
|
107 |
+ |
|
108 |
+## oncoPrint() function |
|
109 |
+ |
|
110 |
+- It automatially tests whether functions in `alter_fun` are vectorized. |
|
111 |
+- The oncoPrint barplot annotations are now controlled by `anno_oncoprint_barplot()` and they are |
|
112 |
+ basically normal heatmap annotations. Also axes is controlled in `anno_oncoprint_barplot()`. |
|
113 |
+- `barplot_ignore` is removed and the subset of alterations in directly controlled in |
|
114 |
+ `anno_oncoprint_barplot()`. |
|
115 |
+- Similar as `Heatmap()`, all the argument related to the size of annotations are removed and they |
|
116 |
+ should be set directly in `HeatmapAnnotation()` or `anno_oncoprint_barplot()`. |
|
117 |
+- New arguments `remove_empty_rows` and `remove_empty_columns`. If the number of rows and columns |
|
118 |
+ gets smaller, all the oncoPrint component (e.g. row names, annotations) will be adjusted as well. |
|
119 |
+- `oncoPrint()` now returns a `Heatmap` object which can be concatenated to other |
|
120 |
+ heatmaps/annotations horizontally or vertically. |
|
121 |
+ |
|
122 |
+## densityHeatmap() function |
|
123 |
+ |
|
124 |
+- Columns can be clustered by the Kolmogorov-Smirnov statistic between distributions. |
|
125 |
+- `densityHeatmap()` returns a vertical heatmap that more heatmaps and annotations can concatenate |
|
126 |
+ to it vertically. |
... | ... |
@@ -3,3 +3,67 @@ |
3 | 3 |
%\VignetteIndexEntry{Most probably asked questions} |
4 | 4 |
--> |
5 | 5 |
|
6 |
+Most Probably Asked Questions |
|
7 |
+================================================= |
|
8 |
+ |
|
9 |
+**Author**: Zuguang Gu ( z.gu@dkfz.de ) |
|
10 |
+ |
|
11 |
+**Date**: `r Sys.Date()` |
|
12 |
+ |
|
13 |
+**Package version**: `r installed.packages()["ComplexHeatmap", "Version"]` |
|
14 |
+ |
|
15 |
+--------------------------------------- |
|
16 |
+ |
|
17 |
+```{r, echo = FALSE, message = FALSE} |
|
18 |
+library(markdown) |
|
19 |
+options(markdown.HTML.options = c(options('markdown.HTML.options')[[1]], "toc")) |
|
20 |
+library(knitr) |
|
21 |
+knitr::opts_chunk$set( |
|
22 |
+ error = FALSE, |
|
23 |
+ tidy = FALSE, |
|
24 |
+ message = FALSE, |
|
25 |
+ fig.align = "center", |
|
26 |
+ fig.width = 6, |
|
27 |
+ fig.height = 6) |
|
28 |
+options(markdown.HTML.stylesheet = "custom.css") |
|
29 |
+options(width = 100) |
|
30 |
+``` |
|
31 |
+ |
|
32 |
+## There is no plot comming out after running `Heatmap()` function. |
|
33 |
+ |
|
34 |
+In this case, you need to use `draw()` function explicitly. See https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#plot-the-heatmap. |
|
35 |
+ |
|
36 |
+## Retrieve orders and dendrograms. |
|
37 |
+ |
|
38 |
+For retrieving orders and dendrograms from a single heatmap, see https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#get-orders-and-dendrograms-from-heatmap. |
|
39 |
+ |
|
40 |
+For retrieving orders and dendrograms from a list of heatmaps, see https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#get-orders-and-dendrograms |
|
41 |
+ |
|
42 |
+## How to control the style of legends. |
|
43 |
+ |
|
44 |
+The style of legends can be controlled by `heatmap_legend_param` in `Heatmap()`, or |
|
45 |
+`annotation_legend_param` in `HeatmapAnnotation()`. The parameters for controlling legends are those |
|
46 |
+arguments in `Legend()` function, see |
|
47 |
+https://jokergoo.github.io/ComplexHeatmap-reference/book/legends.html#heatmap-and-annotation-legends. |
|
48 |
+ |
|
49 |
+## Some text are cut by the plotting region |
|
50 |
+ |
|
51 |
+The layout of the **ComplexHeatmap** is not perfect that it is still possible some of the text are |
|
52 |
+drawn out of the plotting region. In this case, you set the `padding` argument in `draw()` function |
|
53 |
+to increase the blank areas around the final plot. |
|
54 |
+ |
|
55 |
+## Can the heatmaps be added vertically? |
|
56 |
+ |
|
57 |
+Yes, use `%v%` instead of `+`. |
|
58 |
+ |
|
59 |
+## Does Heatmap titles supports mathematical expression? |
|
60 |
+ |
|
61 |
+Yes, all the text-related elements (e.g. titles, row names, legend titles, legend labels, ...) allow |
|
62 |
+methematical expression. |
|
63 |
+ |
|
64 |
+## I have many heatmaps and I want to them into panels for a big figure for my paper. |
|
65 |
+ |
|
66 |
+You can set `newpage = FALSE` in `draw()` function and use `grid.layout()` to manage the layout of |
|
67 |
+your panels. But I suggest more to use `grid.grabExpr()` to directly capture the output of the |
|
68 |
+heatmap and later draw the whole plot as a single graphic element by `grid.draw()`. |
|
69 |
+ |
|
6 | 70 |
\ No newline at end of file |