Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • DESeq2: Contrasts in multifactor design with interaction terms

    Hello,

    Please note that I have posted this question on another website, but I did not receive any advice. I would really appreciate some help, and apologize if this is against the rules. I can delete my post if needed.

    I am using DESeq2 and I am a beginner with using model matrices and contrasts. I have a design with three variables: tissue, time and phenotype, where the tissue has three levels (X, Y and Z, where X is the reference level), time as three levels (12h, 24h and 48h, where 12h is the reference level), and phenotype has three levels (ctrl, A and B, where ctrl is the reference level). I have added the dput of the design table below my post (first column is just the sample ID). I am using the following formula to consider all possible variables and interaction terms in the dds object:

    ~ tissue * time * phenotype

    The reason I am doing this is because I am developing a function that uses DESeq2 with a special model matrix and returns a dds object, and my goal is to generate a single dds object, and then be able to use the contrasts to retrieve differential gene expression for any combination of these variables. For example, I could then want to get differential gene expression for (tissue Y time 48h phenotype B) vs (tissue Y time 48h phenotype ctrl), or another example could be (tissue X time 24h phenotype A) vs (tissue X time 24h phenotype ctrl). Please note that I DO know how to run DESeq2 for simple pairwise comparisons, but this is not the goal of this post. The question is not about figuring out the appropriate biological question, design, or formula. This is about designing a function that is able to handle a request like the two examples I mentioned.

    So right now with this formula the resultsNames(dds) are:

    tissueY
    tissueZ
    time24h
    time48h
    phenotypeA
    phenotypeB
    tissueY:time24h
    tissueZ:time24h
    tissueY:time48h
    tissueZ:time48h
    tissueYhenotypeA
    tissueZhenotypeA
    tissueYhenotypeB
    tissueZhenotypeB
    time24hhenotypeA
    time48hhenotypeA
    time24hhenotypeB
    time48hhenotypeB
    tissueY:time24hhenotypeA
    tissueZ:time24hhenotypeA
    tissueY:time48hhenotypeA
    tissueZ:time48hhenotypeA
    tissueY:time24hhenotypeB
    tissueZ:time24hhenotypeB
    tissueY:time48hhenotypeB
    tissueZ:time48hhenotypeB

    To extract differential expression between, for example, (tissue Y time 48h phenotype B) and (tissue Y time 48h phenotype ctrl), what would be the correct contrasts? And what would it become if were are interested in one of the reference levels, for example differential expression between (tissue X time 24h phenotype A) and (tissue X time 24h phenotype ctrl), where tissue X was set as the reference?

    Thank you for your help!

    The design deput:

    Code:
    dput(design) structure(list(tissue = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("X", "Y", "Z"), class = "factor"), time = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("12h", "24h", "48h"), class = "factor"), phenotype = structure(c(3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 1L, 2L, 2L, 2L ), .Label = c("A", "B", "ctrl"), class = "factor")), class = "data.frame", row.names = c("s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", "s32", "s33", "s34", "s35", "s36", "s37", "s38", "s39", "s40", "s41", "s42", "s43", "s44", "s45", "s46", "s47", "s48", "s49", "s50", "s51", "s52", "s53", "s54", "s55", "s56", "s57", "s58", "s59", "s60", "s61", "s62", "s63", "s64", "s65", "s66", "s67", "s68", "s69", "s70", "s71", "s72", "s73", "s74", "s75", "s76", "s77", "s78", "s79", "s80", "s81"))

Latest Articles

Collapse

  • seqadmin
    Recent Advances in Sequencing Analysis Tools
    by seqadmin


    The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
    Yesterday, 07:48 AM
  • seqadmin
    Essential Discoveries and Tools in Epitranscriptomics
    by seqadmin




    The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
    04-22-2024, 07:01 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, Today, 06:57 AM
0 responses
9 views
0 likes
Last Post seqadmin  
Started by seqadmin, Yesterday, 07:17 AM
0 responses
13 views
0 likes
Last Post seqadmin  
Started by seqadmin, 05-02-2024, 08:06 AM
0 responses
19 views
0 likes
Last Post seqadmin  
Started by seqadmin, 04-30-2024, 12:17 PM
0 responses
23 views
0 likes
Last Post seqadmin  
Working...
X