This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to extract the results table for specific samples names after normalization by DESeq in R?

How to extract the results table for specific samples names after normalization by DESeq in R?

After I did normalization in R with DESeq2 I got the results table with results function, now I need to get the results but not for all samples, I just need for 2 samples, how to extract it?

res <- results(dds)
res

log2 fold change (MLE): condition Normal Cell vs Cancer Cell

Thanks in advance

deseq2 normalization r

1 answer

I guess the best solution for this question is:

countdata3<- subset(countdata, select=c("sample_name1_rep1", "sample_name1_rep2", sample_name2_rep1","sample_name2_rep2"))

coldata3<- data.frame("condition"=as.factor(c(rep("Normal",2),rep("Mutated",2))),row.names=colnames(countdata3))

dds3 <- DESeqDataSetFromMatrix(countData = countdata3, colData =coldata3,design = ~condition )

dds3 <- DESeq(dds3)

results(dds3)

Then the results will be calculated depending on the samples inside the dataframe not all samples.

How to extract the results table for specific samples

You are not "extracting" the result table. You are doing a completely new the deseq2 analysis with a smaller set of samples from the original dataframe (countdata)

Yes you are right, but is there another way to extract them after making normalization for all samples?

Log in to answer this question.