I have some very large files that contain a genomic position (position) and a corresponding population genetic statistic (value). I have successfully plotted these values and wo
I´m not sure if this is what you are searching for, but maybe it helps:
# a little function which returns factors with three levels, normal, 95% and 99%
qfun <- function(x, qant_1=0.95, qant_2=0.99){
q <- sort(c(quantile(x, qant_1), quantile(x, qant_2)))
factor(cut(x, breaks = c(min(x), q[1], q[2], max(x))))
}
df <- data.frame(samp=rnorm(1000))
ggplot(df, aes(x=1:1000, y=df$samp)) + geom_point(colour=qfun(df$samp))+
xlab("")+ylab("")+
theme(plot.background = element_blank(),
panel.background = element_blank(),
panel.border = element_blank(),
legend.position="none",
legend.title = element_blank())
as a result I got