Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CAGCAGCAGCAG
    Junior Member
    • Jun 2020
    • 2

    #1

    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

  • SEQadmin2
    16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
    by SEQadmin2




    NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
    Today, 06:46 AM
  • SEQadmin2
    Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
    by SEQadmin2



    Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

    Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
    ...
    10-14-2026, 09:55 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by SEQadmin2, 10-28-2026, 09:57 AM
0 responses
23 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-28-2026, 09:51 AM
0 responses
15 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-22-2026, 11:13 AM
0 responses
68 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-22-2026, 10:48 AM
0 responses
48 views
0 reactions
Last Post SEQadmin2  
Working...