Codes for preparing data for goseq!
1
2
Entering edit mode
10.1 years ago
Parham ★ 1.6k

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!

goseq • 4.2k views
ADD COMMENT
5
Entering edit mode
10.1 years ago
d <- read.csv("deseq2res.csv", header=T, row.names=1)
all_genes <- row.names(d)
DE_genes <- all_genes[which(d$padj<0.05)]
ADD COMMENT
1
Entering edit mode

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 ;-)

ADD REPLY
1
Entering edit mode

That'll pick up NAs, which will be present in DESeq2's output due to independent filtering.

ADD REPLY
0
Entering edit mode

Thanks for mentioning it!

ADD REPLY
0
Entering edit mode

Thanks a million Devon.

ADD REPLY

Login before adding your answer.

Traffic: 1873 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6