deeptools / pyGenomeTracks

python module to plot beautiful and highly customizable genome browser tracks
GNU General Public License v3.0
758 stars 111 forks source link

Missing tracks from RNA-seq bigwig file when using pyGenomeTracks #470

Open Miracle-Yao opened 5 months ago

Miracle-Yao commented 5 months ago

Hi, @lldelisle

Here's a strange question. I hope to have your guidance.

In the first genomic region I was interested in, I could successfully plot a perfect figure. However, when I select the second region of interest, there is a missing RNA-seq track in it, despite being able to run it properly. I have not set a max and min value and have repeatedly confirmed the presence of higher reads(values) in that region in the bw or bedgraph files (by loading file to IGV and manually extract specific region of interest). Other ChIP-seq tracks can be displayed normally. How do I fix this? Another small question, why is the data range of IGV and pyGenomeTracks different for the same bw file? Is there a detailed documentation for the number_of_bins and summary_method parameters?

I'm looking forward to your response! Best, Yao

test.png

test

version

pyGenomeTracks 3.8
Python 3.8.19

command

pyGenomeTracks --tracks test_tracks.ini -o test.png --region chr1:22920000-23150000 --width 100 --height 100 --title "Test" --dpi 300

Partial configuration

[mRNA.1]
file = mRNA.1.bw
title = mRNA.1
height = 3
color = #FF6347
#min_value = 0
#max_value = 1
number_of_bins = 700
nans_to_zeros = true
summary_method = mean
show_data_range = true
file_type = bigwig

[spacer]
## height of space in cm (optional)
height = 2

[mRNA.2]
file = mRNA.2.bw
title = mRNA.2
height = 3
color = #32CD32
#min_value = 0
#max_value = 1
number_of_bins = 700
nans_to_zeros = true
summary_method = mean
show_data_range = true
file_type = bigwig

log

INFO:pygenometracks.tracksClass:initialize 1. [x-axis]
INFO:pygenometracks.tracksClass:initialize 2. [spacer]
INFO:pygenometracks.tracksClass:initialize 3. [HiC]
INFO:pygenometracks.tracksClass:initialize 4. [spacer]
INFO:pygenometracks.tracksClass:initialize 5. [Contacts]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 83/83 [00:00<00:00, 19620.54it/s]
INFO:pygenometracks.tracksClass:initialize 6. [spacer]
INFO:pygenometracks.tracksClass:initialize 7. [ChIP.1]
INFO:pygenometracks.tracksClass:initialize 8. [spacer]
INFO:pygenometracks.tracksClass:initialize 9. [ChIP.2]
INFO:pygenometracks.tracksClass:initialize 10. [spacer]
INFO:pygenometracks.tracksClass:initialize 11. [mRNA.1]
INFO:pygenometracks.tracksClass:initialize 12. [spacer]
INFO:pygenometracks.tracksClass:initialize 13. [mRNA.2]
INFO:pygenometracks.tracksClass:initialize 14. [spacer]
INFO:pygenometracks.tracksClass:initialize 15. [ChIP.3]
INFO:pygenometracks.tracksClass:initialize 16. [spacer]
INFO:pygenometracks.tracksClass:initialize 17. [Bed.1]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 6297.75it/s]
INFO:pygenometracks.tracksClass:initialize 18. [spacer]
INFO:pygenometracks.tracksClass:initialize 19. [ChIP.4]
INFO:pygenometracks.tracksClass:initialize 20. [spacer]
INFO:pygenometracks.tracksClass:initialize 21. [Bed.2]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 7902.60it/s]
INFO:pygenometracks.tracksClass:initialize 22. [spacer]
INFO:pygenometracks.tracksClass:initialize 23. [Gene.gtf]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1327.31it/s]
INFO:pygenometracks.tracksClass:initialize 24. [Highlight-Region]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 9731.56it/s]
INFO:pygenometracks.tracksClass:time initializing track(s):
INFO:pygenometracks.tracksClass:67.17126893997192
DEBUG:pygenometracks.tracksClass:Figure size in cm is 100.0 x 100.0. Dpi is set to 300

INFO:pygenometracks.tracksClass:plotting 1. [x-axis]
INFO:pygenometracks.tracksClass:plotting 2. [spacer]
INFO:pygenometracks.tracksClass:plotting 3. [HiC]
WARNING:pygenometracks.tracks.HiCMatrixTrack:The depth was set to 460000 which is more than 125% of the region plotted. The depth will be set to 287500.
INFO:pygenometracks.tracksClass:plotting 4. [spacer]
INFO:pygenometracks.tracksClass:plotting 5. [Contacts]
DEBUG:pygenometracks.tracks.GenomeTrack:1 were links plotted
INFO:pygenometracks.tracksClass:plotting 6. [spacer]
INFO:pygenometracks.tracksClass:plotting 7. [ChIP.1]
INFO:pygenometracks.tracksClass:plotting 8. [spacer]
INFO:pygenometracks.tracksClass:plotting 9. [ChIP.2]
INFO:pygenometracks.tracksClass:plotting 10. [spacer]
INFO:pygenometracks.tracksClass:plotting 11. [mRNA.1]
INFO:pygenometracks.tracksClass:plotting 12. [spacer]
INFO:pygenometracks.tracksClass:plotting 13. [mRNA.2]
INFO:pygenometracks.tracksClass:plotting 14. [spacer]
INFO:pygenometracks.tracksClass:plotting 15. [ChIP.3]
INFO:pygenometracks.tracksClass:plotting 16. [spacer]
INFO:pygenometracks.tracksClass:plotting 17. [Bed.1]
DEBUG:pygenometracks.tracks.GenomeTrack:ylim 1.08,-0.08
INFO:pygenometracks.tracksClass:plotting 18. [spacer]
INFO:pygenometracks.tracksClass:plotting 19. [ChIP.4]
INFO:pygenometracks.tracksClass:plotting 20. [spacer]
INFO:pygenometracks.tracksClass:plotting 21. [Bed.2]
DEBUG:pygenometracks.tracks.GenomeTrack:ylim 1.08,-0.08
INFO:pygenometracks.tracksClass:plotting 22. [spacer]
INFO:pygenometracks.tracksClass:plotting 23. [Gene.gtf]
DEBUG:pygenometracks.tracks.GenomeTrack:ylim 1.08,-0.08
lldelisle commented 5 months ago

Hi, Thanks for your bug report. I don't see any explanation for the missing RNA. I guess you already carefully checked the coordinates you are plotting. Would you mind to share with me one of the bw file?

Another small question, why is the data range of IGV and pyGenomeTracks different for the same bw file? Is there a detailed documentation for the number_of_bins and summary_method parameters?

The way pyGenomeTracks is working is with bigwigs:

I think IGV is doing more or less the same except that you cannot control the number of intervals.

If you choose summary_method = max on both, you should have the same data range. If you choose summary_method = mean then it depends on the bin size and the bin boundaries...