ivanek / Gviz

This is the Gviz development repository. Gviz plots data and annotation information along genomic coordinates.
https://bioconductor.org/packages/Gviz/
Artistic License 2.0
75 stars 10 forks source link

y ticks not showing correct values for custmized aggregation function #46

Closed ruqianl closed 2 years ago

ruqianl commented 3 years ago

Hi @ivanek ,

Thanks for the great package!

I'm trying to display a SNP density track with log10 transformed values for 'hist' type DataTracks, the code snipet was used:

snp_track <- DataTrack( GRanges(seqnames = chrom,
                                IRanges(start=snp_anno$POS,
                                        wsidth = 1,
                                        genome = "mm10")),
                        name = "SNPs denstiy",
                        data = rep(1,nrow(snp_anno)),
                        window = nwindow,
                        aggregation  = function(x) { log10(sum(x)+1)},
                        type=plot_type)

It gives the correct histogram shape but the scale and ticks on the y axis are off: image

The scale on y should be from [0,4] but it is all under 1 as shown.

If comparing to using the "sum" as the aggregation function: image

Any idea about how to fix this?

Thanks, Ruqian

ivanek commented 2 years ago

Hi @ruqianl, Sorry for the delay, I only had time to fix it now. Best Robert