Make a simple heatmap of differentially expressed genes in R

Поделиться
HTML-код
  • Опубликовано: 7 янв 2022
  • I show you how to make a simple heatmap of differentially expressed genes that we analyzed with Deseq2. I also show a simple conversion of Ensembl Ids to gene symbols.
    Data does not have to be from Deseq2. You can load a matrix of normalized TMM/TPM data from any source and save it as the mat in the counts() step.

Комментарии • 57

  • @kellydeng651
    @kellydeng651 Год назад

    THANK YOU, YOU ARE A LIFESAVER!!!!!!!! 😁

  • @user-gu3wt2eu8g
    @user-gu3wt2eu8g 9 месяцев назад

    Thanx for helping with this video

  • @joshuastephenkingsly
    @joshuastephenkingsly 7 месяцев назад

    You work with counts or normalized counts in many of these tutorials. What should I do when I need to do the same analyses with RSEM Zscores?

  • @juliat6367
    @juliat6367 2 года назад +1

    Hello, thank you so much for this great tutorial! I just started learning sequencing analysis so I apologize if this is a silly question, but how are the rows and columns being clustered here? Although I saw there are some options if you want to specify a clustering method (distance methods, hclust or dendrogram object, etc.) - I couldn't find how the default clustering method of the Heatmap() function works. If you happen to know, I would really appreciate it!

    • @sanbomics
      @sanbomics  2 года назад

      Hi! I believe it is hierarchical clustering based on a pearson's distance matrix. Hope this helps!

    • @juliat6367
      @juliat6367 2 года назад

      @@sanbomics Thank you! Your videos have been so helpful for me - really grateful for all your efforts!

    • @sanbomics
      @sanbomics  2 года назад

      Thanks for watching and letting me know! :)

  • @ninapenny5687
    @ninapenny5687 3 месяца назад

    Thank you so much for the videos! I have a quick question, when I used the dev.off command my map disappeared, do you know how I can find the resized version?

  • @user-vq9zi1bh2n
    @user-vq9zi1bh2n Год назад

    Hi, thanks so much for this tutorial! It is really helpful! But I am a bit confused about the z score normalization, and how the function t(apply) works in detail. Thanks again in advance!

    • @sanbomics
      @sanbomics  Год назад +1

      Hi, z-score is a useful way to visualize multiple genes with high degrees of variability on the same plot. Each gene gets its own distribution and you can better see how each sample compares to each other better. t() is used to transpose the matrix so that we can apply the function to the right axis. Hope this helps!

  • @jessicatrejo9889
    @jessicatrejo9889 8 месяцев назад

    Hi, thank you very much for your videos! They really help newbies like me. I just have a question, why do you use the basemean to filter your genes? Indeed you want to get fewer genes in your heatmap and I understand why you could use the padj and log2foldchange but I am curious about how that one helps in the process of filtrating the genes. Any information would be highly appreciated!

    • @sanbomics
      @sanbomics  7 месяцев назад

      Very low genes are very noisy. they are more likely to have vast relative differences in expression just because of noise and therefore there DE is more likely to be an artifact

  • @mini_days
    @mini_days 2 года назад

    Great video! This was very helpful thank you. I have some questions though… (1) My dataset has four groups in duplicates: Gene ‘A’ overexpressed, treated with or without ‘X’. However, deseq2 compares between two groups only, so I have no idea how to retrieve normalized counts/log2FC/adjP among all these groups. Do I need to sort only the genes that are commonly significant across all comparisons then draw a heatmap? (2) Thanks to you I mapped my Ensembl gene name to symbols. However, turns out MANY entries have ‘NA’ symbols, which when I look up the Ensembl IDs they’re non-coding RNAs and stuff like that (probably cus I used a primary assembly annotation). Anyways, if for my purpose I don’t really care about these lncRNAs but only gene-coding transcripts, would it be okay to neglect (remove) them from my sigs list?? Sorry it’s a lotta questions…. But I’d really appreciate a response!! Thx

    • @sanbomics
      @sanbomics  2 года назад +1

      1) The pairwise comparison ("contrast") is a later step. You should be able to set it up and normalize everything and come up with the counts before doing any comparisons. 2) This is very reasonable. Many people only look at coding genes. Some people are more interested in non-coding RNA, but that doesn't mean you have to be. If they are super significant in your dataset, maybe you should note them. But if it is just a few mixed in I wouldn't worry about removing them.

    • @mini_days
      @mini_days 2 года назад

      @@sanbomics Thanks for the kind reply! So for my first question, if I want to draw a heatmap comparing across four different groups for example, then I should use the ‘normalized counts’ data (i.e. the data obtained prior to actual deseq2) right?? My concerns as to the second question were resolved thank you!

    • @sanbomics
      @sanbomics  2 года назад

      Yup! The function i use in this video pulls the normalized counts from the dds object.

    • @sanbomics
      @sanbomics  2 года назад

      You'll still have to decide which genes to include in the heatmap though. Usually people pick the DE genes between two groups. But since you have 4, you can do the union of the DE genes between each comparison. If you have too many genes you can always increase the DE filtering threshold. Or you can pick genes from specific pathways, etc. There is more than one right way

    • @mini_days
      @mini_days 2 года назад

      @@sanbomics I see I see. Your videos are so useful to noobs like myself haha. Please keep it up!! 🤟

  • @robstaruch7362
    @robstaruch7362 2 года назад

    Hey Sanbomics - II ended up here from your complex heat map video. I can't actually load the complex heat map library, but I also cant seem to get the mat

    • @sanbomics
      @sanbomics  2 года назад

      Hi. What is the error message?

  • @ManojkumarKarnena
    @ManojkumarKarnena Год назад

    How can i generate a heatmap should i use fold change or log2FC values?
    i ran Ic-ms analysis for control and treatment groups and calculated fold change for control/test and test/
    control DEPs which were normalized using log 2fold change, i am confused now for the reason that whether i should consider control/test or test/control fold change values or control/test or test/control log2 fold change to generate a heatmap.

    • @sanbomics
      @sanbomics  Год назад +1

      Hi, the heatmap shows the values for the given sample/feature--not a comparison between any two groups. You can plot a heatmap using your normalized MS counts. The differential expression part is only to determine which genes to include in the heatmap, none of the fold change values are shown. Hope this helps!

  • @noorchris3718
    @noorchris3718 5 месяцев назад

    Thank you so much! Can you perhaps send me your dds file? I don't know what it entails, just to see how I can match it to my data!

  • @freezingtolerance7493
    @freezingtolerance7493 Год назад

    Hello, sir. Thanks for your video; just quick question. I loaded 3 condtions (e.g. A, B, C). When I did "dds" I first compared A vs B and resultant data was saved as "sigs". Then, I tried heat map using "sigs" data. In the result of heat map, I had all conditions (ABC) presented in heat map; I expected that only A and B replications should be presented but all treatments (i.e. condition) had been presented. Do you know why it happens?

    • @sanbomics
      @sanbomics  Год назад

      The differential expression and the actual heatmap aren't connected. DE is just a way to pick the genes to show in the heatmap. If you don't want to show all three conditions in the heatmap you will have to get rid of those columns from the counts matrix.

    • @freezingtolerance7493
      @freezingtolerance7493 Год назад

      @@sanbomics Thank you for your response. I understand.

  • @chrisdoan3210
    @chrisdoan3210 Год назад

    Thank you so much for your video! The value in my matrix is just a little different from yours and my heatmap is quite different. Would you please explain why?

    • @sanbomics
      @sanbomics  Год назад

      Hi! No problem! It's hard for me to say without knowing exactly what you did. You used the same data as me and processed it the same exact way in my other videos with STAR, deseq2, etc?

    • @chrisdoan3210
      @chrisdoan3210 Год назад

      @@sanbomics Yes. I used STAR and Deseq2 as you did. I also commented on video about Deseq2.

    • @sanbomics
      @sanbomics  Год назад

      If the values are just slightly different I wouldn't worry about it too much. When did you filter out genes with low expression?

    • @chrisdoan3210
      @chrisdoan3210 Год назад

      @@sanbomics I filtered out as you did in previous video: counts 50),]

    • @sanbomics
      @sanbomics  Год назад

      before or after running the differential expression? In my first deseq video I did it before running deseq. But it is better to do it after. Before, only do 0

  • @0916079787
    @0916079787 Год назад

    Thank you for the video. How to show specific genes of interest in the heatmap?

    • @sanbomics
      @sanbomics  Год назад +1

      You can specify any genes you want here: assay(rlog_out)[rownames(df.top), rownames(coldata)]
      I just picked the rownames from df.top, but you can pass any vector of ids

    • @0916079787
      @0916079787 Год назад

      @@sanbomics I will try it, thank you so much for your help and videos.

    • @oliviaringham8706
      @oliviaringham8706 9 месяцев назад

      I am still confused by this. Where do you input the assay part when making this heatmap? I thought that you grab the data from the counts matrix but is this shortening the counts matrix and significant gene dataframe?

  • @mirij827
    @mirij827 2 года назад

    I am dealing with HMPREF0299 which are Human Microbiome project keys. DO you know by any chance which key am I supposed to use instead of "ENSEMBL"?
    `

    • @sanbomics
      @sanbomics  2 года назад

      Hi. Sorry, I have never worked with that unfortunately :(

  • @user-dj4wo3pr7j
    @user-dj4wo3pr7j 9 месяцев назад

    Hi there, Great Vid. When i attempt to filter out the matrix for only genes of interest i get the following error:
    Error in counts(dds, normalized = T)[rownames(sigs.df), ] :
    subscript out of bounds
    Any ideas

    • @sanbomics
      @sanbomics  9 месяцев назад

      Sorry, it is hard to troubleshoot without seeing more

  • @FarhanHaqj
    @FarhanHaqj 2 года назад

    Thanks alot
    When I use this command :
    sigs.d$symbol

    • @sanbomics
      @sanbomics  2 года назад

      Hi, can you copy and paste one of your gene ids here?

    • @sannelith7275
      @sannelith7275 Год назад

      Hi! I have the same problem. Did you find the solution?
      When I use: rownames(df) I do get all my ENSEMBL IDs..

    • @pumla5481
      @pumla5481 5 месяцев назад

      I have a a similar problem what is the possible solution?

  • @darshiv_
    @darshiv_ Год назад

    hello, i have followed your video and im getting an error
    Error: Length of `row_labels` should be the same as the nrow of matrix.
    this is the code that i have typed:
    Heatmap(mat.z, cluster_rows = T, cluster_columns = T, column_labels = colnames(mat.z), name="Z-score", row_labels = sigs.df[rownames(mat.z),]$symbol)
    can you let me know how to rectify it ? and i also want to sort the files in alphabetical order: my file names are r01, r02 and so on till r09; but in the heatmap, its jumbled.. can you pls help

    • @sanbomics
      @sanbomics  Год назад

      Hi, thanks for commenting. It is hard for me to troubleshoot like this. Try to find out why sigs.df[rownames(mat.z),]$symbol is not the same length as mat.z.

  • @imrankhan-cn8ky
    @imrankhan-cn8ky Год назад

    while mapping Ids i am getting this error ( None of the keys entered are valid keys for 'ENSEMBL'. Please use the keys method to see a listing of valid arguments.)
    i cant find a solution to it. any help will be appreciated
    thanks

  • @SamipSapkota-zg8hy
    @SamipSapkota-zg8hy 2 месяца назад

    there is no complex heat map package

  • @azxcf2912
    @azxcf2912 Месяц назад

    @Sanbomics... good content but you really need to learn how to talk!

    • @sanbomics
      @sanbomics  Месяц назад

      I done gone learned how to talk real good like enough. No idea what u r meaning. Such rude

  • @pumla5481
    @pumla5481 5 месяцев назад

    Thank you for th great video but i have a problem; sigs.df$symbol

  • @anindorahman2600
    @anindorahman2600 2 года назад

    Hello Sir, I am facing problem with my data and Couldn't generate the Heatmap. Can you please take my data and help me in this matter...
    Please provide me the facebook/ Instagram / Mail address where i can send you the data... Thanks In advance

    • @sanbomics
      @sanbomics  2 года назад

      Hi. Still having issues? What errors were you getting?