How to make a dotplot for bulk RNA average expression ?
1
0
Entering edit mode
13 months ago
LionisOne • 0

Could any can tell, how to make a dotplot for average bulk RNAseq expression data ? I know how to do it with scRNAseq data, but I need to know how to do it for bulk RNAseq data. I have ten genes and 4 conditions. Following is an example data.Thanks in advance.

Gene    condition1  condition2  condition3  condition4
Gene1   0.447279564 0.244477123 0.4063334   0.239082121
Gene2   1.294765756 1.281322097 0.741636378 0.589012846
Gene3   0.645340016 0.322665041 0.546119817 0.321758735
Gene4   1.387058912 0.782587139 1.152339039 0.716752685
Gene5   0.66357744  0.3778169   0.469890908 0.374814241
Gene6   0.017034267 0.073691015 0.035709557 0.135556732
Gene7   1.847328657 0.512216098 1.865962731 1.251886635
Gene8   1.351460581 0.814211237 1.038986711 0.621835519
Gene9   0.600859865 0.260565533 0.407434405 0.286318901
Gene10  0.553103313 0.319249304 0.408836976 0.262983508
Dotplot RNA-seq • 1.1k views
ADD COMMENT
0
Entering edit mode
13 months ago
Trivas ★ 1.8k

You'll want to use the pivot_longer function in R so that you have three columns: 1) gene, 2) condition, 3) value. You can then use ggplot and use facet_wrap(~gene) or facet_wrap(~condition) depending on what you're trying to visualize.

ADD COMMENT
0
Entering edit mode

@Trivas Thank you very much for your reply. if you don't mind could you share the script. Because its showing the dot in my plot, but I would like to show the size of dots corresponding to the average expression. Is it possible in ggplot2? Sorry for the trouble.

ADD REPLY
0
Entering edit mode

I am not entirely clear on what you are trying to accomplish, but based on @Trivas answer, I would first transform the data relative to average expression with something like lapply(df[-1], function(x) x/mean(x)), then I would make the table long pivot_longer(df, cols=!Gene, names_to = 'Condition', values_to = 'Value'), and finally plot ggplot(df_new, aes(Gene, Value)) + geom_point(aes(size=Value)) + facet_wrap(~Gene) with size of points based on the value relative to column average. This likely needs some tweaking to average correct conditions, genes, etc. but I hope it gets you on the right track.

ADD REPLY

Login before adding your answer.

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