Question: write.table of DESeq2 results broken down by LFC
0
4 weeks ago by
rbronste60
rbronste60 wrote:

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



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 • 77 views
modified 4 weeks ago by Michael Love26k • written 4 weeks ago by rbronste60
Answer: write.table of DESeq2 results broken down by LFC
1
4 weeks ago by
Michael Love26k
United States
Michael Love26k wrote:

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?

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

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

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.