Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Prabhakaran
    Junior Member
    • Jul 2013
    • 4

    #1

    EdgeR script help

    Hi. I had just started learning R and have been working on a script on EdgeR for Illumina data to analyze differential expression. SO I have two different samples with two tissues from each for which I have count data set for each one of them. I am intersted in comparing one tissue from one sample with other one from another sample (as well interested to compare within a sample). Below is the script I was trying to use, which gives error. Since I am new to this R programming, I am not able to figure what or where the problem is. I would really appreciate if someone could help me with this.Thanks.

    library(edgeR)
    library(limma)
    setwd("C:\\cygwin\\home\\Prabhakaran")
    load("test1.txt")
    raw.data <- read.table(file="test1.txt", header=TRUE)
    names(raw.data)
    d <- raw.data[, 2:3]
    rownames(d) <- raw.data[ ,1]
    sample <- factor(R91+92_LFE_Hits, X95+96_clark_E_hits)
    d <- estimateCommonDisp(d)
    et <- exactTest(d)
    topTags(et)
    etTag = rownames(topTags(et)$table)
    sum(et$table$p.value <0.05)
    sum(p.adjust(et$table$p.value,method="BH") < 0.1)
    good = sum(et$table$p.value <0.05)
    goodList = topTags(et, n=good)
    sink("output1.csv")
    goodList
    sink()
  • mastal
    Senior Member
    • Mar 2009
    • 666

    #2
    EdgeR script help

    What error do you get?

    Have you tried running the commands in your script one at a
    time to see how far you get before you get the error?

    Comment

    • bruce01
      Senior Member
      • Mar 2011
      • 160

      #3
      d <- raw.data[, 2:3]

      This means that you have two columns of count data, so you cannot do DE analysis because of not having biological replicates. Not sure if EdgeR gives an error because of this, but it is the first thing to note.

      As Mastal says, if you give output or run lines one by one and show us that we could help more.

      Comment

      • Prabhakaran
        Junior Member
        • Jul 2013
        • 4

        #4
        Thanks Mastal and Bruce.
        I did run the script line by line and I get an error at line 9 and 10. Also i am not able to perform the exactTest. Tried to modify the two lines where I got an error but didnt get the right one.

        And Yes i have countdata in the 2nd and 3rd column in the file and it is the data of two tissues from the same sample say epidermis and meristem. trying to look at the DE genes between two.
        Last edited by Prabhakaran; 07-30-2013, 06:31 AM.

        Comment

        • mastal
          Senior Member
          • Mar 2009
          • 666

          #5
          Originally posted by Prabhakaran View Post

          sample <- factor(R91+92_LFE_Hits, X95+96_clark_E_hits)
          d <- estimateCommonDisp(d)
          Are the lines above the lines that gave errors?

          What were the error messages that you got?

          I'm not surprised that you weren't able to perform the exact test,
          if the errors were in the lines immediately before that step.

          I'm not sure what you are trying to do with the variable 'sample',
          a factor in R should have levels, so you need a vector with the allowed values for the levels. If you are trying to join two vectors, in R you would do it as 'c(vector1, vector2)'.

          Comment

          • Prabhakaran
            Junior Member
            • Jul 2013
            • 4

            #6
            I wasnt even surprised to see that error when the problem is in reading the input itself. I tried to modify the column name still it doesnt work. Coming to the R part, like i mentioned earlier im just starting and trying to understand as i go along. Following is the error:

            Error in source("C:\\cygwin\\home\\Prabhakaran\\test.R") :
            C:\cygwin\home\Prabhakaran\test.R:9:19: unexpected input
            8: rownames(d) <- raw.data[ ,1]
            9: sample <- c(R91+92_

            Comment

            • bruce01
              Senior Member
              • Mar 2011
              • 160

              #7
              The 'sample' variable is not used anywhere in the rest of your script. What is it for? Is it conditions? So what do you have when you do:
              head(raw.data)
              Do you get those two names you are trying to put into 'sample'? Try wrapping them in quotes:
              sample<-c("R91+92_LFE_Hits", "X95+96_clark_E_hits")
              otherwise R looks for variable of those names, which probably do not exist...

              Comment

              • dpryan
                Devon Ryan
                • Jul 2011
                • 3478

                #8
                A couple comments:
                Code:
                raw.data <- read.table(file="test1.txt", header=TRUE)
                names(raw.data)
                d <- raw.data[, 2:3]
                rownames(d) <- raw.data[ ,1]
                can simply be:
                Code:
                d <- read.table(file="test1.txt", header=T, row.names=1)
                You may also be getting an error since you're using "rownames" rather than "row.names" (the former takes an array and the latter a data frame).

                Code:
                sample <- factor(R91+92_LFE_Hits, X95+96_clark_E_hits)
                As already pointed out, you need quotes:
                Code:
                sample <- factor("R91+92_LFE_Hits", "X95+96_clark_E_hits")
                Aside from that, with only two samples, you're wasting your time anyway.

                Comment

                • Prabhakaran
                  Junior Member
                  • Jul 2013
                  • 4

                  #9
                  Hi,

                  Could anyone share an EdgeR script for differential expression analysis of four different samples.

                  Thank you.

                  Comment

                  • dpryan
                    Devon Ryan
                    • Jul 2011
                    • 3478

                    #10
                    What's the experimental design and have you already read through the vignette?

                    Comment

                    • vd4mindia
                      Member
                      • May 2013
                      • 40

                      #11
                      Hello,
                      I have started using edgeR, I need some input about the method.
                      I have a data set with read counts from two different patients ( lets say it looks like the below)
                      head(m)
                      Sample_118z.0 Sample_132z.0 Sample_118p.0 Sample_132p2.0
                      XLOC_000001 626 3516 1534 2603
                      XLOC_000002 82 342 175 304
                      XLOC_000003 361 2000 80 195
                      XLOC_000004 30 143 49 66
                      XLOC_000005 0 0 0 0
                      XLOC_000006 0 0 0 1

                      A sample of the data file
                      I also have the spike ins data which should be used to normalized this counts
                      head(sp)
                      Sample_118z.0 Sample_132z.0 Sample_118p.0 Sample_132p2.0
                      ERCC-00009 30 143 49 66
                      ERCC-00025 2 13 9 7
                      ERCC-00031 0 0 0 0
                      ERCC-00034 1 9 1 3
                      ERCC-00035 11 35 5 7
                      ERCC-00042 37 186 43 78

                      I have used the DESeq earlier with the same experimental conditions and normalized the read counts with spike ins data and then ran the n.binom test for extract DEGs , but I cannot figure out how to proceed the same in case of the edgeR. Can anyone help me?

                      Comment

                      • dpryan
                        Devon Ryan
                        • Jul 2011
                        • 3478

                        #12
                        I mentioned this on your thread on biostars, but I'll reply here to for the sake of others. If you read the help for calcNormFactors, you'll see that it places the normalization factors in object$samples$norm.factors, so just fill them in there.

                        Comment

                        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
                          ...
                          Yesterday, 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, Today, 10:52 AM
                        0 responses
                        8 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, Yesterday, 05:39 AM
                        0 responses
                        17 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 10-13-2026, 09:56 AM
                        0 responses
                        15 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 10-09-2026, 11:14 AM
                        0 responses
                        27 views
                        0 reactions
                        Last Post SEQadmin2  
                        Working...