Thanks a million Devon.
Codes for preparing data for goseq!
Hi,
I am learning goseq and I know a bit of R. I just can read the codes and understand them but not very creative to type what I want to do. So I need to prepare data from deseq2res. One vector containing all genes (column 1) and the other vector containing all DE genes (padj < 0.05). Can anyone do the favor? Any lines of code is appreciated!
• 5,131 views
•
link
1 answer
d <- read.csv("deseq2res.csv", header=T, row.names=1)
all_genes <- row.names(d)
DE_genes <- all_genes[which(d$padj<0.05)]
• 1 views
•
link
• 0 views
•
link
Random comment re: R style: In this case, you should avoid the call to which, ie. instead of
DE_genes <- all_genes[which(d$padj<0.05)]
do
DE_genes <- all_genes[d$padj<0.05]
because sometimes funny things happen when indexing with a 0 length vector (i.e. which would be what is returned from which if there were no results with padj < 0.05 ... and it's redundant here, anyway ;-)
• 0 views
•
link
Log in to answer this question.