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
    Advancing Precision Medicine for Rare Diseases in Children
    by seqadmin




    Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
    12-16-2024, 07:57 AM
  • seqadmin
    Recent Advances in Sequencing Technologies
    by seqadmin



    Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

    Long-Read Sequencing
    Long-read sequencing has seen remarkable advancements,...
    12-02-2024, 01:49 PM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, 12-17-2024, 10:28 AM
0 responses
27 views
0 likes
Last Post seqadmin  
Started by seqadmin, 12-13-2024, 08:24 AM
0 responses
43 views
0 likes
Last Post seqadmin  
Started by seqadmin, 12-12-2024, 07:41 AM
0 responses
29 views
0 likes
Last Post seqadmin  
Started by seqadmin, 12-11-2024, 07:45 AM
0 responses
42 views
0 likes
Last Post seqadmin  
Working...
X