Unexpected results
1
0
Entering edit mode
efratsh ▴ 10
@efratsh-20531
Last seen 3.8 years ago

Hello, I got unexpected results from resultsNames:

dds_taxa2 <- DESeqDataSetFromMatrix(countData = taxa_count,
                                colData = md_RatTime,
                                design= ~ RatTime) 


dds_taxa2 = DESeq(dds_taxa2)
dds_taxa2$RatTime <- relevel(dds_taxa2$RatTime, ref = "BER_T0") 
resultsNames(dds_taxa2)
md_RatTime  
    RatTime
BEP_T0_10N  BEP_T0
BEP_T0_11N  BEP_T0
BEP_T0_12B  BEP_T0
BEP_T0_16B  BEP_T0
BEP_T0_16N  BEP_T0
BEP_T0_18B  BEP_T0
BEP_T0_1B   BEP_T0
BEP_T0_20B  BEP_T0
BEP_T0_21B  BEP_T0
BEP_T0_2N   BEP_T0
BEP_T0_3B   BEP_T0
BEP_T0_8N   BEP_T0
BEP_T1_10N  BEP_T1
BEP_T1_11N  BEP_T1
BEP_T1_12B  BEP_T1
BEP_T1_16B  BEP_T1
BEP_T1_16N  BEP_T1
BEP_T1_18B  BEP_T1
BEP_T1_1B   BEP_T1
BEP_T1_20B  BEP_T1
BEP_T1_21B  BEP_T1
BEP_T1_2N   BEP_T1
BEP_T1_3B   BEP_T1
BEP_T1_8N   BEP_T1
BER_T0_10B  BER_T0
BER_T0_11B  BER_T0
BER_T0_12N  BER_T0
BER_T0_13B  BER_T0
BER_T0_17N  BER_T0
BER_T0_19B  BER_T0
BER_T0_1N   BER_T0
BER_T0_21N  BER_T0
BER_T0_23B  BER_T0
BER_T0_6N   BER_T0
BER_T0_7B   BER_T0
BER_T0_9B   BER_T0
BER_T1_10B  BER_T1
BER_T1_11B  BER_T1
BER_T1_12N  BER_T1
BER_T1_13B  BER_T1
BER_T1_17N  BER_T1
BER_T1_19B  BER_T1
BER_T1_1N   BER_T1
BER_T1_21N  BER_T1
BER_T1_23B  BER_T1
BER_T1_6N   BER_T1
BER_T1_7B   BER_T1

resultsNames(dds_taxa2)
[1] "Intercept" "RatTime1"  "RatTime2"  "RatTime3" 

design(dds_taxa2)
~RatTime

levels(dds_taxa2$RatTime)
[1] "BER_T0" "BEP_T0" "BEP_T1" "BER_T1"

I expect to get RatTime_BER_T1_vs_BER_T0, RatTime_BEP_T1_vs_BEP_T0, RatTime_BER_T1_vs_BEP_T1 How can I chage what I did to get it? Thank you.

sessionInfo( )

R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] microbiome_1.8.0            ggpubr_0.4.0                gridExtra_2.3               pheatmap_1.0.12            
 [5] reshape2_1.4.4              PairedData_1.1.1            mvtnorm_1.1-1               gld_2.6.2                  
 [9] MASS_7.3-51.4               factoextra_1.0.7            openxlsx_4.1.5              DESeq2_1.26.0              
[13] SummarizedExperiment_1.16.1 DelayedArray_0.12.3         BiocParallel_1.16.6         matrixStats_0.56.0         
[17] Biobase_2.42.0              GenomicRanges_1.38.0        GenomeInfoDb_1.22.1         IRanges_2.20.2             
[21] S4Vectors_0.24.4            BiocGenerics_0.32.0         RColorBrewer_1.1-2          psych_2.0.7                
[25] vegan_2.5-6                 lattice_0.20-38             permute_0.9-5               phyloseq_1.30.0            
[29] ggrepel_0.8.2               ggthemes_4.2.0              ggplot2_3.3.2               stringr_1.4.0              
[33] tibble_3.0.3                readxl_1.3.1                taxa_0.3.4                  tidyr_1.1.1                
[37] dplyr_1.0.1                 plyr_1.8.6                  readr_1.3.1
resultsNames DESeq2 • 855 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 2 days ago
United States

The coefficients are named (and estimated) when you run DESeq().

If you change the names of the levels of the object, the coefficients are not automatically updated. You would need to assign the level names that you want before DESeq().

ADD COMMENT
0
Entering edit mode

Thank you, but even without the relevel, I did not get an expected results names.

md_RatTime<- md %>%
              rownames_to_column() %>%
              mutate(RatTime=paste0(RatType,"_",TimeGroup)) %>%
              mutate(RatTime=as.factor(RatTime)) %>%
              dplyr::select(rowname,RatID,RatTime) %>%
              column_to_rownames()
dds_taxa2 <- DESeqDataSetFromMatrix(countData = taxa_count,
                                colData = md_RatTime,
                                design= ~ RatTime) 

#dds_taxa2$RatTime <- relevel(dds_taxa2$RatTime, ref = "BER_T0") 

dds_taxa2 = DESeq(dds_taxa2)
design(dds_taxa2)
~RatTime

resultsNames(dds_taxa2)
[1] "Intercept" "RatTime1"  "RatTime2"  "RatTime3"
ADD REPLY
0
Entering edit mode

What are the levels of RatTime here? I'm not sure why it's not giving the "B_vs_A" style of results names. Maybe something about the levels you are passing to DESeq2.

ADD REPLY
0
Entering edit mode

I'm shocked, I restarted the R session, and now it behaves as expected:

resultsNames(dds_taxa2)
[1] "Intercept"                "RatTime_BEP_T0_vs_BER_T0" "RatTime_BEP_T1_vs_BER_T0"
[4] "RatTime_BER_T1_vs_BER_T0"
ADD REPLY

Login before adding your answer.

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