I'm trying to create a manhattan plot in linux. This is my first time doing so using qqman and I am stuck on this error. Here is my R code:
library(data.table)
library(qqman)
data = fread("/z/Comp/lu_group/Members/jwlorge/ATN/scripts/data/temp_gwas/output_1/factor_1.txt", fill=TRUE, header=TRUE)
data$CHR = as.numeric(data$CHR)
data$BP = as.numeric(data$BP)
data$Pval_Estimate = as.numeric(data$Pval_Estimate)
jpeg('corrplot1.jpg')
manhattan(data,chr="CHR", bp="BP", snp="SNP", p="Pval_Estimate")
dev.off()
jpeg('qqplot1.jpg')
qq(data$Pval_Estimate)
dev.off()
Which gives me the following error:
Error in rep.int(seq_along(unique(d$CHR)), times = tapply(d$SNP, d$CHR, :
invalid 'times' value
Calls: manhattan
I searched the error on the internet and I didn't find it anywhere. I am completely stumped. Does anyone know what it means? Thanks.