complexHeatmap - distance calculation
3
0
Entering edit mode
@annkatringoepfert-9610
Last seen 5.3 years ago

Hello everyone,

I'm creating a heatmap with complexHeatmap and wonder how the distance calculation is done. It isn't a z-score because the values are going from 0-0.4 and I coudln't found information about the used  "get_dist(submat, distance)" function.

Thanks for any answer and/or helpful websites which explain how the distance is calculated ;)

CHeers

Annkatrin

complexheatmap • 2.7k views
ADD COMMENT
1
Entering edit mode
@annkatringoepfert-9610
Last seen 5.3 years ago

.. never mind - it was my stupi mistake.. I didn't scale the matrix - that was the reason why the annotation label differs

ADD COMMENT
0
Entering edit mode
svlachavas ▴ 780
@svlachavas-7225
Last seen 9 hours ago
Germany/Heidelberg/German Cancer Resear…

Dear annkatrin,

your question is a bit confusing--- what do you mean about "how the distance calculation is done " ? 

Also, which exact code you used from the package ? 

If you type ?Heatmap, you can actually see all the available arguments and possible methodologies implemented, such as

clustering_distance_rows & clustering_distance_columns, which show by default that "euclidean Distance" is used.

Also, by default the ComplexHeatmap package (as far as i remember) does not perform any kind of scaling, so if you want you have to scale your data prior import to Heatmap().

You should anyway check the below vignette:

https://bioconductor.org/packages/release/bioc/vignettes/ComplexHeatmap/inst/doc/s2.single_heatmap.html

Best,

Efstathios

ADD COMMENT
0
Entering edit mode
@annkatringoepfert-9610
Last seen 5.3 years ago

Hey Efstathios,

you are write - I ask my question very unclear ;) I am not curious about the clustering - sorry for the misunderstanding! I am curious about the created legend of Heatmap. 

E.g.:

if I run "heatmap.2(data_mat)": the legend ("Color Key and Histogram") goes from 0-1 and represent the range of data in my input file

if I run "heatmap.2(data_mat, trace="none", distfun=dist.pear, hclustfun=hclust.ave,scale="row", zlim=c(0,1))" : this legend represents the z-score of my data set

if I run "Heatmap(data_mat)": then I get a legend with a range from 0 till 0.4 and that's what I don't understand - how is this calculated?

I hope that's better to understand ;)

 

ADD COMMENT
0
Entering edit mode

So you are saying that the range of your values from data_mat which are visualized on each annotation label, is different between Heatmap() and heatmap.2 ?

If so, i believe that only heatmap.2 assumes that the values of the input matrix are approximately symmetic to zero--so this could explain this "discrepancy" you mention, and also possibly scaling on the rows would be beneficial. Also, this could be not appropriate in many cases, especially if you have any negative values. 

Regarding your other question, i believe you should check in more detail the above vignette, and in particularly the circlize R package and the colorRamp2() function.

Hope that helps.

Efstathios

ADD REPLY

Login before adding your answer.

Traffic: 463 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6