harbourlab / SparK

Publication quality NGS track plotting
102 stars 20 forks source link

range of y-axis #3

Closed karini925 closed 4 years ago

karini925 commented 4 years ago

Is there any way to control the range of the y-axis? I am comparing a histone mark across three treatments and would like the y-axis to display the same range, is that possible with this tool? thanks! also while I am here, any chance coordinates can be printed out? test_case.pdf

harbourlab commented 4 years ago

Hi! Yes, just do autoscale (-gs yes) that will result in all y-axis to be the same. Let me know if that works for you! I can implement the coordinates to be printed out, thats a great idea! Will do so in a week or so.. Further, your scalebar is missing.. did you remove that? Also there are no labels for the group.. I'm assuming you removed them or did not set them?

karini925 commented 4 years ago

The coordinates would be awesome to add on! My scalebar is indeed missing and I am not sure why, it is set at the default "yes". Any thought as to why this may be? For y-axis, I am wondering about setting it to a certain value as the values range from plot to plot (see attached). Ideally I would set the range in both plots to 0-2.5, is that at all possible? thanks !!
test_case_spark.pdf

harbourlab commented 4 years ago

Did you try "-gs yes"? That should do exactly what you need and scale the y-axis. I'll look into why the scale bar is missing..

karini925 commented 4 years ago

thanks! and yes, I did "-gs yes" but the two plots still have different y-axis ranges.

python $spark \ -pr $region \ -cf 009_broad_treat_pileup.bdg 021_broad_treat_pileup.bdg \ -tf 012_broad_treat_pileup.bdg 024_broad_treat_pileup.bdg \ -tg 1 1 \ -cg 1 1 \ -gs yes \ -gl H3K27AC \ -dg $region_name \ -gff $gtf \ -pt STD \ -l LEN COMBO \ -w 200 \ -f 005CFF CE358B \ -scale yes \ -bed $consensus_peaks $methy \ -bedcol EF1414 FFBC00

harbourlab commented 4 years ago

I see.. you are plotting both plots individually. What you need to do - and this is way easier - is plot all at once. Use this:

-cf file1.bdg file2.bdg file3.bdg file4.bdg -tf file5.bdg file6.bdg file7.bdg file8.bdg -tg 1 1 2 2 -cg 1 1 2 2

This way, the first two files in -cf and -tf will go to the first plot, and the last two into the second plot. And with "-gs yes" SparK will autoscale both. Let me know if that works!

harbourlab commented 4 years ago

Were you able to try? I can not reproduce your missing scalebar. Let me know if that is still occurring!

karini925 commented 4 years ago

thanks - yes it works! for some reason the scale bar wasn't visible but when I put the svg into Affinity Designer I was able see it

harbourlab commented 4 years ago

Ah perfect! Glad it works. I'll be implementing more ways of defining the y-axis soon, and plotting the coordinates. Should be done in next couple days.

karini925 commented 4 years ago

Awesome, thank you!

harbourlab commented 4 years ago

just uploaded version 2.5 which has more options to customize the y-axis.. need to do a little spacing tweek for some cases but should work fine for most.