diff --git a/R/manhattan.R b/R/manhattan.R index 2bb622b..231195b 100644 --- a/R/manhattan.R +++ b/R/manhattan.R @@ -48,7 +48,7 @@ manhattan <- function(x, chr="CHR", bp="BP", p="P", snp="SNP", col=c("gray10", "gray60"), chrlabs=NULL, suggestiveline=-log10(1e-5), genomewideline=-log10(5e-8), - highlight=NULL, logp=TRUE, annotatePval = NULL, annotateTop = TRUE, ...) { + highlight=NULL, logp=TRUE, annotatePval = NULL, annotateTop = TRUE, annotateFontSize = 0.45, ...) { # Not sure why, but package check will warn without this. CHR=BP=P=index=NULL @@ -223,10 +223,10 @@ manhattan <- function(x, chr="CHR", bp="BP", p="P", snp="SNP", if (annotateTop == FALSE) { if (logp) { with(subset(d, P <= annotatePval), - textxy(pos, -log10(P), offset = 0.625, labs = topHits$SNP, cex = 0.45), ...) + textxy(pos, -log10(P), offset = 0.625, labs = topHits$SNP, cex = annotateFontSize), ...) } else with(subset(d, P >= annotatePval), - textxy(pos, P, offset = 0.625, labs = topHits$SNP, cex = 0.45), ...) + textxy(pos, P, offset = 0.625, labs = topHits$SNP, cex = annotateFontSize), ...) } else { # could try alternative, annotate top SNP of each sig chr @@ -240,9 +240,9 @@ manhattan <- function(x, chr="CHR", bp="BP", p="P", snp="SNP", } if (logp ){ - textxy(topSNPs$pos, -log10(topSNPs$P), offset = 0.625, labs = topSNPs$SNP, cex = 0.5, ...) + textxy(topSNPs$pos, -log10(topSNPs$P), offset = 0.625, labs = topSNPs$SNP, cex = annotateFontSize, ...) } else - textxy(topSNPs$pos, topSNPs$P, offset = 0.625, labs = topSNPs$SNP, cex = 0.5, ...) + textxy(topSNPs$pos, topSNPs$P, offset = 0.625, labs = topSNPs$SNP, cex = annotateFontSize, ...) } } par(xpd = FALSE)