DESeq2 -partial replicates
2
0
Entering edit mode
Bob • 0
@bob-12005
Last seen 6.1 years ago

Hi

I'm trying to use DESeq2 to find differentially expressed genes between sample with replicates and sample without replicates. I have 2 condition, control and tumour. I am new to Deseq2 package, do you think my command lines are OK for my experiment?

 

Thanks in advance

 

code for find DE in tumour vs control (tumour /control )

 

> countsTable <- read.delim ("/feature/Cont_control_34.txt", header=TRUE, row.names=1)

> pdata = data.frame(condition = factor(c("control","tumour","tumour","tumour")))

> dds <- DESeqDataSetFromMatrix(countData=countsTable, colData = pdata, design=~condition)

> colData(dds)$condition <- relevel(colData(dds)$condition, "control","tumour")

> design(dds)

~condition

> dds <- DESeq(dds)

> res <- results(dds)

> res <- res[order(res$padj),]

> sig.up.results <- res[which(res$padj < 0.05 & res$log2FoldChange > 1),]

> sig.down.results <- res[which(res$padj < 0.05 & res$log2FoldChange < -1),]

> sig.results <- res[which(res$padj < 0.05),]

> sig.results <- sig.results[order(sig.results$log2FoldChange, decreasing=TRUE),]
deseq2 • 964 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 15 hours ago
United States

Yes that looks correct.

(Except you might want to know that relevel() only takes the reference level as the second argument, you don't provide it with the other levels. It just ignores the other arguments you provided. See ?relevel.)

There was recently another similar question here about when one condition has no replicates

Can I run DESeq2, if I have repeats for my control, but no repeats for my test condition?

ADD COMMENT
0
Entering edit mode

Also, we have a different routine for *testing* against a fold change threshold, rather than testing a null hypothesis of zero log fold change and then providing post hoc filters. Read over the DESeq2 paper and the vignette if you're interested in this topic.

ADD REPLY
0
Entering edit mode

hi Micheal

Thanks for your help, so there is not any difference between these codes for find DE in tumour vs control (tumour /control ), right?

Ehsan

colData(dds)$condition <- relevel(colData(dds)$condition, "control")

or

colData(dds)$condition <- relevel(colData(dds)$condition, "control","tumour")
ADD REPLY
0
Entering edit mode
@mikelove
Last seen 15 hours ago
United States

(I moved your post from an Answer to a Comment.)

Take a look at what you see in the help page for ?relevel:

Usage

relevel(x, ref, ...)

Arguments

x    
an unordered factor.

ref    
the reference level, typically a string.

...    
additional arguments for future methods.

So this means that anything after the second argument is ignored by the function.

You can also convince yourself that extra arguments to relevel have no function by playing around with some R code yourself, and seeing that whatever you put after the second argument doesn't change the order of levels for the factor:

> x <- factor(c("a","b","c"))
> x
[1] a b c
Levels: a b c
> relevel(x, "b")
[1] a b c
Levels: b a c
> relevel(x, "b", "c")
[1] a b c
Levels: b a c
> relevel(x, "b", 42)
[1] a b c
Levels: b a c

 

 

 

ADD COMMENT

Login before adding your answer.

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