computeMartix and plotHeatmap with several bw files

1,143 views
Skip to first unread message

陈子臻

unread,
Nov 9, 2016, 10:42:58 AM11/9/16
to deepTools
Hi:
Thanks for your deep tools,it's useful!
I have 9 chip-seq bw files about histone modifications and TF and a RNA expression profile.I used computeMartix and plotHeatmap to generate 9 heatmaps in a picture,just like the example in the website http://deeptools.readthedocs.io/en/latest/content/tools/plotHeatmap.html.
I've read all docs about computeMartix and plotHeatmap,but I still have some questions:
1,I'm confused that if the same row in different heatmaps represent the same gene?
2,By default,if genes are sorted by mean signal of all bigwig files?
3,Any suggestions if I want to sort genes by mean signal of a particular bigwig file?
4,What  I can do if I want to order these genes by their expression level in heat map?
5,Can I define the different ymins and ymaxs in different plotprofile at the top of heatmap just like how I define Zmax and Zmin? 

Steffen Heyne

unread,
Nov 9, 2016, 11:00:00 AM11/9/16
to 陈子臻, deepTools
Hi,


On 09.11.2016 16:42, 陈子臻 wrote:
> Hi:
> Thanks for your deep tools,it's useful!
> I have 9 chip-seq bw files about histone modifications and TF and a RNA
> expression profile.I used computeMartix and plotHeatmap to generate 9
> heatmaps in a picture,just like the example in the website
> http://deeptools.readthedocs.io/en/latest/content/tools/plotHeatmap.html.
> I've read all docs about computeMartix and plotHeatmap,but I still have
> some questions:
> 1,I'm confused that if the same row in different heatmaps represent the
> same gene?
yes

> 2,By default,if genes are sorted by mean signal of all bigwig files?
yes

> 3,Any suggestions if I want to sort genes by mean signal of a particular
> bigwig file?
plotHeatmap has the option "--sortUsingSamples" here you can specify the
bigwig files to be used for sorting (e.g. "1 3"), files are given by
their index in the order you specified them

> 4,What I can do if I want to order these genes by their expression
> level in heat map?
computeMatrix has the option "--sortRegions keep" (from version 2.4.0).
So you can presort your regions by expression and then plot heatmaps
accordingly by also using plotHeatmap with "--sortRegions no"

> 5,Can I define the different ymins and ymaxs in different plotprofile at
> the top of heatmap just like how I define Zmax and Zmin?

I think currently this is not implemented, only for the z-scale, ie. the
coloring

>
> --
> You received this message because you are subscribed to the Google
> Groups "deepTools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to deeptools+...@googlegroups.com
> <mailto:deeptools+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Does this help?


Thanks,
steffen


--
Dr. Steffen Heyne, PostDoc
Epigenetic Focus - Pospisilik lab
Tel.: +49-(0)761-5108-255
he...@ie-freiburg.mpg.de
http://www.ie-freiburg.mpg.de/

Fidel Ramirez

unread,
Nov 9, 2016, 11:40:47 AM11/9/16
to Steffen Heyne, 陈子臻, deepTools
with respect to:

5,Can I define the different ymins and ymaxs in different plotprofile at
the top of heatmap just like how I define Zmax and Zmin?

I think that if you plot the profiles using plotProfile you can set zMax and zMin for each case.

-fidel



For more options, visit https://groups.google.com/d/optout.

Does this help?


Thanks,
steffen


--
Dr. Steffen Heyne, PostDoc
Epigenetic Focus - Pospisilik lab
Tel.: +49-(0)761-5108-255
he...@ie-freiburg.mpg.de
http://www.ie-freiburg.mpg.de/
--
You received this message because you are subscribed to the Google Groups "deepTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deeptools+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Fidel Ramirez

陈子臻

unread,
Nov 14, 2016, 12:11:09 PM11/14/16
to Fidel Ramirez, Steffen Heyne, deepTools
It's useful.Thanks a lot.XD

陈子臻

unread,
Nov 15, 2016, 9:56:56 AM11/15/16
to deepTools, chenzi...@gmail.com, he...@ie-freiburg.mpg.de
Hi:
Sorry to disturb you again.
I used computeMatrix  option "--sortRegions keep" and plotHeatmap with "--sortRegions no" to generate gene expression ordered heatmap . I can get the martrix file but not the heat map.Here is the output in the terminal:

Skipping Eno1b, due to being absent in the computeMatrix output.

Skipping H2-T9, due to being absent in the computeMatrix output.

Skipping Tgoln2, due to being absent in the computeMatrix output.

Skipping Sap18, due to being absent in the computeMatrix output.

Skipping Rps27rt, due to being absent in the computeMatrix output.

Skipping Eif3j2, due to being absent in the computeMatrix output.

Skipping Klra4, due to being absent in the computeMatrix output.

Skipping Lrch4, due to being absent in the computeMatrix output.

Skipping Srp54c, due to being absent in the computeMatrix output.

Skipping Rnaset2b, due to being absent in the computeMatrix output.

Skipping Tmem254b, due to being absent in the computeMatrix output.

Skipping Tmem254c, due to being absent in the computeMatrix output.

Skipping Hist1h4n, due to being absent in the computeMatrix output.

Skipping Gm14308, due to being absent in the computeMatrix output.

Skipping Evi2b, due to being absent in the computeMatrix output.

Skipping Gm2002, due to being absent in the computeMatrix output.

Skipping Amd2, due to being absent in the computeMatrix output.

Skipping Hist2h2aa2, due to being absent in the computeMatrix output.

Skipping Plac9b, due to being absent in the computeMatrix output.

Skipping Dynlt1f, due to being absent in the computeMatrix output.

Skipping Prl2c4, due to being absent in the computeMatrix output.

Skipping Raet1b, due to being absent in the computeMatrix output.

Skipping Raet1e, due to being absent in the computeMatrix output.

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/3.5/bin/plotHeatmap", line 11, in <module>

    main(args)

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/deeptools/plotHeatmap.py", line 557, in main

    hm.read_matrix_file(matrix_file)

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/deeptools/heatmapper.py", line 765, in read_matrix_file

    sample_labels=self.parameters['sample_labels'])

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/deeptools/heatmapper.py", line 1012, in __init__

    "row max do not match matrix shape"

AssertionError: row max do not match matrix shape

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (45) Snord93 chr5:23358050:23358095. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (30) AF357359 chr12:110888918:110888948. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (49) Mir374c chrX:100768423:100768472. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (48) Snord43 chr15:79913288:79913336. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (46) Snord64 chr7:67123696:67123742. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (45) Snord45b chr3:153573530:153573575. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (43) Mir7238 chr8:11635693:11635736. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (48) Snord68 chr8:125626957:125627005. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (45) Snord42a chr11:77994803:77994848. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (39) Mir7228 chr5:135047945:135047984. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (42) Scarna9 chr9:15130732:15130774. Skipping...

A region that is shorter than the bin size (possibly only after accounting for unscaled regions) was found: (49) Mir299b chr12:110948854:110948903. Skipping...

Skipping Eno1b, due to being absent in the computeMatrix output.

Skipping H2-T9, due to being absent in the computeMatrix output.

Skipping Tgoln2, due to being absent in the computeMatrix output.

Skipping Sap18, due to being absent in the computeMatrix output.

Skipping Rps27rt, due to being absent in the computeMatrix output.

Skipping Eif3j2, due to being absent in the computeMatrix output.

Skipping Klra4, due to being absent in the computeMatrix output.

Skipping Lrch4, due to being absent in the computeMatrix output.

Skipping Srp54c, due to being absent in the computeMatrix output.

Skipping Rnaset2b, due to being absent in the computeMatrix output.

Skipping Tmem254b, due to being absent in the computeMatrix output.

Skipping Tmem254c, due to being absent in the computeMatrix output.

Skipping Hist1h4n, due to being absent in the computeMatrix output.

Skipping Gm14308, due to being absent in the computeMatrix output.

Skipping Evi2b, due to being absent in the computeMatrix output.

Skipping Gm2002, due to being absent in the computeMatrix output.

Skipping Amd2, due to being absent in the computeMatrix output.

Skipping Hist2h2aa2, due to being absent in the computeMatrix output.

Skipping Plac9b, due to being absent in the computeMatrix output.

Skipping Dynlt1f, due to being absent in the computeMatrix output.

Skipping Prl2c4, due to being absent in the computeMatrix output.

Skipping Raet1b, due to being absent in the computeMatrix output.

Skipping Raet1e, due to being absent in the computeMatrix output.

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/3.5/bin/plotHeatmap", line 11, in <module>

    main(args)

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/deeptools/plotHeatmap.py", line 557, in main

    hm.read_matrix_file(matrix_file)

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/deeptools/heatmapper.py", line 765, in read_matrix_file

    sample_labels=self.parameters['sample_labels'])

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/deeptools/heatmapper.py", line 1012, in __init__

    "row max do not match matrix shape"

AssertionError: row max do not match matrix shape


And my code:


computeMatrix reference-point -R 25.bed 50.bed 75.bed 100.bed inactive.bed  -S wt_pol2_FE.bw wt_h3k4me3_FE.bw wt_h3k27me3_FE.bw  wt_119ub_FE.bw asxl1_FE.bw -o ../matrix/asxl1_exp_tss.gz  -a 3000 -b 3000 --sortRegions keep

plotHeatmap -m asxl1_exp_tss.gz -out asxl1_exp_tss.png --colorMap Greens --whatToShow 'plot, heatmap and colorbar' --zMin 0 0 0 0 0 --zMax 5 15 5 5 10 --boxAroundHeatmaps no --sortRegions no

computeMatrix scale-regions -R 25.bed 50.bed 75.bed 100.bed inactive.bed  -S wt_pol2_FE.bw wt_h3k4me3_FE.bw wt_h3k27me3_FE.bw  wt_119ub_FE.bw asxl1_FE.bw -o asxl1_exp_all_region.gz  -a 3000 -b 3000 -m 6000 -bs 50  --sortRegions keep
plotHeatmap -m asxl1_exp_all_region.gz -out asxl1_exp_all_region.png --colorMap Greens --whatToShow 'plot, heatmap and colorbar' --zMin 0 0 0 0 0 --zMax 5 15 5 5 10 --boxAroundHeatmaps no --sortRegions no

Any advice?

What's more,should I normalize bw files by sequencing depth before they are used in computeMatrix?

Thanks! 

Fidel Ramirez

unread,
Nov 15, 2016, 11:57:56 AM11/15/16
to 陈子臻, deepTools, Steffen Heyne
If you want to sort the second heatmap according to the sorting in the first heatmap you need to do:

1. computeMatrix ..... (don't add --sortRegions keep)
2. plotHeatmap .... --outFileSortedRegions output.bed (don't add --sortRegions no)
3. computeMatrix  .... -R output.bed --sortRegions keep
4. plotHeatmap .... --sortRegions no

-fidel

--
You received this message because you are subscribed to the Google Groups "deepTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deeptools+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Fidel Ramirez

陈子臻

unread,
Nov 15, 2016, 1:04:21 PM11/15/16
to deepTools, chenzi...@gmail.com, he...@ie-freiburg.mpg.de
No, actually I want to sort the two heatmaps all by gene expression.And I have generated the bed files myself. 
So, I did 
1 generate heatmap around TSS:computeMatrix reference-point --sortRegions keep;plotHeatmap --sortRegions no
2 generate heatmap from TSS to TTS:computeMatrix reference-point --sortRegions keep;plotHeatmap --sortRegions no

And I found "AssertionError: row max do not match matrix shape" in terminal output. Is that the reason why the program break?

在 2016年11月16日星期三 UTC+8上午12:57:56,Fidel Ramirez写道:
To unsubscribe from this group and stop receiving emails from it, send an email to deeptools+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Fidel Ramirez

Devon Ryan

unread,
Nov 15, 2016, 3:17:29 PM11/15/16
to 陈子臻, deepTools

Please post the BED and bigWig files somewhere and I can take a look at why this is breaking tomorrow. As the others mentioned, this is probably just a bug in the "--sortRegions keep" code.

Devon

-- 
Devon Ryan, PhD
Bioinformatician / Data manager
Bioinformatics Core Facility
Max Planck Institute for Immunobiology and Epigenetics
Email: dpry...@gmail.com

陈子臻

unread,
Nov 16, 2016, 1:46:35 AM11/16/16
to deepTools, chenzi...@gmail.com
Today I run computMatrix and plotheatmap with --sortRegions keep  --sortRegions no separately again.
I provided the program with one bed and it worked.But if I provide 5 beds , I could not get the heatmap.
Do you have a FTP address I can send my data to?
ZIzhen Chen
在 2016年11月16日星期三 UTC+8上午4:17:29,Devon Ryan写道:

Devon Ryan

unread,
Nov 16, 2016, 2:53:24 AM11/16/16
to 陈子臻, deepTools
Yes, please create an account on our deeptools.ie-freiburg.mpg.de
Galaxy site and FTP file there. Then please just let me know the email
address you used.

Devon
--
Devon Ryan, Ph.D.
Email: dpr...@dpryan.com
Data Manager/Bioinformatician
Max Planck Institute of Immunobiology and Epigenetics
Stübeweg 51
79108 Freiburg
Germany

Fidel Ramirez

unread,
Nov 16, 2016, 6:05:24 AM11/16/16
to Devon Ryan, 陈子臻, deepTools
Check this issue: https://github.com/fidelram/deepTools/issues/447

I think you have a similar problem. 


> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "deepTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deeptools+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Fidel Ramirez

陈子臻

unread,
Nov 21, 2016, 2:35:52 AM11/21/16
to deepTools, dpr...@dpryan.com
Thanks, I've solved this problem.I made a mistake when I build my bed files.There were several genes appeared in different bed files.It worked well after I deleted them.
Sorry to reply you so late.

在 2016年11月16日星期三 UTC+8下午7:05:24,Fidel Ramirez写道:
Reply all
Reply to author
Forward
0 new messages