Error in making a manhattan plot: need finite 'ylim' values

Viewed 30

I'm trying to create a 4 manhattan plots using qqman pakage with 4 different summary statistics. The first two came out fine and I had no errors, but now the third plot is giving me the above error and I can't figure out why. Googling the error, it looks like it means that some of the values in the data are not numeric. I checked and the only column that isn't numeric is SNP, and that is also true for the first two plots which didn't give me the error. It's also strange because the code I used for the first two and the third plots are exactly the same, just changing the numer to specify different files and names for the plot.

data = fread("/z/Comp/lu_group/Members/jwlorge/ATN/scripts/data/temp_gwas/output_3/all_chunks_output_3.txt.gz", fill=TRUE, header=TRUE)
data$CHR = as.numeric(as.factor(data$CHR))
data$BP = as.numeric(data$BP)
data$Pval_Estimate = as.numeric(data$Pval_Estimate)
s = length(unique(data$SNP))
jpeg('corrplot3.jpg')
manhattan(data,chr="CHR", bp="BP", p="Pval_Estimate", na.action=TRUE, main = "Factor 3", sub = paste0(s, " SNPs"))
dev.off()

Between this plot and the second, which worked, the only difference in code is replacing the 2 with 3. I ran the code line for line and the error comes up after the manhattan line. Does anyone know what might be causing this issue? The full error message:

Error in plot.window(...) : need finite 'ylim' values
Calls: manhattan ... do.call -> plot -> plot.default -> localWindow -> plot.window
0 Answers
Related