QQ plot downsampling

Hi hail team,
is it possible to downsample the QQ plot for specific p-values?
I would like to show sparse datapoints for p-values <0.01 and dense datapoints for p-values >0.01.
Is this something I can do using the hl.plot.qq function?

q = hl.plot.qq(gwas.p_value, collect_all=False, n_divisions=100, title=f"{pheno_name} QQ plot")

Thanks,
Pavlos

Others can feel free to chime in if there’s some argument I don’t know about, but my intuition is that the way to do this is to filter or downsample your gwas table in advance.

Is the standard downsampling approach causing problems? If so, what are those problems?

It’s a request from faculty members here to have more datapoints for higher p-values as it’s a more correct qq-plot, specifically they would like me to set a cutoff of p-value 0.01. Perhaps I can do that by downsampling the gwas table in advance as @johnc1231 suggests. I was just wondering if there was any other way you have done this before.

It’s a request from faculty members here to have more datapoints for higher p-values as it’s a more correct qq-plot

The hl.agg.downsample aggregator called by qq already does this – it does “visual” downsampling, merging points in adjacent pixels, essentially. Unless you have two points with exactly the same p-value, the right tail of the qq plot is going to be at full resolution.

that’s great news @tpoterba! pleased I won’t have to manually downsample the dataset. Thank you again for all your help.