Deleted:Diff exp with DESEQ - script - splitting samples
1
0
Entering edit mode
@c638f059
Last seen 2.3 years ago
Canada

Hello guys,

I am a PhD student and I just started using R and DESEQ for RNA data analysis. I am new to R and I just want to make sure that I am using DESEQ in the correct way. I have read the vignette of DESEQ, followed many tutorials but I feel I still want to double check my script with experienced people in this field. Many thanks in advance for your help.

I have 3 cell lines and 3 treatments for each cell line, so 12 samples to analyze (I am using the treatment as variable).

My code:

Reading the data

counts = read.table("counts.txt")
coldata = read.table("meta.txt")

To make sure I have the correct ordering

all(colnames(counts) %in% rownames(coldata))
all(colnames(counts) == rownames(coldata))

DESEQ

 dds = DESeqDataSetFromMatrix(countData = counts,
                                 colData = coldata,
                                 design = ~Treatment)


 dds$Treatment = relevel(dds$Treatment, ref = "siSCR") #setting the reference 

 dds = DESeq(dds)

 result = results(dds, contrast = c("Treatment", "siACLY", "siSCR")) #Comapre siACLY to siSCR

Filtering from NA and p adj 0.05

filter1 = result[complete.cases(result),]

filter2 = filter1[filter1$padj < 0.05,]
  • My first question is: is it better to split the samples at each comparison and create a new dds object for each comparison or it is better to use all the samples in the count table and then specify the comparison with the contrast function?

In the above code I did not split the samples.

  • When I did not split the samples I got 2,542 DEGs (p adj<0.05)
  • When I split the samples I got 1,242 DEGs (p adj <0.05) (for the same analysis)

By splitting the samples I mean keeping only the samples I want to compare in the count table and removing the others. So the dispersion and the normalization will be calculated based on the kept samples only.

  • My second question is: If I do not split the samples, could I relevel the dds object before every comparison or it is not necessary since I am specifying the treatments to compare in the contrast function?

  • My third question is, is there any mistake in my code?

Any help would be appreciated! I do really need experienced people's help. Thank you.

DESeq2 • 471 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 399 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