Dear Biostars, Hi
I have about 8000 transcripts that has hit with Transcription Factors (TFs). Among them 69 are up-regulated in females (3 biological replication) and 19 up-regulated in males (with 3 biological replication). (using DESeq2, FDR 0.05)
Now I intend to draw a heat map based on my TMM-normalized expression values (3 for males and 3 for females for each transcripts) but I want to just show the DEG in it (69+19) not all 8000 transcripts; something same as Figure8b in here.
1) How can I do it? is it just by selecting those 88 transcripts TMM value and used them as input in R heatmap script?
2) As you can see in the Figure8, there is just 2 columns. but as I have 3 BR for each conditions, I have 6 columns. How I can convert them into 2 columns ?
Can I calculate the mean of each 3 TMM of each transcripts and use the mean number as input for each transcripts ?
~ Thank you in advance
Dear @TriS, Hi and thanks for your help
1- My data are matrix of TMM-normalized expression values as produced by Trinity. Do I need to "scale/center the data" in this case ? if yes What exactly you mean by this?
2- I want ti use this color scheme. Do you know how to import it in the script of heatmap in R ?
3- I found this heatmap example very pretty but there is many error is running it.
~ Take Care
1- you can use
pheatmap(myData,scale="row")
2- usecolor=colorRampPalette(c("#fee8c8", "#fdbb84", "#e34a33"))(100),breaks=seq(-2,2,length=100)
within the pheatmap function 3- without your code it's impossible to say why you get the errorDear TriS,
Thank for all your helps and very useful guidance.
One problem that I have encountred is this that when I run my script (below), I could not see my 88 transcripts ID in my heat map (e.g TRINITY_DN107669_c1_g2_i1)
Would you please help me about it ? ( I even have tried
my_matrix <- t(my_matrix)
but no chance!)this is head of
head(my_data)
:1 TRINITY_DN107669_c1_g2_i1 2.120 0.173 0.781 0.000 0.000 0.000
2 TRINITY_DN101742_c5_g1_i2 0.398 0.303 0.751 0.000 0.009 0.000
3 TRINITY_DN107731_c4_g1_i4 0.102 0.336 0.160 0.000 0.000 0.000
And this is my R script for Heatmap :
what does
head(my_matrix)
return?> dim(my_data)
[1] 88 7
[1,] 0.68965517 0.05627846 0.2540664 0.00000000 0.000000000 0.000000000
[2,] 0.27241615 0.20739220 0.5140315 0.00000000 0.006160164 0.000000000
[3,] 0.17056856 0.56187291 0.2675585 0.00000000 0.000000000 0.000000000
you don't see the sample names because you don't have rownames :)
Dear TriS, Hi
I have corrected the rownames, finally. ;-)
actually it was in my script but as I have copied this script from different references, I have used d instead of my data in my script. so;
incorrect :
row.names(my_data) <- d$sample
correct :
row.names(my_data) <- my_data$sample
Now I have another label for rows; in addition to transcripts IDS (TRINITY bla bla bla), I have the gene names that showed in annotation and I want to add them in the different side of the rows (left side the IDs and right side the blast hits).
1) How can I do it ? did I must add another column to my original file containing the gene names or I can insert these lables from separate file ?
2) I have seen a
shrink
option in some heatmaps. have you any experience about using it inHeatmap()
?3) in your first script (
index_genes <- which(rownames(m) %in% myListOfGenes)
) you kindly have shared with me, what did%in% myListOfGenes
mean?Hi again,
I need to show my 88 row names at the side that I am showing my clustering/dendrogram (left side).
They are now on the opposite sides.
in
Heatmap()
, it could be done usingrow_names_side = "left"
androw_hclust_side = "left",
BUT I want its option inheatmap()
andpheatmap()
.Do you have any suggestion dear TriS ?
hi Farbod, I am not sure how to do that, it might be useful to start a new thread with that question since it's drifting away from your initial problem