PoisonAlien / trackplot

Generate IGV style locus tracks from bigWig files in R
140 stars 16 forks source link

Custom scaling and smoothening enhancements #5

Closed ryanmboileau closed 3 years ago

ryanmboileau commented 3 years ago

Hello,

I have been looking for a package like this for a long time so I am a big fan. Any chance there may eventually be options for choosing our own y-scaling and track smoothening/window averaging?

All the best, Ryan

PoisonAlien commented 3 years ago

Hi, I am glad you find the tool useful. I am happy to implement the feature requests. Could you please explain a bit about y-scaling and window averaging?

I am guessing by custom y-scale, you meant to have manual limits for y-axis for every track?

ryanmboileau commented 3 years ago

Sure thing-- Yes I meant setting a manual y-scale limit for each track (or group of tracks).

For window averaging, it would be similar to an option in deeptools/bamcompare e.g. --smoothLength "The smooth length defines a window, larger than the binSize, to average the number of reads. For example, if the –binSize is set to 20 and the –smoothLength is set to 60, then, for each bin, the average of the bin and its left and right neighbors is considered. Any value smaller than –binSize will be ignored and no smoothing will be applied."

PoisonAlien commented 3 years ago

I will see what I can do..

dfernandezperez commented 3 years ago

I would also appreciate a lot to be able to provide a vector of y-max values. Sometimes with ChIPseq data I want to show that there is no signal across a particular genomic window, and I would like to set the scale based on the signal of a known target where my protein binds. Right now if I do that the scale will be set based on the background levels.

Thanks!

PoisonAlien commented 3 years ago

I have added y_max argument to the track_plot(). Let me know if it works or needs a bit more tunining.

dfernandezperez commented 3 years ago

I think that instead of writing:

` if(y_max){

If custom ylims are provided

plot_height = y_max

}else{ plot_height = round(plot_height, digits = 2)
}`

it should be:

` if(!is.null(y_max)){

If custom ylims are provided

plot_height = y_max

}else{ plot_height = round(plot_height, digits = 2)
}`

Thanks a lot for the update!

PoisonAlien commented 3 years ago

Indeed it was the case. I have corrected it. Thanks for checking..

pbhatia91 commented 1 year ago

I will see what I can do..

Hi! Is the smoothening window enhancement now applied?

P.S. I find this a very simple and easy to use pipeline. Thanks for the package!