Skip to content

Commit a0660d4

Browse files
committed
Do not generate QQ plot if only 1 p-value
1 parent 74a4239 commit a0660d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/outputs.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ function qqplot(output, results)
2828
for pvalue_col pvalue_cols
2929
pvalues = -log10.(filter(x -> !isnan(x), results[!, pvalue_col]))
3030
n = length(pvalues)
31+
# If only 1 non-NA p-value, exit function
32+
if n <= 1
33+
return
34+
end
3135
unif_quantiles = log10_uniform_quantiles(n)
3236
qqplot!(ax, unif_quantiles, pvalues, qqline=:identity, label=replace(string(pvalue_col), "_PVALUE" => ""))
3337
end

0 commit comments

Comments
 (0)