Question: RESULTS() using contrast=c("condition","A","B"), the results would be A vs B correct?
gravatar for angajalaanusha
9 weeks ago by
angajalaanusha10 wrote:

I am trying to get know if a gene is down in Condition A vs B.While using results function, I am trying to know if I am doing this correctly. Because, I am not able to see how it is done internally. So my questions are as follows. In my case ( Condition = TNBC status, A = QNBC, B= TNBC ARP.

  1. What is the difference if we use contrast=c("condition", "A", "B")) vs contrast=c("condition", "B", "A"))

  2. In the colData and TNBC status condition, only few patients are QNBC and TNBC ARP. The remaining samples do not fall in this category. So, for those samples ( the TNBC condition raw is empty, is not assigned as NA.) My question here is if we specify the contrast argument , then it only compares two groups right?

  3. The results names here in my output looks different. It does not give QNBCVsTNBCARP.

Thanks so much in advance, Anusha.

dds <- DESeqDataSetFromMatrix(countData = cts, colData = coldata, design = ~ TNBCstatus) dds <- DESeq(dds)


resultsNames(dds) [1] "Intercept" "TNBCstatusQNBCvs" "TNBCstatusTNBCARPvs"

res <- results(dds, contrast=c("TNBCstatus", "QNBC", "TNBCARP")) res log2 fold change (MLE): TNBCstatus QNBC vs TNBCARP Wald test p-value: TNBCstatus QNBC vs TNBCARP

sessionInfo() R version 3.5.2 (2018-12-20) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LCCOLLATE=EnglishUnited States.1252 LCCTYPE=EnglishUnited States.1252
[3] LCMONETARY=EnglishUnited States.1252 LCNUMERIC=C
[5] LC
TIME=English_United States.1252

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods
[9] base

other attached packages: [1] DESeq21.20.0 SummarizedExperiment1.10.1 [3] DelayedArray0.6.6 BiocParallel1.14.2
[5] matrixStats0.54.0 Biobase2.40.0
[7] GenomicRanges1.32.7 GenomeInfoDb1.16.0
[9] IRanges2.14.12 S4Vectors0.18.3
[11] BiocGenerics0.26.0 BiocInstaller1.30.0

loaded via a namespace (and not attached): [1] locfit1.5-9.1 Rcpp1.0.0 lattice0.20-38
[4] digest
0.6.18 plyr1.8.4 backports1.1.3
[7] acepack1.4.1 RSQLite2.1.1 ggplot23.1.0
[10] pillar
1.3.1 zlibbioc1.26.0 rlang0.3.1
[13] lazyeval0.2.1 rstudioapi0.9.0 data.table1.12.0
[16] annotate
1.58.0 blob1.1.1 rpart4.1-13
[19] Matrix1.2-15 checkmate1.9.1 splines3.5.2
[22] geneplotter
1.58.0 stringr1.3.1 foreign0.8-71
[25] htmlwidgets1.3 RCurl1.95-4.11 bit1.1-14
[28] munsell
0.5.0 compiler3.5.2 xfun0.4
[31] pkgconfig2.0.2 base64enc0.1-3 htmltools0.3.6
[34] nnet
7.3-12 tibble2.0.1 gridExtra2.3
[37] htmlTable1.13.1 GenomeInfoDbData1.1.0 Hmisc4.2-0
[40] XML
3.98-1.16 crayon1.3.4 bitops1.0-6
[43] grid3.5.2 xtable1.8-3 gtable0.2.0
[46] DBI
1.0.0 magrittr1.5 scales1.0.0
[49] stringi1.2.4 XVector0.20.0 genefilter1.62.0
[52] latticeExtra
0.6-28 Formula1.2-3 RColorBrewer1.1-2
[55] tools3.5.2 bit640.9-7 survival2.43-3
[58] AnnotationDbi
1.42.1 colorspace1.4-0 cluster2.0.7-1
[61] memoise1.1.0 knitr1.21

deseq2 • 95 views
ADD COMMENTlink modified 9 weeks ago by Michael Love22k • written 9 weeks ago by angajalaanusha10
Answer: RESULTS() using contrast=c("condition","A","B"), the results would be A vs B cor
gravatar for Michael Love
9 weeks ago by
Michael Love22k
United States
Michael Love22k wrote:

We have a workflow, which users are not always aware of:

In the section "Building the results table" we talk about interpreting the columns in the results table.

Also you can check the help pages: ?results has help on the contrast argument specifically answering this question.

Yes, if you specify the contrast, if only compares these two groups although the other samples are used to estimate dispersion and size factors.

Don't worry about resultsNames(dds). This was asked also last week on the forum. The default coefficients have a certain meaning but the point of contrast is that DESeq2 takes care of this and forms the correct comparison.

ADD COMMENTlink written 9 weeks ago by Michael Love22k

Thanks a million for answering the question. This link is very helpful. mcols(res, use.names = TRUE) is helpful to know.

ADD REPLYlink written 9 weeks ago by angajalaanusha10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 136 users visited in the last hour