Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #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


    • #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


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

        Comment


        • #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


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

            Comment


            • #7
              Thanks a lot for your help Devon.

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Essential Discoveries and Tools in Epitranscriptomics
                by seqadmin


                The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
                Yesterday, 07:01 AM
              • seqadmin
                Current Approaches to Protein Sequencing
                by seqadmin


                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                04-04-2024, 04:25 PM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              45 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              46 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              39 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              55 views
              0 likes
              Last Post seqadmin  
              Working...
              X