Script for fold change in DESeq for count data with 2 groups
1
0
Entering edit mode
@marcosullivan-19786
Last seen 5.2 years ago

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

deseq2 RNAseq • 482 views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 4 hours ago
United States

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 COMMENT

Login before adding your answer.

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