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

Error in text.default ... zero-length 'labels' specified #12

Closed michaelofrancis closed 1 year ago

michaelofrancis commented 1 year ago

Hello,

I was wondering if you know why this error would come up. It seems to think the SNP column has zero-length but as you can see from the screenshot the SNP column is fine...

I used the same genotype dataset for multiple phenotypes that worked, but randomly this one refuses to work.

Your input is appreciated! Thanks.

fastman(file2, snp="SNP", chrlabs = as.character(1:22), speedup = TRUE, colAbovePval =TRUE, annotateN=4, annotatePval=-log10(1e-6), annotationAngle = 60, annotationWinMb=60, suggestiveline = -log10(1e-5), genomewideline = -log10(5e-8), cex=0.8, cex.text=0.6, cex.axis=0.7, col=c("#36E072"), sortchr=TRUE )

Error in text.default(x = m2$BPn + fac/7, y = m2$logP + fac/7, labels = m2$SNP, : zero-length 'labels' specified

image
michaelofrancis commented 1 year ago

After a lot of trial and error I figured out this error was because of the "annotateN" parameter, I guess I was specifying labeling more significant SNPs than there were in the dataset.