The support.bioconductor.org editor has been updated to markdown! Please see more info at: Tutorial: Updated Support Site Editor

Question: Script for fold change in DESeq for count data with 2 groups
0
gravatar for marc.osullivan
14 days ago by
marc.osullivan0 wrote:

I'm new to both R and DESeq2 and I have a script to work off but this will only generate Log2 fold change? Does anyone know what script to add to calculate untransformed fold change to my read counts?

I've attached the script below.

<--------------------------------------------------------------------------------------------------------------------------------------------------->

library(DESeq2)

First format data into columns and counts, see attached example files

cts27 <- read.csv("~/MyCounts27.csv",header=T,row.names=1) coldata27 <- read.csv("~/MyColdata27_23Signif.csv")

These two lines create the deseq object, second line not 100% needed but best to include

dds27 <- DESeqDataSetFromMatrix(countData=cts27,colData=coldata27,design= ~ Obese.Normal) dds27$Obese.Normal <- relevel(dds27$Obese.Normal, ref="Normal")

here we run the analysis on the object dds27

dds27 <- DESeq(dds27)

here results are generated and saved as res27, can change p-value cut off by changing alpha value

res27 <- results(dds27, alpha = 0.05) res27

summary of results

summary(res27)

order the results by p-value

resOrdered27 <- res27[order(res27$pvalue),] resOrdered27

summary of ordered results

summary(resOrdered27)

sum(res27$padj < 0.05, na.rm=T)

save results in csv file

write.csv(as.data.frame(resOrdered27), file = "MyCaseControlResults27.csv")

rnaseq deseq2 • 63 views
ADD COMMENTlink modified 14 days ago by Michael Love22k • written 14 days ago by marc.osullivan0
Answer: Script for fold change in DESeq for count data with 2 groups
1
gravatar for Michael Love
14 days ago by
Michael Love22k
United States
Michael Love22k wrote:

I'd recommend to take a look at the workflow here for an example analysis script:

https://bioconductor.org/packages/release/workflows/vignettes/rnaseqGene/inst/doc/rnaseqGene.html

To convert the log2 fold changes to fold changes, you can use 2^LFC (this is described in the workflow link above, in the section about the results table).

ADD COMMENTlink written 14 days ago by Michael Love22k
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: 378 users visited in the last hour