DESeq2: Multiple disease condition vs Normal
1
0
Entering edit mode
2.5 years ago
Tusharika • 0

Hello!

I have an mRNA dataset with one cell type and 3 different conditions (Metastatic, Primary Tumor, and Solid Tissue Normal).

I would like to compare the two diseased conditions with the normal. I am using the following code but getting the understated error.

deseq_res <- results(deseq_obj, contrast = list ( c('Primary Tumor', 'Metastatic'), c('Solid Tissue Normal')) , listValues=c(1, -1/3), alpha = 0.05, lfcThreshold = 1.5)

-------------------------------------------------------------------------------------------------------------------------------------------------------

Error in checkContrast(contrast, resNames) : 
  all elements of the contrast as a list of length 2 should be elements of 'resultsNames(object)'

I have checked if the names of the condition are identical to the ones in the dataset and they are. What can I do in this case?

Thanks in advance

deseq2 RNASeq • 896 views
ADD COMMENT
2
Entering edit mode
2.5 years ago
Marco Pannone ▴ 810

Assuming you appropriately imported your count matrix and coldata, and:

all(rownames(coldata) == colnames(count_matrix))

reports TRUE,

do so:

deseq_obj$tissue_type <- relevel(deseq_obj$tissue_type, ref = "Solid Tissue Normal")
dds <- DESeq(deseq_obj)
design(dds) <- formula(~tissue_type)
resultsNames(dds)
res <- results(dds, name="tissue_type_Primary Tumor_vs_Solid Tissue Normal")

assuming that "tissue_type" is a column name in your coldata for grouping individual samples based on condition. Also the argument passed to name in the last line of code should be identical to the results of resultsNames.

I also recommend replacing all spaces with underscores. Whatever codes you are dealing with, blank spaces will make your life complicated.

ADD COMMENT
0
Entering edit mode

Thank you so much Marco Pannone It worked.

ADD REPLY

Login before adding your answer.

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