Coefficient names for multiple group comparisons to use with lfcShrink & apeglm
1
0
Entering edit mode
coulsonr ▴ 20
@coulsonr-16748
Last seen 5.0 years ago

Hi,

I wish to perform a differential expression analysis comparing one tumour-type category ('Tumour.Type') against an average of all the other categories using DESeq2:

# Analysis Groups
> grps
[1] "Tumour.TypeLUAD" "Tumour.TypeCOAD" "Tumour.TypeUEC"  "Tumour.TypeBRCA"
[5] "Tumour.TypeKIRP" "Tumour.TypeKIRC" "Tumour.TypeLUSC" "Tumour.TypePAAD"

ddsMat <- DESeqDataSetFromMatrix(
  countData=Counts, colData=SampleSheet, design=~0 + Tumour.Type
)
dds <- DESeq(ddsMat)
> identical(sort(grps), resultsNames(dds))
[1] TRUE

For example, to compare 'LUAD' with the seven other groups I've used the contrast:

res <- results(
  dds, contrast = list(grps[1], grps[-1]), listValues = c(1,-1/(length(grps)-1))
 )

Having obtained the log2-foldChanges, I'd like to shrink them for geneset enrichment analyses. I've done this before using lfcShrink() with the "apeglm" method. However, "apeglm" requires the use of 'coef' and I've not been able to find a way of creating the name or finding the number of the coefficient for the above contrast.

Please could anyone help me out with this?

Many thanks, Richard Coulson.

sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.4 LTS

Matrix products: default BLAS: /usr/lib/libblas/libblas.so.3.6.0 LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale: [1] LCCTYPE=enGB.UTF-8 LCNUMERIC=C
[3] LC
TIME=enGB.UTF-8 LCCOLLATE=enGB.UTF-8
[5] LC
MONETARY=enGB.UTF-8 LCMESSAGES=enGB.UTF-8
[7] LC
PAPER=enGB.UTF-8 LCNAME=C
[9] LCADDRESS=C LCTELEPHONE=C
[11] LCMEASUREMENT=enGB.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] shinyngs0.0.1 bcbioRNASeq0.2.9
[3] DESeq21.20.0 bcbioBase0.4.1
[5] basejump0.7.2 SummarizedExperiment1.10.1 [7] DelayedArray0.6.6 BiocParallel1.14.2
[9] matrixStats0.54.0 Biobase2.40.0
[11] GenomicRanges1.34.0 GenomeInfoDb1.16.0
[13] IRanges2.16.0 S4Vectors0.20.1
[15] BiocGenerics_0.28.0

loaded via a namespace (and not attached): [1] R.utils2.8.0 tidyselect0.2.5
[3] RSQLite2.1.2 AnnotationDbi1.44.0
[5] htmlwidgets1.3 grid3.5.1
[7] munsell0.5.0 codetools0.2-15
[9] preprocessCore1.44.0 withr2.1.2
[11] colorspace1.3-2 knitr1.22
[13] rstudioapi0.8 assertive.base0.0-7
[15] rdrop20.8.1 lasso21.2-20
[17] tximport1.10.1 bbmle1.0.20
[19] GenomeInfoDbData1.1.0 mnormt1.5-5
[21] bit640.9-7 pheatmap1.0.10
[23] coda0.19-2 Matrix.utils0.9.7
[25] vctrs0.2.0 generics0.0.2
[27] xfun0.6 R62.3.0
[29] apeglm1.2.1 assertive.sets0.0-3
[31] locfit1.5-9.1 AnnotationFilter1.6.0
[33] bitops1.0-6 reshape0.8.7
[35] assertthat0.2.0 promises1.0.1
[37] scales1.0.0 nnet7.3-12
[39] gtable0.2.0 affy1.60.0
[41] ensembldb2.6.1 rlang0.4.1
[43] zeallot0.1.0 genefilter1.62.0
[45] GlobalOptions0.1.0 splines3.5.1
[47] rtracklayer1.42.0 lazyeval0.2.1
[49] acepack1.4.1 broom0.5.2
[51] checkmate1.8.5 BiocManager1.30.4
[53] yaml2.2.0 reshape21.4.3
[55] GenomicFeatures1.34.1 backports1.1.2
[57] httpuv1.4.5 Hmisc4.1-1
[59] tools3.5.1 tcltk3.5.1
[61] psych1.8.12 logging0.9-107
[63] ggplot23.0.0 affyio1.52.0
[65] assertive.strings0.0-3 RColorBrewer1.1-2
[67] ggdendro0.1-20 sessioninfo1.1.0
[69] Rcpp1.0.2 plyr1.8.4
[71] base64enc0.1-3 progress1.2.0
[73] zlibbioc1.26.0 purrr0.2.5
[75] RCurl1.95-4.11 prettyunits1.0.2
[77] rpart4.1-13 pbapply1.4-0
[79] GetoptLong0.1.7 cowplot0.9.3
[81] grr0.9.5 ggrepel0.8.0
[83] cluster2.0.7-1 magrittr1.5
[85] data.table1.11.8 assertive.data0.0-3
[87] circlize0.4.6 ProtGenerics1.14.0
[89] hms0.4.2 mime0.6
[91] xtable1.8-3 XML3.98-1.16
[93] emdbook1.3.10 gridExtra2.3
[95] shape1.4.4 compiler3.5.1
[97] biomaRt2.36.1 tibble2.1.3
[99] crayon1.3.4 R.oo1.22.0
[101] htmltools0.3.6 later0.7.5
[103] Formula1.2-3 tidyr0.8.1
[105] geneplotter1.58.0 DBI1.0.0
[107] assertive.files0.0-2 ComplexHeatmap1.20.0
[109] MASS7.3-51 assertive.numbers0.0-2
[111] Matrix1.2-14 readr1.3.1
[113] cli1.0.1 vsn3.50.0
[115] assertive.types0.0-3 R.methodsS31.7.1
[117] pkgconfig2.0.2 GenomicAlignments1.18.0
[119] numDeriv2016.8-1 foreign0.8-71
[121] plotly4.8.0 annotate1.58.0
[123] XVector0.20.0 stringr1.3.1
[125] digest0.6.18 ConsensusClusterPlus1.46.0
[127] assertive.code0.0-3 Biostrings2.48.0
[129] htmlTable1.12 edgeR3.22.5
[131] curl3.2 shiny1.1.0
[133] Rsamtools1.34.0 rjson0.2.20
[135] nlme3.1-137 jsonlite1.5
[137] DEGreport1.18.1 viridisLite0.3.0
[139] limma3.36.5 pillar1.4.2
[141] lattice0.20-35 Nozzle.R11.1-1
[143] httr1.3.1 survival2.42-6
[145] interactiveDisplayBase1.20.0 glue1.3.0
[147] bit1.1-14 assertive.properties0.0-4
[149] stringi1.2.4 blob1.2.0
[151] AnnotationHub2.14.5 latticeExtra0.6-28
[153] memoise1.1.0 dplyr0.8.3

deseq2 lfcShrink apeglm • 1.2k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 2 days ago
United States

We don't have a mechanism in lfcShrink for performing shrinkage with apeglm based on a contrast of the coefficients (while apeglm has a contrast argument, the handoff between the two software wasn't trivial so we just work on named coefficients).

I'd recommend to use ashr, which we found works well in our testing, and better than type="normal".

ADD COMMENT
0
Entering edit mode

Many thanks Mike, I'll try the "ashr" option.

Cheers, Richard.

ADD REPLY

Login before adding your answer.

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