Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • DESeq2 model design + contrasts (not full rank)

    Hi,

    I'm new to this forum and I got a question doe DESeq2 concerning model design and contrast, because my model design is not full ranked. I read multiple threads before and still did not understand how to proceed correctly.

    I have 16 samples of single end Illumina reads. With 4 different treatments (group). Per treatment I have 4 biological replicates (indi). Unfortunately, the biological replicates are not evenly distributed across both used flowcells (flow). I am interested in the differences between the different treatments (group) and how to correctly get rid of the batch effect, if thats even possible. I followed the DESeq2 manual for this particular case as follows:

    Here my meta matrix for the samples:

    Code:
    group indi flow 
      T1   I1    A 
      T1   I2    A 
      T1   I3    B   
      T1   I4    B    
      T2   I1    A    
      T2   I2    A    
      T2   I3    B    
      T2   I4    B    
      T3   I1    A    
      T3   I2    A    
      T3   I3    B    
      T3   I4    B    
      T4   I1    A    
      T4   I2    A    
      T4   I3    B    
      T4   I4    B

    Like in the manual I first built my design matrix like so:

    Code:
    ds_txi <- DESeqDataSetFromTximport(txi = txi_salmon,
                                       colData = meta,
                                       design = ~ indi+group)
    
    ds_txi$indi_n <- c("I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2")
    
    meta$indi_n <- c("I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2")
    
    meta$indi_n <- as.factor(meta$indi_n)
    ds_txi$indi_n <- as.factor(ds_txi$indi_n)
    
    ds_txi <- DESeqDataSetFromTximport(txi = txi_salmon,
                                       colData = meta,
                                       design = ~ flow + flow:indi_n + flow:group)

    This workaroud should allow me, to get the differences between treatments within one batch:

    Code:
    dss <- DESeq(ds_txi)
    res <- results(dss,contrast=list("flowA.groupT1","flowA.groupT2"), alpha= p_adjust_treshold,  lfcThreshold = L2FC_treshold)
    Resulting in a new meta table:
    Code:
     group indi flow indi_n
      T1	I1    A     I1
      T1	I2    A     I2
      T1	I3    B     I1
      T1	I4    B     I2
      T2	I1    A     I1
      T2	I2    A     I2
      T2	I3    B     I1
      T2	I4    B     I2
      T3	I1    A     I1
      T3	I2    A     I2
      T3	I3    B     I1
      T3	I4    B     I2
      T4	I1    A     I1
      T4	I2    A     I2
      T4	I3    B     I1
      T4	I4    B     I2
    But how do I use the contrast, to get the differences between treatment T1 versus T2 with the elimination of the batch effect of the flowcells. Is this possible?

    Can I maybe just do something like this:


    Code:
    res <- results(dss,contrast=list(c("flowA.groupT1","flowB.groupT1"),c("flowA.groupT2","flowB.groupT2")), alpha= p_adjust_treshold,  lfcThreshold = L2FC_treshold)

Latest Articles

Collapse

  • seqadmin
    Recent Developments in Metagenomics
    by seqadmin





    Metagenomics has improved the way researchers study microorganisms across diverse environments. Historically, studying microorganisms relied on culturing them in the lab, a method that limits the investigation of many species since most are unculturable1. Metagenomics overcomes these issues by allowing the study of microorganisms regardless of their ability to be cultured or the environments they inhabit. Over time, the field has evolved, especially with the advent...
    09-23-2024, 06:35 AM
  • seqadmin
    Understanding Genetic Influence on Infectious Disease
    by seqadmin




    During the COVID-19 pandemic, scientists observed that while some individuals experienced severe illness when infected with SARS-CoV-2, others were barely affected. These disparities left researchers and clinicians wondering what causes the wide variations in response to viral infections and what role genetics plays.

    Jean-Laurent Casanova, M.D., Ph.D., Professor at Rockefeller University, is a leading expert in this crossover between genetics and infectious...
    09-09-2024, 10:59 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, Yesterday, 04:51 AM
0 responses
8 views
0 likes
Last Post seqadmin  
Started by seqadmin, 10-01-2024, 07:10 AM
0 responses
11 views
0 likes
Last Post seqadmin  
Started by seqadmin, 09-30-2024, 08:33 AM
0 responses
16 views
0 likes
Last Post seqadmin  
Started by seqadmin, 09-26-2024, 12:57 PM
0 responses
16 views
0 likes
Last Post seqadmin  
Working...
X