deeptools / pyGenomeTracks

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

Question about Plotting GeneHancer file .bed #461

Closed Naveen-Ahuja closed 1 year ago

Naveen-Ahuja commented 1 year ago

Hi,

I was wondering how to plot a GeneHancer track (.bed file) in pygenometracks that looks like the one in UCSC browser(Promoters in red scale and Enhancers in grey scale) Screen Shot 2023-08-11 at 8 44 32 PM

When I plot it looks like this Screen Shot 2023-08-11 at 8 45 41 PM

Here is my code: [GeneHancer hg38] file = GeneHancer_hg38_normal.bed title = GeneHancer hg38 style = UCSC height = 6 width= 6 file_type = bed

Thank you

lldelisle commented 1 year ago

Hi, Could you show me some lines of your bed file with genes and some lines with your bed file with enhancers? For me the way to plot it into pyGenomeTracks would be to split the file into 2 (one for gene and one for enhancer). Then use:

[genes]
file = blabla_genes.bed
title = GeneHancer hg38
display = collapsed
color = ['#FF6666', '#FF3333', '#CC0000']

[enhancers]
file = blabla_enh.bed
display = collapsed
color = ['#C0C0C0', '#A0A0A0', '#5F5F5F']
overlay_previous = share-y

(I did not try but if you send me the lines I will do).

Naveen-Ahuja commented 1 year ago

Hi,

Yea that's what I did, sorry I didn't mention but they are already 2 different files:

[GeneHancer hg38] file = GeneHancer_hg38_normal.bed title = GeneHancer hg38 style = UCSC height = 6 width= 6 file_type = bed

[GENES] file = gencode.v38.annotation.gtf.gz title = gencode hg38 height = 7 color = blue labels = true max_labels = 200 fontsize = 7 style = flybase file_type = gtf

Here is what the Genhancer .bed file looks like (When I originally downloaded it was a bigbed file and then I converted it to .bed). I believe the reserved column (192,192,192) corresponds to color.

chr1 12801 16450 GH01J000013 1 . 12801 16450 192,192,192 Ensembl Enhancer - chr1 20497 21346 GH01J000021 46 . 20497 21346 192,192,192 RefSeq Enhancer - chr1 27599 30401 GH01J000028 35 . 27599 30401 255,102,102 Ensembl Promoter - chr1 33880 40399 GH01J000033 1 . 33880 40399 192,192,192 Ensembl Enhancer - chr1 55800 56600 GH01J000049 1 . 55800 56600 192,192,192 Ensembl Enhancer - chr1 90400 90600 GH01J000083 1 . 90400 90600 192,192,192 Ensembl Enhancer - chr1 103601 105210 GH01J000103 1 . 103601 105210 192,192,192 Ensembl Enhancer - chr1 115799 116001 GH01J000108 101 . 115799 116001 160,160,160 Ensembl Enhancer - chr1 116200 116400 GH01J000116 1 . 116200 116400 192,192,192 Ensembl Enhancer - chr1 119600 119971 GH01J000119 1 . 119600 119971 192,192,192 Ensembl Enhancer - chr1 132000 132800 GH01J000132 1 . 132000 132800 192,192,192 Ensembl Enhancer - chr1 137999 138801 GH01J000137 35 . 137999 138801 255,102,102 Ensembl Promoter -

lldelisle commented 1 year ago

Then it is even easier. Just use color = bed_rgb in your ini file to get the colors as in the bed. And if you want to have them displayed into a single line use collapsed = true. I think the labels are not interesting so you can use labels = false. All options for bed are available here

Naveen-Ahuja commented 1 year ago

Thank you