Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • disulfidebond
    Junior Member
    • Oct 2015
    • 3

    #1

    DESeq2 question regarding contrasts

    Hello,

    I have a question regarding DESeq2 and contrasts, and I may simply be over-thinking the problem. I have a dataset with 3 groups, and two treatments

    Sample Condition Group
    sample1 Control Bact1
    sample2 Control Bact1
    sample3 Control Bact1
    sample4 Treated Bact1
    sample5 Treated Bact1
    sample6 Treated Bact1
    sample7 Control Bact2
    sample8 Control Bact2
    sample9 Control Bact2
    sample10 Treated Bact2
    sample11 Treated Bact2
    sample12 Treated Bact2
    sample13 Control Bact3
    sample14 Control Bact3
    sample15 Control Bact3
    sample16 Treated Bact3
    sample17 Treated Bact3
    sample18 Treated Bact3


    The main goal in the experiment is to determine if strain Bact1 has differentially expressed genes after treatment compared to Bact2. Previously, I did an analysis of Bact1 vs Bact2, (using the table above, minus Bact3) and was set up as:

    dds <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable, directory = directory, design = ~ group + cond + group:cond)

    res<- results(name="groupBact2.condTreated")

    # shows interaction term, or how the treatment condition is different across Bact2 v. Bact1

    res_Bact2 <- results(contrast=list(c("condition_Treated_vs_Control", "groupBact2.condTreated")))

    # shows treatment condition in Bact2

    # alternatively I can use dds$group <- relevel(dds$group, ref="Bact2") to look at Bact1



    Now, there is a third strain in the analysis, and here is where I'm stuck. I tried creating the table above, using the design

    design = ~ group + cond + group:cond

    # called DESeq2() with betaprior=FALSE

    and it ran successfully without errors, but the resultsNames() table was

    [1] "Intercept" "group_BACT2_vs_BACT1" "group_BACT3_vs_BACT1"
    [4] "cond_Trt_vs_Ctrl" "groupBACT2.condTrt" "groupBACT3.condTrt"



    which doesn't seem to be what I want, because checking the attributes with

    attr(dds, "ModelMatrix")

    shows that the variables "group_..." doesn't include the treatment variables, and "groupBACT2.condTrt" is only the treated groups (I think?). Contrasting "groupBACT2.condTrt" and "group_BACT2_vs_BACT1" shows an output, but I'm not sure if it's doing what I'd want, i.e. contrasting the difference between Bact3 v. Bact2 in the treatment condition.

    If I combine the factors into groups with

    dds$grp <- factor(paste0(dds$group, dds$cond))

    design(dds) <- ~ grp

    running DESeq() and then resultsNames() gives:

    [1] "Intercept" "grpall_Bact1Trt_vs_Bact1Ctrl"
    [3] "grpall_Bact2Ctrl_vs_Bact2Ctrl" "grpall_Bact2Trt_vs_CBact1Ctrl"
    [5] "grpall_Bact3Ctrl_vs_Bact1Ctrl" "grpall_Bact3Trt_vs_Bact1Ctrl"

    Which is still not what I'm looking for. Am I on the wrong track entirely, or should I simply revelel() the group factors to assign the Treatment as the reference, or something else?

Latest Articles

Collapse

  • 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
  • SEQadmin2
    New Genomics Technologies Take Aim at Long-Standing Limits
    by SEQadmin2


    Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

    We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
    ...
    09-28-2026, 10:25 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by SEQadmin2, 10-22-2026, 11:13 AM
0 responses
27 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-22-2026, 10:48 AM
0 responses
20 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-15-2026, 10:52 AM
0 responses
36 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-14-2026, 05:39 AM
0 responses
43 views
0 reactions
Last Post SEQadmin2  
Working...