This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to export rld (rlog) or vsd values from DESeq2?

Hi guys, i want to export the rlog values from DESeq2 or vsd, but i only got the dds counts, using the following script:

countsdds <- counts(dds, normalized = TRUE)
write.csv(countsdds, file="dds_norm_counts.csv")

Is there a way to export rlog values?

Thanks for your help!

deseq2 rlog vsd rna-seq

2 answers

Googling rld DESeq2 already gives me the answer, e.g. here

Thank you, WouterDeCoster, but i don't want to apply the functions "rlog" or "vst", I just did that. I want to export the output values after run the function, like .csv or .xlsx format table to my directory.

And what about something like

rld <- rlog(dds, blind=FALSE)
write.csv(rld, file="rld.csv")

I tried, but happens that error:

rld <- rlog(dds, blind=FALSE)
write.csv(rld, file="rld.csv")

Error in as.vector(x) : no method for coercing this S4 class to a vector

Right, what about

rld <- assay(rlog(dds, blind=FALSE))

Worked it out! Thank you, WouterDeCoster

Thank you! I was trying to extract my variance stabilizing transformation and write it to a .csv. Got it to work with this:

vst_write <- assay(vst(dds, blind=FALSE))

write.csv(as.data.frame(vst_write), file="VST_results.csv")

Log in to answer this question.