write.table of DESeq2 results broken down by LFC
1
0
Entering edit mode
rbronste ▴ 60
@rbronste-12189
Last seen 4.3 years ago

Hi, I am writing a table of DESeq2 results in the following way and just wondering how to easily write to two separate tables based on the LFCs below:

summary.DESeqResults(treatment_pw_padj.001_sorted)

out of 5203 with nonzero total read count
adjusted p-value < 0.1
LFC > 0 (up)       : 5121, 98%
LFC < 0 (down)     : 82, 1.6%
outliers [1]       : 0, 0%
low counts [2]     : 0, 0%
(mean count < 6)
[1] see 'cooksCutoff' argument of ?results
[2] see 'independentFiltering' argument of ?results

write.table(treatment_pw_padj.001_sorted,"treatment_pw_padj.001_sorted.bed", quote=F, sep="\t", row.names=T, col.names=T)

So this gives me a single BED file, just looking to see if I can easily get two files with each LFC group. Thanks!

deseq2 • 743 views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 19 hours ago
United States

I don't follow exactly, you just want to split res by log2FoldChange?

res[res$log2FoldChange > 0,]
res[res$log2FoldChange < 0,]

Does this do it?

ADD COMMENT
0
Entering edit mode

I just want to export two BED files via write.table, one that has all of the > 0 LFC values and the second which has all the <0 LFC values from res

ADD REPLY
0
Entering edit mode

Any thoughts on an easy way to approach this or should I just always split the res? Thanks!

ADD REPLY
0
Entering edit mode

I don't have any more or different advice for you, the above is simple and clear what's happening, right?

You're better off with a few clear lines of R code than asking for some dedicated obtuse wrapper function.

ADD REPLY

Login before adding your answer.

Traffic: 589 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