bmansfeld / QTLseqr

QTLseqr is an R package for QTL mapping using NGS Bulk Segregant Analysis
64 stars 42 forks source link

plotQTLStats scaling #1

Closed mstetter closed 6 years ago

mstetter commented 6 years ago

really nice package you created, it is really easy to use. I think it would be better though to set the scale and space in the plotQTLStats function to free_x otherwise the plots looks misleading as chromosomes look differently large.

bmansfeld commented 6 years ago

Hi, Thanks for the great feedback. I really appreciate it. Hoping that QTLseqr can be useful in your research. scale is already set as "free_x" but I will definitely try setting space as well. I imagine that this will have each chromosome's x axis sized relatively.

bmansfeld commented 6 years ago

What's nice about ggplot2 is that you could always re-assign the facets:

p1 <- plotQTLStats(df_filt, var = "nSNPs", plotThreshold = FALSE)
p1 <- p1 + facet_grid(~ CHROM, scales = "free_x", space = "free_x")
p1

But I'll consider making that the default. Frankly, I didn't know about the scale argument in facet_grid

mstetter commented 6 years ago

Right, re-assigning is a good idea. Thanks for fixing this so fast.

I ended up writing my own plot function, but the one you have is really nice already. Just thought it would useful for other people and I think would be a good default. Was really smooth to run QTLseqr.

bmansfeld commented 6 years ago

Ok so I added a scaleChroms parameter in the plotQTLStats function which allows the user to choose if they want scaled chroms or not. default set to TRUE