Adding box plot for gene expression to complexheatmap
0
0
Entering edit mode
10 months ago
A ★ 3.9k

Hi

I have a complexheatmap like this save in object hm

enter image description here

I have RPKM values for these 11 genes for Responders (n=9) and Non responders(n=24) groups

I want to show the difference of RPKM between two groups as a side box plot (or violin)

I have tried this

head(df[1:5,1:5])
         1        2        3         4        5
1 2.863344 1.898928 3.478697 2.3757564 2.135660
2 4.212727 2.463784 7.684164 1.9982669 4.112562
3 2.272057 1.066807 1.308542 0.7091228 4.606245
4 3.225457 1.358011 2.204351 2.1995727 5.025283
5 2.766198 1.628747 2.806077 1.4850733 3.077352
> 

> dim(df)
[1] 11 33
> class(df)
[1] "data.frame"
> 

.boxplot = anno_boxplot(df, which = "row")
ha_mix_right = HeatmapAnnotation(violin = .violin, bxplt = .boxplot,
                              which = "row", width = unit(4, "cm"))

hm+ha_mix_right

Which gives this

enter image description here

But by this we can not say if for instance RPKM values in CCND1 is higher in non-responders (I have already checked the differences between groups for these genes so I know the direction of expression level)

I also tried this but no success

https://jokergoo.github.io/ComplexHeatmap-reference/book/more-examples.html#add-multiple-boxplots-for-single-row

Is these any way to show that here?

Thank you for any help to achieve this

r complexheatmap • 541 views
ADD COMMENT
0
Entering edit mode

A, Difference in FPKM/RPKM is not really something meaningful. If you still wish to show that, you should plot a scaled version of the difference. log2(Responder_RPKM/NonResponder_RPKM) would show if Responder is higher or lower than NonResponder. Don't call it Fold Change or make a statistical statement though.

ADD REPLY
0
Entering edit mode

But people for the same data set done comparison and published that

I have checked the difference which is significant for some genes but I don't know how to visualize that here

ADD REPLY
0
Entering edit mode

You know what, your results could be significant/published - I'm no expert on your data or journals' criteria. In any case, log2 fold change is something you can plot, and maybe only plot those for significant differences.

ADD REPLY

Login before adding your answer.

Traffic: 1067 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