Question: Heatmap for gene expression
0
gravatar for Aynur
6 weeks ago by
Aynur10
Aynur10 wrote:

Hello, I am new to bioinformatics. I am trying to make a heat map for my up and down-regulated genes for a given condition. I want to show only up and down-regulated genes with or without showing gene names on the heat map. My gene list is 269 , so I am not sure if I can show all genes. I have cuffdiff output file and HTSeq counts. I also checked a lot of tutorials, but I could not find a code which fits my need. I read DESeq2 documentation, but still can not make such a heat map. I have two biological replicates for each condition. Thank you very much. Update. I tried to make a heatmap with bioinfokit on python from https://reneshbedre.github.io/blog/hmap.html using FPKM values from cuffdiff. But when import my data I got error messages, which I can't solve. This is the code on jupyter notebook from bioinfokit import analys, visuz df = analys.get_data('hmap.csv').data df.head() and below is the error message. Error: Provide correct parameter for data


AttributeError Traceback (most recent call last) <ipython-input-3-05cbc17535b8> in <module> 1 from bioinfokit import analys, visuz ----> 2 df = analys.get_data('hmap.csv').data

AttributeError: 'get_data' object has no attribute 'data'

Please help me with this error message. I would like to use this bioinfokit.
First time trying to make a post here, so it might not be very clear about what I am looking for. Thanks for your patience. Best wishes, Thanks.

sequencing rna-seq R • 307 views
ADD COMMENTlink modified 5 weeks ago by Renesh1.9k • written 6 weeks ago by Aynur10

Once you have a heatmap, if hiding gene names is the problem, you can always find a way to tweak how row-names or column-names are shown. I'd recommend you look at ComplexHeatmap (might be a bit of an overkill here, but it is the most flexible when it comes to features).

ADD REPLYlink written 6 weeks ago by RamRS30k

post some example data and expected type of image (hand drawn, publication, online link etc).

ADD REPLYlink written 6 weeks ago by cpad011214k

Thank you very much for taking the time to reply. I really appreciate it.

Here is an example. This is FPKM value for genes at two conditions. There are 229 genes.

gene    A   B
Serpinb2    0.565838    30.0764
Serpina3n   0.574644    28.8829
Prg4    0.0804468   2.066
Sprr2e  0.261479    6.64631
Wt1 0.334992    6.86878
Tgm1    0.0698403   1.28107
Gm6093  0.173604    2.7926
Prl2c3  2.73157 38.9992
Abi3bp  0.0489833   0.685917
Tmprss11b   0.0514014   0.711783

I want to make a heat map with gene names and hopefully, it will look like this.

Thank you very much.

heatmap

I am learning to insert a figure here.

ADD REPLYlink modified 6 weeks ago by RamRS30k • written 6 weeks ago by Aynur10

Dear all, Thank you very much for all kind help. As my data did not have N/A other values, I was able to make a heat map using above python code. But my advisor explicitly wants a heatmap shown above. Meaning, use different colors for different samples. I did not see this option and is it possible to get like that from complexheatmap? Also , can I make a heatmap using zFPKM values?

Thanks,

ADD REPLYlink written 5 weeks ago by Aynur10

Meaning, use different colors for different samples

Colors depend on the data. In the figure above, different samples do not have different colors because they were assigned those colors, they have different colors because the data happens to be that way.

is it possible to get like that from complexheatmap

Yes, but your requirement is fundamentally flawed.

can I make a heatmap using zFPKM values

ComplexHeatmap allows for heatmap using any values.

ADD REPLYlink written 5 weeks ago by RamRS30k
1
gravatar for Renesh
5 weeks ago by
Renesh1.9k
United States
Renesh1.9k wrote:

Hi akashagri19,

Thank you for using the bioinfokit for heatmap. You need to first import your data as a pandas dataframe. You can not use get_data as it is for internal example datasets. Import your dataset as

import pandas as pd
df = pd.read_csv('your_data.csv')   # for CSV file
df = pd.read_csv('your_data.csv', sep='\t')   # for tab-separated file

Once, you successfully imported the dataset, then use run the heatmap analysis as described

For the faster reply regarding bioinfokit queries, please create an issue on GitHub https://github.com/reneshbedre/bioinfokit/issues

`

ADD COMMENTlink modified 5 weeks ago • written 5 weeks ago by Renesh1.9k

I'd recommend ComplexHeatmap over this package - this one can't handle NA values and has far fewer features than ComplexHeatmap does. ComplexHeatmap also comes with insanely good documentation.

ADD REPLYlink written 5 weeks ago by RamRS30k
0
gravatar for jkkbuddika
6 weeks ago by
jkkbuddika150
Bloomington, USA
jkkbuddika150 wrote:

You can use pheatmap to do this. Did you want to make something like this?

this

ADD COMMENTlink modified 6 weeks ago • written 6 weeks ago by jkkbuddika150

My 2 cents:

  1. Red-green is a bad color scale. Ideally, one should go for viridis and if not, red-white-blue is a better spectrum (more color-blind friendly than red-green)
  2. For someone that's just entering heatmaps, ComplexHeatmap would be better than pheatmap because it is more structured - pheatmap is a lot more chaotic IMO (what with it being a single function with a gazillion parameters).
ADD REPLYlink written 6 weeks ago by RamRS30k

This looks good too. Let me try this one. Thank you very much.

ADD REPLYlink written 6 weeks ago by Aynur10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1091 users visited in the last hour