kaustubhad / fastman

An R package for fast and efficient visualizing of GWAS results using Q-Q and Manhattan plots directly from PLINK output files.
GNU General Public License v3.0
36 stars 8 forks source link

Calculate annotationWinMb across chromosomes #10

Open michaelofrancis opened 2 years ago

michaelofrancis commented 2 years ago

Hi, one possible upgrade that would help a lot is calculating the annotationWinMb across chromosomes. For example, a SNP label at the end of one chromosome and the beginning of the next will often overlap. These labels are super small and fully upright and still we have some interference:

image

Thanks!

kaustubhad commented 2 years ago

Hi, The annotationWinMb parameter is not for separating the snp labels, it is for picking the top snp from a specified interval. This option is provided because the user might assume there will be LD for a distance of 1 megabase, for example, and so representing the top snp as a representative is enough. This is similar to the LD window width parameters that Plink and other software use, e.g. for LD pruning. So this parameter is not calculated but user-provided. If the user asks for annotating many snps, in the extreme case, then there is no way to show a lot of text labels and maintain their correspondence with the points. An extreme example of this is the figure below, shown in the vignette, where we annotate all snps above a p-value threshold. https://github.com/kaustubhad/fastman/blob/main/plots/md8.png So we do not try to reposition labels to avoid each other.