Comments (4)
That is a nice suggestion! I will support it in the next version. Thanks!
from complexheatmap.
That seems to do the trick (replacing the prior part in Heatmap-class.R
, starting line 649):
} else {
if(is.numeric(mat)) {
require(gclus)
hclust_d = get_dist(submat, distance)
c = hclust(hclust_d, method = method)
c = gclus::reorder.hclust(c, hclust_d)
row_hclust_list[[i]] = c
row_order_list[[i]] = row_order_list[[i]][ get_hclust_order(row_hclust_list[[i]]) ]
}
}
from complexheatmap.
Thanks a lot for the suggestion. I used a little bit different solution. Actually there are two ways:
- if you only want to re-order rows based on a
hclust
object but don't want to draw the tree, you can set the order throughrow_order
option inHeatmap()
. Then you can split the rows in the normal way.
hc = hclust(dist(mat))
Heatmap(mat, cluster_rows = FALSE, row_order = hc$order, split = ...)
- if you also want to keep the tree, is this case,
split
can only be set as a single number indicating how many sub-trees that are cut from the big tree.
Heatmap(mat, cluster_rows = hc, split = 2)
So in the following two figures, the second heatmap are splitted into two halves:
This new feature are supported from version 1.2.2.
from complexheatmap.
Thanks, that's excellent and also more flexible than my solution.
from complexheatmap.
Related Issues (20)
- picking new set of random colors for annotations
- Anno_textbox not scaling when saving image
- ComplexHeatmap crashing R session HOT 1
- Change pch size and color in legend
- Not getting correct row order in the row split ComplexHeatmap R HOT 1
- Help with anno_boxplot
- `column_order` is ignored when `column_split` is used HOT 2
- Making a heatmap with categorical value such as CNV(AMP, DEL) status
- Cluster column slices but not columns within slices
- Feature request: integrate ` heatmap_legend_side` into ` heatmap_legend_param`?
- Oncoprint - Customize with continuous color scale
- Color Branches w/ K-Means
- Padding not working with heatmap list HOT 1
- ComplexHeatmap with specific rownames
- How to use layer_fun to add a box in the aim areas
- Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
- Issue with the anno_numeric function
- Heatmap with split tiles
- Dotplot representation of Heatmap?
- Issue with saving heatmap with `decorate_annotation` in ComplexHeatmap
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from complexheatmap.