Question: write.table of DESeq2 results broken down by LFC
0
gravatar for rbronste
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
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 • 77 views
ADD COMMENTlink modified 4 weeks ago by Michael Love26k • written 4 weeks ago by rbronste60
Answer: write.table of DESeq2 results broken down by LFC
1
gravatar for Michael Love
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?

ADD COMMENTlink written 4 weeks ago by Michael Love26k

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 REPLYlink written 4 weeks ago by rbronste60

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

ADD REPLYlink written 28 days ago by rbronste60

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 REPLYlink written 28 days ago by Michael Love26k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 450 users visited in the last hour