I am trying to add a gene list to a MA plot.
I subset my results table res like this:
gene_list <- scan("genelist.txt", what="", sep="\n")
gene_list <- as.vector(gene_list)
genes <-subset(res, row.names(res) %in% gene_list)
As a test, my genelist.txt file contains all the genes in my results table, and the tables appear identical. However I am able to plot the res data
with(res, plot(baseMean, log2FoldChange, pch=20, cex=.5, log="x", ...))
but when I try the subset, I get an error that suggests I am calling NA values
with(genes, plot(baseMean, log2FoldChange, pch=20, cex=.5, log="x", ...))
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
Any ideas on how I can correct this error? Thanks
Your code above does not contain the code you changed in your answer. Also, this looks like a problem with your R programming and not with DESeq2, which means it's not a problem others will run into exactly.
I'll be closing this post unless you clean it up and mention exactly what was wrong and what had to be changed. The post is unintelligible right now.