Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DESeq2 Contrasts

    I am trying to do contrasts between 3 levels in a factor, and I am running the DESeq command in DESeq using the recommended betaPrior=FALSE argument. However, this command has been running for hours and I think there must be a problem. Its been "fitting model and testing" for three hours and counting...

    My data set has 2 factors Treatment (treated vs non) and Type (control, high low).

    Here is my code:

    > dds <- DESeqDataSetFromMatrix(countData = counts,
    + colData = pData,
    + design = ~ Treatment + Type)

    Usage note: the following factors have 3 or more levels:

    Type

    For DESeq2 versions < 1.3, if you plan on extracting results for
    these factors, we recommend using betaPrior=FALSE as an argument
    when calling DESeq().
    As currently implemented in version 1.2, the log2 fold changes can
    vary if the base level is changed, when extracting results for a
    factor with 3 or more levels. A solution will be implemented in
    version 1.3 which allows for the use of a beta prior and symmetric
    log2 fold change estimates regardless of the selection of base level.

    > colData(dds)$Type <- factor(colData(dds)$Type,
    + levels=c("control","low", "high"))

    > dds <- DESeq(dds, betaPrior = FALSE)
    estimating size factors
    estimating dispersions
    gene-wise dispersion estimates
    mean-dispersion relationship
    final dispersion estimates
    fitting model and testing

  • #2
    hi,

    I haven't seen such a stall before. We re-implemented the use of a beta prior in version 1.3 which will be released with DESeq2 v1.4 in mid-March. This might fix your case and allow use of the moderated fold changes.

    If you want to continue using v1.2, because you have a clearly defined base level "control", I would recommend using betaPrior=TRUE. The only caveat we had for this, is that the fold change from low to control and high to control are moderated, so there is an asymmetry to the analysis if you set the base level to `high` for example.

    We eliminated this asymmetry in version >= 1.3. However, for experiments as you case, when there is a clearly defined base level (control), I don't see a problem with betaPrior=TRUE. Just ignore the message regarding setting betaPrior to FALSE.

    Comment


    • #3
      Thanks Michael.

      What do you recommend for analysis across a factor with three levels, none of which is clearly defined as a base level or "control". I am interested in running a comparison across multiple tissue types.

      Comment


      • #4
        If you are using DESeq2 version >= 1.3 (available in the devel branch and released in a few weeks), and you have a variable 'condition' with levels A,B,C, you can do:

        dds <- DESeqDataSet(..., design = ~ groupingvar + condition)
        dds <- DESeq(dds)
        res <- results(dds, contrast=c("condition","B","A")
        ...for any of the 3 contrasts

        If you are using version 1.2, you can set one level as the base level and produce contrasts in the same way as the line above. This includes the ability to contrast the "high" and "low" levels:

        res <- results(dds, contrast=c("Type","high","low"))

        The only problem in version 1.2 is that the shrinkage in version 1.2 was asymmetric. The LFC's can change slightly if the factors are releveled. We fixed this, but in Bioconductor, changes which would affect user results should only be made every 6 months according to the release schedule.

        If are using version 1.2, and if you don't want to set "control" as the base level, or if the potential asymmetry bothers you, you can avoid this asymmetry by setting betaPrior=FALSE.

        I wonder if the slow run you experienced is because you are on a machine with limited memory? If not I can try to debug, if you send me a reproducible example of code and a data object. my email is in the package help.

        Comment


        • #5
          Hi Dr. Love,

          Am I understanding this correctly, that in order to run the comparisons you'll need three separate lines, one for each comparison? The manual indicates that all three contrasts are possible, but I must have missed the example.

          Thanks for your help!

          > sessionInfo()
          R version 3.2.1 (2015-06-18)
          Platform: x86_64-w64-mingw32/x64 (64-bit)
          Running under: Windows 7 x64 (build 7601) Service Pack 1

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

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

          other attached packages:
          [1] calibrate_1.7.2 MASS_7.3-43
          [3] genefilter_1.50.0 pheatmap_1.0.7
          [5] arrayQualityMetrics_3.24.0 DESeq2_1.8.1
          [7] RcppArmadillo_0.5.200.1.0 Rcpp_0.12.0
          [9] GenomicRanges_1.20.5 GenomeInfoDb_1.4.1
          [11] IRanges_2.2.5 S4Vectors_0.6.3
          [13] RColorBrewer_1.1-2 ggplot2_1.0.1
          [15] gplots_2.17.0 DESeq_1.20.0
          [17] lattice_0.20-33 locfit_1.5-9.1
          [19] Biobase_2.28.0 BiocGenerics_0.14.0

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Strategies for Sequencing Challenging Samples
            by seqadmin


            Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
            03-22-2024, 06:39 AM
          • seqadmin
            Techniques and Challenges in Conservation Genomics
            by seqadmin



            The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

            Avian Conservation
            Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
            03-08-2024, 10:41 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, Yesterday, 06:37 PM
          0 responses
          7 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, Yesterday, 06:07 PM
          0 responses
          7 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 03-22-2024, 10:03 AM
          0 responses
          49 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 03-21-2024, 07:32 AM
          0 responses
          66 views
          0 likes
          Last Post seqadmin  
          Working...
          X