Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • genomica
    Junior Member
    • Feb 2013
    • 9

    Deseq2 multifactor analysis

    Hello,

    I have a RNAseq experiment where I have 2 conditions and 3 replicates each and replicates are taken from different individuals. So my design is as follows:

    Sample Condition Individual
    S1 treated A
    S2 untreated A
    S3 treated B
    S4 untreated B
    S5 treated C
    S6 untreated C

    Here is my code to analyse the data using deseq2:
    Code:
    library('DESeq2')
    directory<-"counts"
    sampleFilesN1_N2 <- grep("*N[1-2]",list.files(directory),value=TRUE)
    sampleConditionN1_N2<-c("treated","untreated","treated","untreated","treated","untreated")
    sampleIndividual<-c("A","A","B","B","C","C")
    sampleTable1<-data.frame(sampleName=sampleFilesN1_N2, fileName=sampleFilesN1_N2, condition=sampleConditionN1_N2, individual=sampleIndividual)
    ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable1, directory = directory,design= ~ condition + individual)
    ddsHTSeq$condition <- relevel(ddsHTSeq$condition, "untreated")
    dds<-DESeq(ddsHTSeq)
    res<-results(dds)
    res<-res[order(res$padj),]
    write.csv(as.data.frame(res),file="DeSEQ2_treated_vs_untreated.csv")
    However, when I run these and look at results, following message:
    Code:
    "log2 fold change (MAP): individual C vs A
    Wald test p-value: individual C vs A"
    So, its only giving me results after comparing C vs A. Am I missing anything here?

    Thanks for any help.
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    results() will just give you one of the possible comparisons (the last one in the model matrix, by default). See help(results) for how to get the results you want.

    Comment

    • genomica
      Junior Member
      • Feb 2013
      • 9

      #3
      Originally posted by dpryan View Post
      results() will just give you one of the possible comparisons (the last one in the model matrix, by default). See help(results) for how to get the results you want.
      Thanks for the hint, that's really helpful. So, I understand if I want to get comparison of conditions considering the pairing of samples into account, I should give

      Code:
      res <- results(dds, contrast=c("condition","treated","untreated"))
      Is this correct?

      Thanks again.
      Last edited by genomica; 09-24-2015, 07:41 AM.

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        Yup and I see you figured out the error in your earlier attempt

        Comment

        • genomica
          Junior Member
          • Feb 2013
          • 9

          #5
          Thanks very much Devon. Yes, I did figure out the first error

          I am a bit paranoid as I am doing this analysis for the first time and hence wondered if you could confirm if my experimental design is ok.

          Code:
          ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable1, directory = directory,[B]design= ~ condition + individual[/B])
          or do I need:
          Code:
          ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable1, directory = directory,[B]design= ~ condition + individual +condition:individual[/B])
          Many thanks again.

          Comment

          • dpryan
            Devon Ryan
            • Jul 2011
            • 3478

            #6
            Go for the first one, the second one ends up directly comparing individual samples and therefore isn't reliable.

            Comment

            • genomica
              Junior Member
              • Feb 2013
              • 9

              #7
              Thanks a lot for your help Devon.

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                by SEQadmin2


                Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                The systematic characterization of the human proteome has
                ...
                07-20-2026, 11:48 AM
              • SEQadmin2
                Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                by SEQadmin2



                Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                ...
                07-09-2026, 11:10 AM
              • SEQadmin2
                Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                by SEQadmin2



                Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                07-08-2026, 05:17 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, Yesterday, 12:17 PM
              0 responses
              13 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-23-2026, 11:41 AM
              0 responses
              14 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-20-2026, 11:10 AM
              0 responses
              23 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-13-2026, 10:26 AM
              0 responses
              37 views
              0 reactions
              Last Post SEQadmin2  
              Working...