privefl / bigsnpr

R package for the analysis of massive SNP arrays.
https://privefl.github.io/bigsnpr/
186 stars 44 forks source link

Is it possible to do snp_manhattan with position on the x-axis instead of chromosome? #458

Closed garyzhubc closed 7 months ago

garyzhubc commented 11 months ago

Is it possible to do snp_manhattan with position on the x-axis instead of chromosome? Say I have 101 SNPs. When I use labels=1:101 it says

> snp_manhattan(gwas, pcsk9_updown_bigsnp_obj$map$chromosome[start_pos:end_pos], pcsk9_updown_bigsnp_obj$map$physical.pos[start_pos:end_pos], ind.highlight=c(44,46), labels=1:101) +
+   geom_hline(yintercept = -log10(5e-8), linetype = 2, color = "red")
Error in `check_breaks_labels()`:
! `breaks` and `labels` must have the same length
privefl commented 11 months ago

Not sure whether it is directly possible or not; I would just get the internal ggplot2 code of the function and slightly modify it.