Hey ya'll,
Struggling here.
The dataframe was generated using a new package called InterCom (https://github.com/saschajung/InterCom), which basically determines ligand receptor pairing and also together with sending and receiving cells using scRNA-seq data. Incredibly useful if you ask me.
Here is a sample of my data:
"score" "significance" "lig.rec.pop" "ligand.receptor"
25507.7307692308 0.950689655172414 "undef_acinar" "FSTL1_BMPR1A"
113286.378762542 0.994068965517241 "mesenchymal_acinar" "FSTL1_BMPR1A"
56944.7025939177 0.989103448275862 "endothelial_acinar" "FSTL1_BMPR1A"
24467.0634475014 0.94551724137931 "mesenchymal_acinar" "BMP4_BMPR1A"
45149.7188075585 0.985034482758621 "mesenchymal_acinar" "BMP4_BMPR2"
20099.7619047619 0.916 "blood_acinar" "IL1B_IL1R1"
19786.641 0.913310344827586 "alpha_acinar" "VTN_ITGAV"
56609.9870823529 0.989034482758621 "mesenchymal_acinar" "FN1_ITGAV"
The maximum score value is 6611701.91, and the score minimum value is 36320.27,
Could someone help me get started with a good way to scale the data (if I even need to?, and generate a ComplexHeatmap? My main struggle is figuring out how to get it into the format to plug it into ComplexHeatmap.
I was able to do it through ggplot2, but I want to do it through ComplexHeatmap as I think it is easier to add bells and whistles. The only reason I was able to do it using ggplot2 was because I specified the what x, y and scores to use:
ggplot(hm, aes(x = ligand.receptor, y = lig.rec.pop, fill = score)) +
geom_tile() + theme(axis.text.x = element_text(angle = 90))
Ideally, I would love a heatmap/plot like this:
I realize that adding the time points (ie. week 7 and 9) might be a matter of adding meta data. but really if someone could just help me get started - I would be grateful.
Thank you in advance!
Image Citation: Gonçalves, C.A., Larsen, M., Jung, S. et al. A 3D system to model human pancreas development and its reference single-cell transcriptome atlas identify signaling pathways required for progenitor expansion. Nat Commun 12, 3144 (2021). https://doi.org/10.1038/s41467-021-23295-6
Hi, Have you read the ComplexHeatmap manuals?
In all honesty, I have browsed through (I'll give another look), and have also looked through here: https://github.com/kevinblighe/E-MTAB-6141
My main struggle is getting the dataframe in the appropriate format for ComplexHeatmap? I have used the package before, simply just plugging in a gene-gene correlation matrix - that was straight-forward.
However, I am troubled here, because the dataframe isn't as simple as just plugging in the matrix with a simple function such as Heatmap(mymatrix)
Any help would be appreciated!
Can you provide the data via
dput()
so it is easy to copy/paste it?Thank you for helping me out ATPoint.
Hope this is correct:
Output:
Start with
Heatmap(df[,cell_value_col_indices])
and then addrow_annotation(df$lig.rec.pop)
and thencolumn_annotation
. You might have to useleft_annotation
,top_annotation
etc, they are row and column annotations with specific side parameters.If clustering messes things up, draw the heatmap then get the
row_order
andcolumn_order
; pass those to the annotation functions by reordering the df with these order vectors.Thank you very much Ram. I am going to try this now. A 3am ComplexHeatmap adventure weeee! lol
Hi, that looks like pheatmap, not ComplexHeatmap.
Oh, I see. I was thinking that too after looking at the ComplexHeatmap manual. Let me try do this in pheatmap.
I can do it with ggplot2:
But I think when the time comes to add meta data and do the hierarchical clustering it might be more complicated.