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
    The Impact of AI in Genomic Medicine
    by seqadmin



    Artificial intelligence (AI) has evolved from a futuristic vision to a mainstream technology, highlighted by the introduction of tools like OpenAI's ChatGPT and Google's Gemini. In recent years, AI has become increasingly integrated into the field of genomics. This integration has enabled new scientific discoveries while simultaneously raising important ethical questions1. Interviews with two researchers at the center of this intersection provide insightful perspectives into...
    02-26-2024, 02:07 PM
  • seqadmin
    Multiomics Techniques Advancing Disease Research
    by seqadmin


    New and advanced multiomics tools and technologies have opened new avenues of research and markedly enhanced various disciplines such as disease research and precision medicine1. The practice of merging diverse data from various ‘omes increasingly provides a more holistic understanding of biological systems. As Maddison Masaeli, Co-Founder and CEO at Deepcell, aptly noted, “You can't explain biology in its complex form with one modality.”

    A major leap in the field has
    ...
    02-08-2024, 06:33 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, 02-28-2024, 06:12 AM
0 responses
27 views
0 likes
Last Post seqadmin  
Started by seqadmin, 02-23-2024, 04:11 PM
0 responses
74 views
0 likes
Last Post seqadmin  
Started by seqadmin, 02-21-2024, 08:52 AM
0 responses
81 views
0 likes
Last Post seqadmin  
Started by seqadmin, 02-20-2024, 08:57 AM
0 responses
69 views
0 likes
Last Post seqadmin  
Working...
X