DESeq2::rlogTransformation missing rownames vs vst.
1
0
Entering edit mode
twfs • 0
@twfs-24066
Last seen 3.0 years ago
United Kingdom

Hi Folks,

Thanks for deseq2. I think there might be a small bug in rlog where it doesn't copy rownames from the source matrix? The below shows str() for rlog and vst output (with the same count matrix input) respectively and the rlog has NULL rownames. In the vst code there is a specific rownames copy assignment but not in the rlog code. This causes problems when adding them directly as assays in a SummarizedExperiment as the rlog assay values become NA's.

 num [1:15442, 1:28] 4.88 3.66 6.82 5.29 6.84 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:28] "G_tumor_KO_aPDL1_1" "G_tumor_KO_aPDL1_2" "G_tumor_KO_aPDL1_4" "G_tumor_KO_aPDL1_5" ...
 - attr(*, "betaPriorVar")= num 3.84
 - attr(*, "intercept")= num [1:15442, 1] 5.42 4.47 7.86 7 7.87 ...

 num [1:15442, 1:28] 5.89 5.26 6.95 5.84 6.97 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:15442] "ENSMUSG00000014198" "ENSMUSG00000048794" "ENSMUSG00000028020" "ENSMUSG00000042096" ...
  ..$ : chr [1:28] "G_tumor_KO_aPDL1_1" "G_tumor_KO_aPDL1_2" "G_tumor_KO_aPDL1_4" "G_tumor_KO_aPDL1_5" ...

Thanks,

Tim

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
 [1] DESeq2_1.24.0               shinyngs_0.0.1
 [3] SummarizedExperiment_1.14.1 DelayedArray_0.10.0
 [5] BiocParallel_1.18.1         matrixStats_0.55.0
 [7] Biobase_2.44.0              GenomicRanges_1.36.1
 [9] GenomeInfoDb_1.20.0         IRanges_2.18.3
[11] S4Vectors_0.22.1            BiocGenerics_0.30.0

loaded via a namespace (and not attached):
 [1] ggdendro_0.1-20        httr_1.4.1             tidyr_1.0.0
 [4] bit64_0.9-7            jsonlite_1.6           viridisLite_0.3.0
 [7] splines_3.6.1          Formula_1.2-3          shiny_1.4.0
[10] assertthat_0.2.1       latticeExtra_0.6-28    blob_1.2.0
[13] GenomeInfoDbData_1.2.1 yaml_2.2.0             RSQLite_2.1.2
[16] pillar_1.4.2           backports_1.1.5        lattice_0.20-38
[19] glue_1.3.1             digest_0.6.21          RColorBrewer_1.1-2
[22] promises_1.1.0         XVector_0.24.0         checkmate_1.9.4
[25] colorspace_1.4-1       htmltools_0.4.0        httpuv_1.5.2
[28] Matrix_1.2-17          plyr_1.8.4             XML_3.98-1.20
[31] pkgconfig_2.0.3        genefilter_1.66.0      zlibbioc_1.30.0
[34] purrr_0.3.2            xtable_1.8-4           scales_1.0.0
[37] later_1.0.0            annotate_1.62.0        tibble_2.1.3
[40] htmlTable_1.13.2       ggplot2_3.2.1          nnet_7.3-12
[43] lazyeval_0.2.2         survival_2.44-1.1      magrittr_1.5
[46] crayon_1.3.4           mime_0.7               memoise_1.1.0
[49] MASS_7.3-51.4          foreign_0.8-71         tools_3.6.1
[52] data.table_1.12.4      lifecycle_0.1.0        stringr_1.4.0
[55] plotly_4.9.0           locfit_1.5-9.1         munsell_0.5.0
[58] cluster_2.1.0          AnnotationDbi_1.46.1   compiler_3.6.1
[61] rlang_0.4.0            grid_3.6.1             RCurl_1.95-4.12
[64] rstudioapi_0.10        htmlwidgets_1.5.1      bitops_1.0-6
[67] base64enc_0.1-3        gtable_0.3.0           DBI_1.0.0
[70] R6_2.4.0               gridExtra_2.3          knitr_1.25
[73] dplyr_0.8.3            bit_1.1-14             fastmap_1.0.1
[76] zeallot_0.1.0          Hmisc_4.2-0            stringi_1.4.3
[79] Rcpp_1.0.2             geneplotter_1.62.0     vctrs_0.2.0
[82] rpart_4.1-15           acepack_1.4.1          tidyselect_0.2.5
[85] xfun_0.10
>
deseq2 • 1.4k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 6 days ago
United States

Can you post your code? Are you using rlog()?

ADD COMMENT
0
Entering edit mode

Hi Mike, thanks for the quick response. Those outputs are from rlogTransformation() and varianceStabilizingTransformation() but I tried rlog() too with the same result. My workaround has been to assign rownames after calling rlog(). The code is a bit large but I could try making a cut down example if that will help. The str() code is:

str(Assays.lst[["rlog"]])
str(Assays.lst[["vst"]])

Where those list items are the value returned from rlog/vst.

Cheers

Tim

ADD REPLY
1
Entering edit mode

Can confirm, when rlog starting from a matrix:

dds <- makeExampleDESeqDataSet(m=6,betaSD=1, interceptMean = 10)
cts <- assay(dds)
> rownames(rlog(cts))
NULL
> rownames(vst(cts))
[1] "gene1"    "gene2"    "gene3"  (...)
ADD REPLY
0
Entering edit mode

Thanks ATpoint - you nailed it there!

ADD REPLY
1
Entering edit mode

Thanks I see the missing line — hopefully will make the release...

ADD REPLY
1
Entering edit mode

Looks like this fixed it:

https://github.com/mikelove/DESeq2/commit/5dc47cfb2726f51b57c697b7fef387e6b4906403

You can try with install_github...

ADD REPLY
0
Entering edit mode

Fab - thanks Mike and thanks for DESeq2!

Cheeky I know but do you have any suggestions for my other question: https://support.bioconductor.org/p/134585/, thanks :)

ADD REPLY

Login before adding your answer.

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