CircosHeatmap-aardio/dist/lib/r-library/ComplexHeatmap/doc/most_probably_asked_questions.html

318 lines
63 KiB
HTML
Raw Normal View History

2025-01-12 00:52:51 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Most probably asked questions</title>
<style type="text/css">
/**
* Prism.s theme ported from highlight.js's xcode style
*/
pre code {
padding: 1em;
}
.token.comment {
color: #007400;
}
.token.punctuation {
color: #999;
}
.token.tag,
.token.selector {
color: #aa0d91;
}
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
color: #1c00cf;
}
.token.property,
.token.attr-name,
.token.string,
.token.char,
.token.builtin {
color: #c41a16;
}
.token.inserted {
background-color: #ccffd8;
}
.token.deleted {
background-color: #ffebe9;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #836c28;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #5c2699;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
</style>
<style type="text/css">
body {
font-family: sans-serif;
max-width: 800px;
margin: auto;
padding: 1em;
line-height: 1.5;
box-sizing: border-box;
}
body, .footnotes, code { font-size: .9em; }
li li { font-size: .95em; }
*, *:before, *:after {
box-sizing: inherit;
}
pre, img { max-width: 100%; }
pre, pre:hover {
white-space: pre-wrap;
word-break: break-all;
}
pre code {
display: block;
overflow-x: auto;
}
code { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }
:not(pre) > code, code[class] { background-color: #F8F8F8; }
code.language-undefined, pre > code:not([class]) {
background-color: inherit;
border: 1px solid #eee;
}
table {
margin: auto;
border-top: 1px solid #666;
}
table thead th { border-bottom: 1px solid #ddd; }
th, td { padding: 5px; }
thead, tfoot, tr:nth-child(even) { background: #eee; }
blockquote {
color: #666;
margin: 0;
padding-left: 1em;
border-left: 0.5em solid #eee;
}
hr, .footnotes::before { border: 1px dashed #ddd; }
.frontmatter { text-align: center; }
#TOC .numbered li { list-style: none; }
#TOC .numbered { padding-left: 0; }
#TOC .numbered ul { padding-left: 1em; }
table, .body h2 { border-bottom: 1px solid #666; }
.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }
.footnote-ref a::before { content: "["; }
.footnote-ref a::after { content: "]"; }
section.footnotes::before {
content: "";
display: block;
max-width: 20em;
}
@media print {
body {
font-size: 12pt;
max-width: 100%;
}
tr, img { page-break-inside: avoid; }
}
@media only screen and (min-width: 992px) {
pre { white-space: pre; }
}
</style>
</head>
<body>
<div class="frontmatter">
<div class="title"><h1>Most probably asked questions</h1></div>
<div class="author"><h2></h2></div>
<div class="date"><h3></h3></div>
</div>
<div class="body">
<div id="TOC">
<ul>
<li><a href="#most-probably-asked-questions">Most probably asked questions</a>
<ul>
<li><a href="#there-is-no-plot-coming-out-after-running-heatmap-function">There is no plot coming out after running Heatmap() function.</a></li>
<li><a href="#retrieve-orders-and-dendrograms">Retrieve orders and dendrograms.</a></li>
<li><a href="#how-should-i-control-the-height-or-width-of-the-heatmap-annotations">How should I control the height or width of the heatmap annotations?</a></li>
<li><a href="#how-should-i-control-the-axes-of-the-annotations">How should I control the axes of the annotations?</a></li>
<li><a href="#how-to-control-the-style-of-legends">How to control the style of legends?</a></li>
<li><a href="#some-text-are-cut-by-the-plotting-region">Some text are cut by the plotting region.</a></li>
<li><a href="#can-the-heatmaps-be-added-vertically">Can the heatmaps be added vertically?</a></li>
<li><a href="#does-heatmap-title-supports-mathematical-expression">Does Heatmap title supports mathematical expression?</a></li>
<li><a href="#i-have-many-heatmaps-and-i-want-to-put-them-into-different-panels-for-a-big-figure-for-my-paper">I have many heatmaps and I want to put them into different panels for a big figure for my paper.</a></li>
<li><a href="#i-have-a-matrix-with-too-many-rows-and-i-want-to-simplify-the-row-dendrogram">I have a matrix with too many rows and I want to simplify the row dendrogram.</a></li>
<li><a href="#i-have-a-matrix-with-huge-nunmber-of-rows-or-columns-what-is-the-efficient-way-to-visualize-it">I have a matrix with huge nunmber of rows or columns, what is the efficient way to visualize it?</a></li>
<li><a href="#how-to-add-axes-for-dendrograms">How to add axes for dendrograms?</a></li>
<li><a href="#i-set-row-km-column-km-and-it-gives-me-different-k-means-clusterings-for-different-runs">I set row_km/column_km and it gives me different k-means clusterings for different runs.</a></li>
<li><a href="#i-only-want-to-draw-dendrograms-plus-a-list-of-annotations">I only want to draw dendrograms plus a list of annotations.</a></li>
<li><a href="#i-still-have-a-problem-with-the-package-and-i-am-lost-in-the-ocean-of-the-huge-vignette">I still have a problem with the package and I am lost in the ocean of the huge vignette.</a></li>
<li><a href="#can-i-also-add-heatmaps-produced-by-pheatmap">Can I also add heatmaps produced by pheatmap()?</a></li>
<li><a href="#can-i-make-an-interactive-heatmap">Can I make an interactive heatmap?</a></li>
</ul>
</li>
</ul>
</div>
<!--
%\VignetteEngine{knitr}
%\VignetteIndexEntry{Most probably asked questions}
-->
<h2 id="most-probably-asked-questions">Most probably asked questions</h2>
<style type="text/css">
h1, h2, h3, h4, h5 {
line-height: 120%;
}
</style>
<h3 id="there-is-no-plot-coming-out-after-running-heatmap-function">There is no plot coming out after running Heatmap() function.</h3>
<p>In this case, you need to use <code>draw()</code> function explicitly. See
<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#plot-the-heatmap">https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#plot-the-heatmap</a>
and
<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#plot-the-heamtap-list">https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#plot-the-heamtap-list</a>.</p>
<h3 id="retrieve-orders-and-dendrograms">Retrieve orders and dendrograms.</h3>
<p>For retrieving orders and dendrograms from a single heatmap. See
<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#get-orders-and-dendrograms-from-heatmap">https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#get-orders-and-dendrograms-from-heatmap</a>.</p>
<p>For retrieving orders and dendrograms from a list of heatmaps. See
<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#get-orders-and-dendrograms-from-a-list-of-heatmaps">https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#get-orders-and-dendrograms-from-a-list-of-heatmaps</a>.</p>
<h3 id="how-should-i-control-the-height-or-width-of-the-heatmap-annotations">How should I control the height or width of the heatmap annotations?</h3>
<p>For complex annotations generated by <code>anno_*()</code> functions, width or height
should be set inside the <code>anno_*()</code> function, such as <code>anno_points(..., height = ...)</code>. The size of simple annotations is controlled by <code>anno_simple_size</code>.
The <code>width</code>/<code>height</code> and <code>annotation_width</code>/<code>annotation_height</code> are used to
adjust the size for multiple annotations which are put in one
<code>HeatmapAnnotation</code> object. See
<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html#multiple-annotations">https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html#multiple-annotations</a></p>
<h3 id="how-should-i-control-the-axes-of-the-annotations">How should I control the axes of the annotations?</h3>
<p>In the annotation functions <code>anno_*()</code>, the argument <code>axis_param</code> can be used
to set the axes. The value should be a list and the default settings for axis
can be get by:</p>
<pre><code class="language-r">default_axis_param(&quot;column&quot;)
default_axis_param(&quot;row&quot;)
</code></pre>
<h3 id="how-to-control-the-style-of-legends">How to control the style of legends?</h3>
<p>The style of legends can be controlled by <code>heatmap_legend_param</code> in
<code>Heatmap()</code>, or <code>annotation_legend_param</code> in <code>HeatmapAnnotation()</code>. The
parameters for controlling legends are those arguments in <code>Legend()</code> function.
See
<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/legends.html#heatmap-and-annotation-legends">https://jokergoo.github.io/ComplexHeatmap-reference/book/legends.html#heatmap-and-annotation-legends</a>.</p>
<h3 id="some-text-are-cut-by-the-plotting-region">Some text are cut by the plotting region.</h3>
<p>The layout of the <strong>ComplexHeatmap</strong> is not perfect that it is still possible
some of the text are drawn out of the plotting region. In this case, you can
set the <code>padding</code> argument in <code>draw()</code> function to increase the blank areas
around the final plot. See
<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#manually-increase-space-around-the-plot">https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#manually-increase-space-around-the-plot</a>.</p>
<h3 id="can-the-heatmaps-be-added-vertically">Can the heatmaps be added vertically?</h3>
<p>Yes, use <code>%v%</code> instead of <code>+</code>. See <a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#vertical-concatenation">https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html#vertical-concatenation</a>.</p>
<h3 id="does-heatmap-title-supports-mathematical-expression">Does Heatmap title supports mathematical expression?</h3>
<p>Yes, all the text-related elements (e.g. titles, row names, legend titles, legend labels, …) allow
methematical expression.</p>
<h3 id="i-have-many-heatmaps-and-i-want-to-put-them-into-different-panels-for-a-big-figure-for-my-paper">I have many heatmaps and I want to put them into different panels for a big figure for my paper.</h3>
<p>You can set <code>newpage = FALSE</code> in <code>draw()</code> function and use <code>grid.layout()</code> to
manage the layout of your panels.</p>
<pre><code class="language-r">pushViewport(viewport(layout = grid.layout(...)))
pushViewport(viewport(layout.pos.row = ..., layout.pos.col = ...))
draw(ht, newpage = FALSE) # or draw(ht_list, newpage = FALSE)
popViewport()
...
</code></pre>
<p>But I more suggest to use <code>grid.grabExpr()</code> to directly capture the output of
the heatmap and later draw the whole plot as a single graphic element by
<code>grid.draw()</code>.</p>
<pre><code class="language-r">ht_grob = grid.grabExpr(draw(ht, ...))
pushViewport(viewport(layout = grid.layout(...)))
pushViewport(viewport(layout.pos.row = ..., layout.pos.col = ...))
grid.draw(ht_grob)
popViewport()
...
</code></pre>
<h3 id="i-have-a-matrix-with-too-many-rows-and-i-want-to-simplify-the-row-dendrogram">I have a matrix with too many rows and I want to simplify the row dendrogram.</h3>
<p>You can first group your rows into several groups and make a group-level
dendrogram on it. See following example:</p>
<pre><code class="language-r">m = matrix(rnorm(1000*10), nr = 1000)
hc = hclust(dist(m))
group = cutree(hc, k = 6)
Heatmap(m, cluster_rows = cluster_within_group(t(m), group),
row_split = 6, border = TRUE) # it would be better if also set row_split
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAIAAAApSmgoAAAACXBIWXMAAAsSAAALEgHS3X78AAAgAElEQVR4nOydZ2BUddrFz6T33nubNELvCUW6CUhRQbCirmStoC5rQ91V1rI2omshVux1FcUE6QIJvUNCkklIIZX03uf9ALqvkRIEnnMv3vNJab87k5lzn/v8n6IzGo3QpEmTJk2Xr0zYF6BJkyZNmi6tNKPXpEmTpstcmtFr0qRJ02Uuzeg1adKk6TKXGfsCNClFOp2OfQmaNJF1uRanXOZGr5mXpstGqvMgnU6nrmu+jO3iMjd6qPPrwb6E8xblTWb5CIXL+lRcIPdC/rrqvrlK1uVv9BSxvpYs45OHahKT9qG6DKQZ/aXSnyfo06RJk8KlVd1o0qRJ02Uuzeg1adKk6TKXZvSaNGnSdJlLM3pNmjRpusylGb0mTZo0XebSjF6TJk2aLnNpRq9JkyZNl7k0o9ekSZOmy1ya0WvSpEnTZS7N6DVp0qTpMpdm9Jo0adJ0mUszek2aNGm6zKUZvSZNmjRd5tKMXpMmTZouc2lGr0mTJk2XuTSj16RJk6bLXJrRa9KkSdNlLs3oNWnSpOkyl2b0mjRp0nSZSzN6TZo0abrMpRm9Jk2aNF3m0oxekyZNmi5zaUavSZMmTZe5zmT0qYk6XVySAQAMSXG6X5SYKnhtmjRp0qTpIui0Rm9Iiks4vCwnbWEYDElx+owlxlPKiV6qLq83Go1/Hu6f6sX+2bh/qhfL4rJerISMp1HKAsQuyzEajcacZbFYkPK/3+n5//8T+3Vo0qRJE1On80WlyOx0F6yPjj31X2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dl
<h3 id="i-have-a-matrix-with-huge-nunmber-of-rows-or-columns-what-is-the-efficient-way-to-visualize-it">I have a matrix with huge nunmber of rows or columns, what is the efficient way to visualize it?</h3>
<p>Heatmap is used to visualize the global patterns of your matrix while not
every single row or column. I suggest to random sample rows or columns into a
reasonable small number, and the final heatmap should look the same as if you
still insist to use the full matrix.</p>
<h3 id="how-to-add-axes-for-dendrograms">How to add axes for dendrograms?</h3>
<p>You need to use <code>decorate_row_dend()</code> or <code>decorate_column_dend()</code> to manually
add the axes. See following examples:</p>
<pre><code class="language-r">m = matrix(rnorm(100), 10)
ht = Heatmap(m, name = &quot;foo&quot;,
row_dend_width = unit(4, &quot;cm&quot;),
column_dend_height = unit(4, &quot;cm&quot;)
)
draw(ht, padding = unit(c(15, 2, 2, 2), &quot;mm&quot;))
decorate_column_dend(&quot;foo&quot;, {
grid.yaxis()
})
decorate_row_dend(&quot;foo&quot;, {
vp = current.viewport()
xscale = vp$xscale
grid.xaxis(at = xscale[2] - 0:5, label = 0:5)
})
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAMAAACR9g9NAAAB3VBMVEUAAAAAADoAAGYAAP8AOpAAZrYBAP86AAA6ADo6AGY6OmY6OpA6ZrY6kNs7HP9IJv5eNv5mAABmADpmAGZmOgBmOpBmtv9uRP19Uf1/U/2EV/yQOgCQOjqQOmaQZPyQZgCQtpCQ29uQ2/+Zb/ubcfudc/ufdvujevqlffqmfvqogfqqg/quiPm0kPm2ZgC2Zjq2kvi22/+2//+5l/i6mPi7mvi9nPi9nfi+nvfEp/fFqfbGqvbIrPbJr/bLsfbMsvXNtfXPt/XRu/TRu/XWw/TYx/PZyPPayvPbkDrbtmbby/Pb///dzvLe0PLf0vLg1fHh1vHi2PHj2fHj2vHk2/Hm3/Do4vDq5u/r6O/u7u7v7ezx6ebx6efx6ejy6OXz5eH049/05OD14dv14dz24Nr24Nv33tf42tP52ND52tL61sz90MT/AAD/LBX/QST/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t5QO30O+Ezhn2pW3lA7fQ74TOHLnlxm3ukT4LOHf5LZo/e5efoc8JnCP8FseVRs1U6fAz5T+MeblTfUTp8DPlP4x5mVN9ROnwM+U/ibzBrxgAceeOCBBx544IEHHnjggR8BvPmr54DXA1/51XOd4LucWvNSuQ+I/Vnuv3JvE7tHTr7AzcOvEnuL3Gvkzu/j6sN89VfPdYH333AJfGz4tSO+9qvngFcBf1RsTcJ9Vg/8gOEviyMeeOA1wa9bAQ98F0/g
<p>Note for the left row dendrogram, the x-axis is from right to left, you need to self-define <code>at</code>
and <code>label</code> in <code>grid.xaxis()</code> function.</p>
<p>You can also check <code>annotation_axis_grob()</code> function (later use <code>grid.draw()</code> to draw the axes) to draw a nicer axis.</p>
<h3 id="i-set-row-km-column-km-and-it-gives-me-different-k-means-clusterings-for-different-runs">I set row_km/column_km and it gives me different k-means clusterings for different runs.</h3>
<p>Yes, this is what it should be expected because k-means uses random start points and it might give
different results for different runs. To solve this problem, you do either way as follows:</p>
<ol>
<li>Always add <code>set.seed(...)</code> before making the heatmap. This makes sure the
random seed is always the same for different runs.</li>
<li>Set <code>row_km_repeats</code>/<code>column_km_repeats</code> to run k-means multiple times to get a
final consensus k-means clustering. Note you might still get different
results, but the chance is much smaller than just running k-means once.</li>
</ol>
<h3 id="i-only-want-to-draw-dendrograms-plus-a-list-of-annotations">I only want to draw dendrograms plus a list of annotations.</h3>
<p>You need to assign the dendrograms to a zero-row/column matrix:</p>
<pre><code class="language-r">hc = hclust(dist(matrix(rnorm(100), 10)))
Heatmap(matrix(nc = 0, nr = 10), cluster_rows = hc,
right_annotation = rowAnnotation(
foo = anno_points(1:10),
sth = 1:10,
bar = anno_barplot(1:10)),
row_split = 2)
</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAMAAACR9g9NAAAByFBMVEUAAAAAADoAAGYAOmYAOpAAZrYHgHEQgXMXg3Qihncmh3kuinwyjH01jX83joA6AAA6ADo6AGY6Ojo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TnfWE14Z/hcJ4wdY47tiueF/mTB+gPBdsdzwv0poy6ALCK8M/+uEtgy6gPDK8L9NaEmgEwivDP+7hLYMuqC/4Sf739Xhf5/QpsWy6W34yZEXffi/JLTrsVxihG86qNZy+L8mLE3xBSBI+DnTxYdtm/q/JUzeA8fn+531N/xkmjr8cwlcO9cpyw0/4u9jTpbBBRUdsdzw/0gYP8BbmnbFcsP/M6G6v+OzO+G14f+VUL24c7mdLwmvDv/vhOrt6jke3xnLDf+fhBYllg7h9a/qQxDAhvAWAtgQ3kIAG8JbCGBDeAsBbFoNP/fauSn4+LHuaDW8cjl8/FiHdBmez6TpkE7Db5bDq4TvBtZ4C4TnOd4rXYbnVf3SqM5yqw6HnX7AY6fh3eLOpjrxYWe0dSX8YnizObqt2rIenB+0FP43NQi/skzCj15U/YnwC+HO5to5bnvFecIvgjub4ZVr5Qm/EAFsCG8hgA3hLQSwIbyFADaEtxDAhvAWAtgQ3kIAm1bDp++ooFiOPwLYtBo+OblSsxx/BLAhvIUANoS3EMCG8BYC2BDeQgAbwlsIYEN4CwFsCG8hgA3hLQSwIbyFADaEtxDAJi+8uPud8J7JCj/rwAvh/TIdXnzbcsJPEcDmTPiz00s29dMEsMkLP+N7Ce8XwlsIYEN4CwFsCG8hgA3hLQSwIbyFADaEtxDAhvAWAtgQ3kIAm+m9sYTPIYYN4dXEsGkvPJdQuaK98Lk/xD0xbAivJoYN4dXE
<h3 id="i-still-have-a-problem-with-the-package-and-i-am-lost-in-the-ocean-of-the-huge-vignette">I still have a problem with the package and I am lost in the ocean of the huge vignette.</h3>
<p>The vignette (<a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/">https://jokergoo.github.io/ComplexHeatmap-reference/book/</a>)
contains huge number of examples and plots showing different usage of the
package. It is sometimes not easy to find the solution you are looking for. In
this case, dont hesitate to drop an issue on GitHub. I am glad to answer all of your
questions!</p>
<h3 id="can-i-also-add-heatmaps-produced-by-pheatmap">Can I also add heatmaps produced by pheatmap()?</h3>
<p>Yes, you can refer to <a href="https://jokergoo.github.io/2020/05/06/translate-from-pheatmap-to-complexheatmap/">https://jokergoo.github.io/2020/05/06/translate-from-pheatmap-to-complexheatmap/</a>.</p>
<h3 id="can-i-make-an-interactive-heatmap">Can I make an interactive heatmap?</h3>
<p>Yes, please refer to <a href="https://github.com/jokergoo/InteractiveComplexHeatmap">the <strong>InteractiveComplexHeatmap</strong> package</a>.</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js" defer></script>
</body>
</html>